ansible-wordpress-host-init/roles/install-wordpress/tasks/main.yml
2023-03-28 10:24:45 +02:00

40 lines
761 B
YAML

---
- name: Download latest WP
get_url:
url: https://wordpress.org/latest.zip
dest: /tmp/latest.zip
mode: '0660'
- name: Extract wordpress
unarchive:
src: /tmp/latest.zip
dest: /var/www/
remote_src: yes
- name: Delete the wordpress zip
file:
state: absent
path: /tmp/latest.zip
- name: Create wwwroot
file:
path: /var/www/{{ vhost_name}}
state: directory
mode: '0755'
- name: Rename folder
shell: mv /var/www/wordpress/* /var/www/{{ vhost_name }}/
- name: Delete old folder
file:
path: /var/www/wordpress
state: absent
- name: Chown
become: true
shell: chown -R www-data:www-data /var/www/{{ vhost_name }}
- name: Chmod
become: true
shell: chmod -R 755 /var/www/{{ vhost_name }}