websoft9/apps/roles/wordpress/tasks/main.yml

35 lines
1.1 KiB
YAML
Raw Normal View History

2022-11-03 11:08:44 +08:00
- name: Install {{appname}}
include_tasks: tasks/install.yml
vars:
app: "wordpress"
2022-11-18 11:26:52 +08:00
- block:
2022-11-23 17:30:52 +08:00
- name: Create backup directory
shell: |
mkdir -p /data/apps/wordpress/data/backup
2022-11-18 11:26:52 +08:00
- name: Copy wp-cli
copy:
src: wp-cli.phar
2022-11-23 17:30:52 +08:00
dest: /data/apps/wordpress/data/backup/wp-cli.phar
2022-11-18 11:26:52 +08:00
2022-11-18 11:28:48 +08:00
- block:
- name: Download {{wordpress_solution}} theme to host machine
unarchive:
src: "{{wordpress_theme_download_url}}/{{wordpress_solution}}/{{wordpress_theme_meta[wordpress_solution].theme}}.zip"
dest: /data/apps/wordpress/data/backup/theme/{{wordpress_solution}}
owner: www-data
group: www-data
remote_src: yes
- name: Download plugin to host machine
unarchive:
src: "{{wordpress_theme_download_url}}/{{wordpress_solution}}/{{item}}.zip"
dest: /data/apps/wordpress/data/backup/plugin/{{wordpress_solution}}
owner: www-data
group: www-data
remote_src: yes
with_items:
- "{{wordpress_theme_meta[wordpress_solution].plugin}}"
when: wordpress_theme_meta[wordpress_solution].plugin !=""
2022-11-23 17:30:52 +08:00
when: wordpress_solution != ""