diff options
-rw-r--r-- | jinwei.me/config/roles/debian_init/tasks/main.yaml | 1 | ||||
-rw-r--r-- | jinwei.me/config/roles/wordpress/defaults/main.yaml | 1 | ||||
-rw-r--r-- | jinwei.me/config/roles/wordpress/tasks/main.yaml | 15 |
3 files changed, 15 insertions, 2 deletions
diff --git a/jinwei.me/config/roles/debian_init/tasks/main.yaml b/jinwei.me/config/roles/debian_init/tasks/main.yaml index 002da90..750f83c 100644 --- a/jinwei.me/config/roles/debian_init/tasks/main.yaml +++ b/jinwei.me/config/roles/debian_init/tasks/main.yaml | |||
@@ -13,6 +13,7 @@ | |||
13 | - mariadb-client | 13 | - mariadb-client |
14 | - cifs-utils | 14 | - cifs-utils |
15 | - vnstat | 15 | - vnstat |
16 | - postfix | ||
16 | - lsb-release | 17 | - lsb-release |
17 | - python3 | 18 | - python3 |
18 | - python3-dev | 19 | - python3-dev |
diff --git a/jinwei.me/config/roles/wordpress/defaults/main.yaml b/jinwei.me/config/roles/wordpress/defaults/main.yaml index 250e0a5..7eef363 100644 --- a/jinwei.me/config/roles/wordpress/defaults/main.yaml +++ b/jinwei.me/config/roles/wordpress/defaults/main.yaml | |||
@@ -2,3 +2,4 @@ wordpress_image: clarkzjw/wordpress | |||
2 | wordpress_image_tag: 20221211 | 2 | wordpress_image_tag: 20221211 |
3 | wordpress_port: 30080 | 3 | wordpress_port: 30080 |
4 | wordpress_home: /opt/wordpress | 4 | wordpress_home: /opt/wordpress |
5 | samba_backup_path: /mnt/samba/VPS/aws-jinwei-me/wordpress/ | ||
diff --git a/jinwei.me/config/roles/wordpress/tasks/main.yaml b/jinwei.me/config/roles/wordpress/tasks/main.yaml index 3835145..128a3e9 100644 --- a/jinwei.me/config/roles/wordpress/tasks/main.yaml +++ b/jinwei.me/config/roles/wordpress/tasks/main.yaml | |||
@@ -1,4 +1,4 @@ | |||
1 | - name: Pull wordpress Docker image | 1 | - name: pull wordpress Docker image |
2 | community.docker.docker_image: | 2 | community.docker.docker_image: |
3 | name: "{{ wordpress_image }}:{{ wordpress_image_tag }}" | 3 | name: "{{ wordpress_image }}:{{ wordpress_image_tag }}" |
4 | source: pull | 4 | source: pull |
@@ -9,8 +9,19 @@ | |||
9 | dest: "{{ wordpress_home }}/docker-compose.yaml" | 9 | dest: "{{ wordpress_home }}/docker-compose.yaml" |
10 | mode: 0644 | 10 | mode: 0644 |
11 | 11 | ||
12 | - name: Start wordpress container using docker-compose | 12 | - name: start wordpress container using docker-compose |
13 | community.docker.docker_compose: | 13 | community.docker.docker_compose: |
14 | project_name: wordpress | 14 | project_name: wordpress |
15 | project_src: "{{ wordpress_home }}" | 15 | project_src: "{{ wordpress_home }}" |
16 | register: output | 16 | register: output |
17 | |||
18 | - name: setup cronjob for additional backup | ||
19 | cron: | ||
20 | cron_file: wordpress_backup_hetzner | ||
21 | user: root | ||
22 | state: present | ||
23 | name: "wordpress backup" | ||
24 | minute: "0" | ||
25 | hour: "0" | ||
26 | day: "*" | ||
27 | job: "tar caf /tmp/wordpress-$(date -u +\\%Y-\\%m-\\%d-\\%H-\\%M-\\%S\\%Z).tar.xz {{ wordpress_home }} && rsync -azvP /tmp/wordpress-*.tar.xz {{ samba_backup_path }}" | ||