Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Don't try to set unbound address when already set
Browse files Browse the repository at this point in the history
The 'ip addr add' command will fail the deployment if the address has
already been set.

Change-Id: I25f04198c5cc219f8b8e23d7501bfbce62b35959
(cherry picked from commit bab1af2)
  • Loading branch information
beagles committed Oct 12, 2021
1 parent 2926a5f commit 772b827
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tripleo_ansible/roles/tripleo_unbound/tasks/collocated_bind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,16 @@
- (_public_api_interface.interface is defined) and (_public_api_interface.interface|length > 0)
become: true
block:
- name: Check if the address is already on the device.
shell: "ip -o addr show dev {{ _public_api_interface.interface }} | grep {{ tripleo_unbound_listen_interfaces[0] }}"
failed_when: false
register:
_current_addr_search

- name: Set the unbound additional IPv4 address on the required device.
command: "ip addr add {{ tripleo_unbound_listen_interfaces[0] }}/32 dev {{ _public_api_interface.interface }}"
when:
_current_addr_search.rc == 1

- name: Add line to ifup-local to make sure unbound's listen IPv4 address is set on restart
become: true
Expand All @@ -62,8 +70,17 @@
- (_public_api_interface.interface is defined) and (_public_api_interface.interface|length > 0)
become: true
block:
- name: Check if the address is already on the device.
shell: "ip -o addr show dev {{ _public_api_interface.interface }} | grep {{ tripleo_unbound_listen_interfaces[0] }}"
failed_when: false
register:
_current_addr_search

- name: Set the unbound additional IPv6 address on the required device.
command: "ip addr add {{ tripleo_unbound_listen_interfaces[0] }}/128 dev {{ _public_api_interface.interface }}"
when:
_current_addr_search.rc == 1


- name: Add line to ifup-local to make sure unbound's listen IPv6 address is set on restart
become: true
Expand Down

0 comments on commit 772b827

Please sign in to comment.