Skip to content

Commit b815240

Browse files
committed
Fixing the playbook as it was triggering docker with:
"The input device is not a TTY". Fixing ansible-lint errors.
1 parent 910dc74 commit b815240

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

etc/kayobe/ansible/ovn-fix-chassis-priorities.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@
2222
hosts: "{{ ovn_nb_db_group | default('controllers') }}"
2323
tasks:
2424
- name: Find the OVN NB DB leader
25-
command: docker exec -it ovn_nb_db ovn-nbctl get-connection
25+
ansible.builtin.command: docker exec ovn_nb_db ovn-nbctl get-connection
2626
changed_when: false
2727
failed_when: false
2828
register: ovn_check_result
29-
check_mode: no
29+
check_mode: false
3030

3131
- name: Group hosts by leader/follower role
32-
group_by:
32+
ansible.builtin.group_by:
3333
key: "ovn_nb_{{ 'leader' if ovn_check_result.rc == 0 else 'follower' }}"
3434
changed_when: false
3535

3636
- name: Assert one leader exists
37-
assert:
37+
ansible.builtin.assert:
3838
that:
3939
- groups['ovn_nb_leader'] | default([]) | length == 1
4040

@@ -47,23 +47,27 @@
4747
gateway_chassis_max_priority: "{{ ovn_nb_db_hosts_sorted | length }}"
4848
tasks:
4949
- name: Fix ha_chassis priorities
50-
command: >-
51-
docker exec -it ovn_nb_db
50+
ansible.builtin.command: >-
51+
docker exec ovn_nb_db
5252
bash -c '
5353
ovn-nbctl find ha_chassis chassis_name={{ item }} |
5454
awk '\''$1 == "_uuid" { print $3 }'\'' |
5555
while read uuid; do ovn-nbctl set ha_chassis $uuid priority={{ priority }}; done'
5656
loop: "{{ ovn_nb_db_hosts_sorted }}"
5757
vars:
5858
priority: "{{ ha_chassis_max_priority | int - ovn_nb_db_hosts_sorted.index(item) }}"
59+
register: ha_chassis_command
60+
changed_when: ha_chassis_command.rc == 0
5961

6062
- name: Fix gateway_chassis priorities
61-
command: >-
62-
docker exec -it ovn_nb_db
63+
ansible.builtin.command: >-
64+
docker exec ovn_nb_db
6365
bash -c '
6466
ovn-nbctl find gateway_chassis chassis_name={{ item }} |
6567
awk '\''$1 == "_uuid" { print $3 }'\'' |
6668
while read uuid; do ovn-nbctl set gateway_chassis $uuid priority={{ priority }}; done'
6769
loop: "{{ ovn_nb_db_hosts_sorted }}"
6870
vars:
6971
priority: "{{ gateway_chassis_max_priority | int - ovn_nb_db_hosts_sorted.index(item) }}"
72+
register: gateway_chassis_command
73+
changed_when: gateway_chassis_command.rc == 0

0 commit comments

Comments
 (0)