diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..722d5e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode diff --git a/playbooks/deploy.yaml b/playbooks/deploy.yaml index fd33911..d71b9de 100644 --- a/playbooks/deploy.yaml +++ b/playbooks/deploy.yaml @@ -81,3 +81,10 @@ hosts: nginx_hosts:!public_reverse_proxy_hosts roles: - nginx + +- name: Configure unattended upgrades + collections: [ 'debops.debops' ] + hosts: all + become: true + roles: + - role: unattended_upgrades diff --git a/playbooks/roles/docker_compose/tasks/main.yaml b/playbooks/roles/docker_compose/tasks/main.yaml index 542e096..63cb9fc 100644 --- a/playbooks/roles/docker_compose/tasks/main.yaml +++ b/playbooks/roles/docker_compose/tasks/main.yaml @@ -97,3 +97,11 @@ # msg: "If this reports changed, then the docker compose containers changed." # changed_when: (docker_compose__ps_json_before_up.stdout | from_json | community.general.json_query('[].ID') | sort) # != (docker_compose__ps_json_after_up.stdout | from_json | community.general.json_query('[].ID') | sort) + +- name: Install automatic update cron job + become: true + ansible.builtin.cron: + name: 'docker compose auto update' + minute: "0" + hour: "5" + job: "cd /ansible_docker_compose; docker compose pull && docker compose up -d"