File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 11[defaults]
2- stdout_callback = log_plays
32log_path = ~/ansible.log
43cache_plugin = jsonfile
54cache_path = ~/.ansible/inventory_cache
Original file line number Diff line number Diff line change 4242 state : started
4343 enabled : yes
4444
45- - name : Clone repository
46- git :
47- repo : " {{ repo_url }}"
45+ - name : Check if repo exists
46+ stat :
47+ path : " {{ app_dir }}/.git"
48+ register : repo_exists
49+
50+ - name : Clone or update repo
51+ git :
52+ repo : " {{ repo_url }}"
4853 dest : " {{ app_dir }}"
49- clone : yes
50- update : yes
54+ update : " {{ repo_exists.stat.exists }}"
55+ force : yes
56+ version : " main"
5157
5258 - name : Run Docker Compose
53- command : docker compose up -d
59+ command : docker compose up -d --force-recreate
5460 args :
5561 chdir : " {{ app_dir }}"
5662
You can’t perform that action at this time.
0 commit comments