diff options
Diffstat (limited to 'jinwei.me/config/roles/wordpress/tasks/main.yaml')
-rw-r--r-- | jinwei.me/config/roles/wordpress/tasks/main.yaml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/jinwei.me/config/roles/wordpress/tasks/main.yaml b/jinwei.me/config/roles/wordpress/tasks/main.yaml new file mode 100644 index 0000000..51e1a2b --- /dev/null +++ b/jinwei.me/config/roles/wordpress/tasks/main.yaml | |||
@@ -0,0 +1,29 @@ | |||
1 | - name: Pull wordpress Docker image | ||
2 | community.docker.docker_image: | ||
3 | name: "{{ wordpress_image }}:{{ wordpress_image_tag }}" | ||
4 | source: pull | ||
5 | |||
6 | - name: Start wordpress container using docker-compose | ||
7 | community.docker.docker_compose: | ||
8 | project_name: wordpress | ||
9 | definition: | ||
10 | version: '3' | ||
11 | services: | ||
12 | cloudflared: | ||
13 | image: cloudflare/cloudflared | ||
14 | container_name: cloudflare-tunnel | ||
15 | restart: always | ||
16 | command: tunnel run | ||
17 | environment: | ||
18 | - TUNNEL_TOKEN={{ cloudflared_tunnel_token }} | ||
19 | wordpress: | ||
20 | image: "{{ wordpress_image }}:{{ wordpress_image_tag }}" | ||
21 | volumes: | ||
22 | - "{{ wordpress_home }}/wp-content:/var/www/html/wp-content" | ||
23 | restart: always | ||
24 | environment: | ||
25 | - WORDPRESS_DB_HOST={{ wordpress_db_host }} | ||
26 | - WORDPRESS_DB_USER={{ wordpress_db_user }} | ||
27 | - WORDPRESS_DB_PASSWORD={{ wordpress_db_password }} | ||
28 | - WORDPRESS_DB_NAME={{ wordpress_db_name }} | ||
29 | register: output | ||