File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 28
28
command : ' {{ kolla_container_engine | default("docker")}} ps --format {% raw %}"{{.Names}}"{% endraw %}'
29
29
register : host_containers
30
30
31
+ - name : Set fact for containers list
32
+ set_fact :
33
+ containers_list : host_containers.stdout
34
+
31
35
- name : Fail if no containers match given regex
32
36
vars :
33
- hotfix_containers : host_containers | split('\n') | regex_search(container_hotfix_container_regex)
37
+ hotfix_containers : " {{ containers_list | split('\n ') | regex_search(container_hotfix_container_regex) }} "
34
38
fail :
35
39
msg : " No containers matched. Please check your regex. Containers running on host: {{ host_containers | split('\n ') }}"
36
40
when : hotfix_containers == ""
51
55
52
56
- name : Apply hotfix
53
57
include_tasks : run-container-hotfix.yml
54
- loop : " {{ host_containers.stdout | regex_findall(container_hotfix_container_regex, multiline=True) | list | unique }}"
58
+ loop : " {{ containers_list | regex_findall(container_hotfix_container_regex, multiline=True) | list | unique }}"
55
59
loop_control :
56
60
loop_var : hotfix_container
57
61
62
66
63
67
- name : Restart containers if requested
64
68
command : " {{ kolla_container_engine | default('docker')}} restart {{ item }}"
65
- loop : " {{ host_containers.stdout | regex_findall(container_hotfix_container_regex, multiline=True) | list | unique }}"
69
+ loop : " {{ containers_list | regex_findall(container_hotfix_container_regex, multiline=True) | list | unique }}"
66
70
when : container_hotfix_restart_containers
You can’t perform that action at this time.
0 commit comments