Skip to content

Commit 207684a

Browse files
committed
Add retries while Verify a FQDN is set
Due to some race condition, FQDN check is running before dnsmasq is returning FQDN for compute nodes. To avoid that, we want that this check should retry for couple of minutes until dnsmasq is ready and returns FQDN. Ref: openstack-k8s-operators/architecture#595
1 parent 0cb6a70 commit 207684a

File tree

1 file changed

+7
-6
lines changed
  • roles/edpm_nodes_validation/tasks

1 file changed

+7
-6
lines changed

roles/edpm_nodes_validation/tasks/main.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@
7272
ansible.builtin.command: hostname -f
7373
register: hostname
7474
changed_when: false
75-
76-
- name: Verify a FQDN is set
77-
ansible.builtin.assert:
78-
that: hostname.stdout.find(".") != -1
79-
fail_msg: "{{ hostname.stdout }} does not contain . and does not appear to be an FQDN."
80-
success_msg: "{{ hostname.stdout }} contains . and appears to be an FQDN."
75+
retries: 5
76+
delay: 60
77+
until: hostname.stdout.find(".") != -1
78+
rescue:
79+
- name: Fail if hostname is not FQDN
80+
ansible.builtin.fail:
81+
msg: "{{ hostname.stdout }} does not contain . and does not appear to be an FQDN."
8182

8283
- name: Verify the configured FQDN vs {{ edpm_nodes_validation_validate_fqdn_hosts_file }}
8384
ansible.builtin.shell: |

0 commit comments

Comments
 (0)