File tree Expand file tree Collapse file tree 9 files changed +19
-15
lines changed
Expand file tree Collapse file tree 9 files changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -37,5 +37,6 @@ credentials
3737* .retry
3838.vault_pass
3939ansible /group_vars /all.yml
40+ ansible /group_vars /* .bak
4041ansible /inventory /* .pyc
4142__pycache__ /
Original file line number Diff line number Diff line change 1+ ---
2+ skip_list:
3+ - key-order
4+ - var-naming
Original file line number Diff line number Diff line change 1010 register : deploy_local_group_vars
1111 delegate_to : localhost
1212 become : false
13- run_once : true
1413
1514 - name : Load local vaulted variables when available
1615 ansible.builtin.include_vars :
1716 file : " {{ playbook_dir }}/../group_vars/all.yml"
1817 when : deploy_local_group_vars.stat.exists
19- run_once : true
2018
2119 roles :
2220 - role : web_app
Original file line number Diff line number Diff line change 11---
2- - import_playbook : provision.yml
3- - import_playbook : deploy.yml
2+ - name : Run Provision Playbook
3+ import_playbook : provision.yml
4+
5+ - name : Run Deploy Playbook
6+ import_playbook : deploy.yml
Original file line number Diff line number Diff line change 2121 - name : Set timezone
2222 ansible.builtin.command : " timedatectl set-timezone {{ common_timezone }}"
2323 when : common_current_timezone.stdout != common_timezone
24+ changed_when : true
2425 rescue :
2526 - name : Recover apt metadata after failed package preparation
26- ansible.builtin.command : apt-get update --fix-missing
27+ ansible.builtin.apt :
28+ update_cache : true
29+ force_apt_get : true
2730 changed_when : false
2831
2932 - name : Retry apt cache update after recovery
Original file line number Diff line number Diff line change 11---
2- - name : restart docker
2+ - name : Restart docker
33 ansible.builtin.service :
44 name : docker
55 state : restarted
Original file line number Diff line number Diff line change 2424 url : " {{ docker_gpg_key_url }}"
2525 dest : " {{ docker_apt_keyring_file }}"
2626 mode : " 0644"
27- notify : restart docker
27+ notify : Restart docker
2828
2929 - name : Add Docker apt repository
3030 ansible.builtin.apt_repository :
3535 {{ docker_apt_release }} stable
3636 state : present
3737 filename : docker
38- notify : restart docker
38+ notify : Restart docker
3939
4040 - name : Install Docker packages
4141 ansible.builtin.apt :
4242 name : " {{ docker_packages }}"
4343 state : present
4444 update_cache : true
4545 lock_timeout : 600
46- notify : restart docker
46+ notify : Restart docker
4747 rescue :
4848 - name : Wait before retrying Docker apt metadata updates
4949 ansible.builtin.pause :
Original file line number Diff line number Diff line change 11---
2- - name : restart web application
2+ - name : Restart web application
33 community.docker.docker_compose_v2 :
44 project_src : " {{ compose_project_dir }}"
55 state : present
Original file line number Diff line number Diff line change 1414 state : absent
1515 when : web_app_compose_file.stat.exists
1616 become : true
17- ignore_errors : true
1817
1918 - name : Optionally remove application image
2019 community.docker.docker_image :
2322 force_absent : true
2423 when : web_app_remove_image | bool
2524 become : true
26- ignore_errors : true
2725
2826 - name : Remove legacy container with the same name
2927 community.docker.docker_container :
3028 name : " {{ app_name }}"
3129 state : absent
3230 force_kill : true
3331 become : true
34- ignore_errors : true
3532
3633 - name : Remove docker-compose file
3734 ansible.builtin.file :
3835 path : " {{ compose_project_dir }}/docker-compose.yml"
3936 state : absent
4037 become : true
41- ignore_errors : true
4238
4339 - name : Remove application directory
4440 ansible.builtin.file :
4541 path : " {{ compose_project_dir }}"
4642 state : absent
4743 become : true
48- ignore_errors : true
4944
5045 - name : Confirm wipe completion
5146 ansible.builtin.debug :
You can’t perform that action at this time.
0 commit comments