websoft9/apps/roles/wordpress/tasks/main.yml
chendelin1982 8abab8d59f wordpress
2022-11-03 13:49:47 +08:00

43 lines
1.2 KiB
YAML

- name: Install {{appname}}
include_tasks: tasks/install.yml
vars:
app: "wordpress"
- block:
- name: Copy wp-cli
copy:
src: wp-cli.phar
dest: wp-cli.phar
- name: Install wp-cli
shell: |
docker cp wp-cli.phar wordpress:/tmp
docker exec -it wordpress chmod +x /tmp/wp-cli.phar
docker exec -it wordpress mv /tmp/wp-cli.phar /usr/local/bin/wp
- 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
when: wordpress_theme != ""