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

43 lines
1.2 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-03 13:40:47 +08:00
- block:
2022-11-03 11:08:44 +08:00
- name: Copy wp-cli
copy:
src: wp-cli.phar
dest: wp-cli.phar
- name: Install wp-cli
shell: |
2022-11-03 13:40:47 +08:00
docker cp wp-cli.phar wordpress:/tmp
docker exec -it wordpress chmod +x /tmp/wp-cli.phar
docker exec -it mv /tmp/wp-cli.phar /usr/local/bin/wp
2022-11-03 11:08:44 +08:00
- block:
- name: Download {{wordpress_theme}} theme
unarchive:
src: "{{wordpress_theme_download_url}}/{{wordpress_theme}}/{{wordpress_theme}}.zip"
dest: /var/lib/docker/volumes/wordpress_wordpress/_data/wp-content/themes
owner: www-data
group: www-data
remote_src: yes
- name: Download plugin
unarchive:
src: "{{wordpress_theme_download_url}}/{{wordpress_theme}}/{{item}}.zip"
dest: /var/lib/docker/volumes/wordpress_wordpress/_data/wp-content/plugins
owner: www-data
group: www-data
remote_src: yes
with_items:
- "{{wordpress_theme_meta[wordpress_theme].plugin}}"
when: wordpress_theme_meta[wordpress_theme].plugin !=""
- name: Override the WordPress default theme
shell: |
pwd
2022-11-03 13:40:47 +08:00
when: wordpress_theme != ""