To resolve NIOS race condition when ip allocated via NIOS next available ip function (#49818)

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* resolves bug 45218

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* fixing review comments
This commit is contained in:
Sumit Jaiswal
2019-01-10 09:50:27 +05:30
committed by GitHub
parent 4915920d71
commit 3784abc96a
3 changed files with 51 additions and 2 deletions

View File

@@ -39,7 +39,9 @@ options:
- dns_view
ipv4addr:
description:
- Configures the IPv4 address for this A record.
- Configures the IPv4 address for this A record. Users can dynamically
allocate ipv4 address to A record by passing dictionary containing,
I(nios_next_ip) and I(CIDR network range). See example
required: true
aliases:
- ipv4
@@ -113,6 +115,17 @@ EXAMPLES = '''
username: admin
password: admin
connection: local
- name: dynamically add a record to next available ip
nios_a_record:
name: a.ansible.com
ipv4: {nios_next_ip: 192.168.10.0/24}
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
'''
RETURN = ''' # '''

View File

@@ -58,7 +58,9 @@ options:
suboptions:
ipv4addr:
description:
- Configures the IPv4 address for the host record
- Configures the IPv4 address for the host record. Users can dynamically
allocate ipv4 address to host record by passing dictionary containing,
I(nios_next_ip) and I(CIDR network range). See example
required: true
aliases:
- address
@@ -198,6 +200,18 @@ EXAMPLES = '''
username: admin
password: admin
connection: local
- name: dynamically add host record to next available ip
nios_host_record:
name: host.ansible.com
ipv4:
- address: {nios_next_ip: 192.168.10.0/24}
comment: this is a test comment
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
'''
RETURN = ''' # '''