Skip to content

Commit 06cd00f

Browse files
committed
make conditional tasks work with a broader set of values
thanks to @berendt for the hint! I found more on that here: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html#conditionals-based-on-variables Signed-off-by: Matthias Büchse <[email protected]>
1 parent d93ae3f commit 06cd00f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

playbooks/post_cloud.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
cmd: python3 Tests/scs-test-runner.py --config Tests/config.toml --debug cleanup --preset {{ preset }}
88
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
99
changed_when: true
10-
when: do_cleanup
10+
when: do_cleanup | bool
1111

1212
- name: Unprovision clusters
1313
ansible.builtin.command:
1414
cmd: python3 Tests/scs-test-runner.py --config Tests/config.toml --debug unprovision --preset {{ preset }}
1515
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
1616
changed_when: true
17-
when: do_provision
17+
when: do_provision | bool

playbooks/pre_cloud.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
# ansible.builtin.pip:
1010
# chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
1111
# requirements: "Tests/iaas/requirements.txt"
12-
# when: iaas
12+
# when: iaas | bool
1313

1414
- name: Install kaas dependencies
1515
ansible.builtin.pip:
1616
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
1717
requirements: "Tests/kaas/requirements.txt"
18-
when: kaas
18+
when: kaas | bool
1919

2020
- name: Create cloud config dir
2121
ansible.builtin.file:
@@ -70,11 +70,11 @@
7070
cmd: python3 Tests/scs-test-runner.py --config Tests/config.toml --debug cleanup --preset {{ preset }}
7171
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
7272
changed_when: true
73-
when: do_cleanup
73+
when: do_cleanup | bool
7474

7575
- name: Provision necessary clusters
7676
ansible.builtin.command:
7777
cmd: python3 Tests/scs-test-runner.py --config Tests/config.toml --debug provision --preset {{ preset }}
7878
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
7979
changed_when: true
80-
when: do_provision
80+
when: do_provision | bool

0 commit comments

Comments
 (0)