|
Packit |
e64f81 |
---
|
|
Packit |
e64f81 |
- name: Test host IP addresses
|
|
Packit |
e64f81 |
hosts: ipaserver
|
|
Packit |
e64f81 |
become: true
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
tasks:
|
|
Packit |
e64f81 |
- name: Get Domain from server name
|
|
Packit |
e64f81 |
set_fact:
|
|
Packit |
e64f81 |
ipaserver_domain: "{{ groups.ipaserver[0].split('.')[1:] | join ('.') }}"
|
|
Packit |
e64f81 |
when: ipaserver_domain is not defined
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Set host1_fqdn .. host6_fqdn
|
|
Packit |
e64f81 |
set_fact:
|
|
Packit |
e64f81 |
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
|
|
Packit |
e64f81 |
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
|
|
Packit |
e64f81 |
host3_fqdn: "{{ 'host3.' + ipaserver_domain }}"
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Get IPv4 address prefix from server node
|
|
Packit |
e64f81 |
set_fact:
|
|
Packit |
e64f81 |
ipv4_prefix: "{{ ansible_default_ipv4.address.split('.')[:-1] |
|
|
Packit |
e64f81 |
join('.') }}"
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host absent
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name:
|
|
Packit |
e64f81 |
- "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
- "{{ host2_fqdn }}"
|
|
Packit |
e64f81 |
- "{{ host3_fqdn }}"
|
|
Packit |
e64f81 |
update_dns: yes
|
|
Packit |
e64f81 |
state: absent
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" present
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.201' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b2
|
|
Packit |
e64f81 |
update_dns: yes
|
|
Packit |
e64f81 |
reverse: no
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: not result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" present again
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.201' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b2
|
|
Packit |
e64f81 |
update_dns: yes
|
|
Packit |
e64f81 |
reverse: no
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" present again with new IP address
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
update_dns: yes
|
|
Packit |
e64f81 |
reverse: no
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: not result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" present again with new IP address again
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
update_dns: yes
|
|
Packit |
e64f81 |
reverse: no
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" member IPv4 address present
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address: "{{ ipv4_prefix + '.201' }}"
|
|
Packit |
e64f81 |
action: member
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: not result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" member IPv4 address present again
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address: "{{ ipv4_prefix + '.201' }}"
|
|
Packit |
e64f81 |
action: member
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" member IPv4 address absent
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address: "{{ ipv4_prefix + '.201' }}"
|
|
Packit |
e64f81 |
action: member
|
|
Packit |
e64f81 |
state: absent
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: not result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" member IPv4 address absent again
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address: "{{ ipv4_prefix + '.201' }}"
|
|
Packit |
e64f81 |
action: member
|
|
Packit |
e64f81 |
state: absent
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" member IPv6 address present
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address: fe80::20c:29ff:fe02:a1b2
|
|
Packit |
e64f81 |
action: member
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: not result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" member IPv6 address present again
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address: fe80::20c:29ff:fe02:a1b2
|
|
Packit |
e64f81 |
action: member
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" member IPv6 address absent
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address: fe80::20c:29ff:fe02:a1b2
|
|
Packit |
e64f81 |
action: member
|
|
Packit |
e64f81 |
state: absent
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: not result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" member IPv6 address absent again
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address: fe80::20c:29ff:fe02:a1b2
|
|
Packit |
e64f81 |
action: member
|
|
Packit |
e64f81 |
state: absent
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" member all ip-addresses absent
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
action: member
|
|
Packit |
e64f81 |
state: absent
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: not result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host1_fqdn }}" all member ip-addresses absent again
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
action: member
|
|
Packit |
e64f81 |
state: absent
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Hosts "{{ host1_fqdn }}" and "{{ host2_fqdn }}" present with same IP addresses
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
hosts:
|
|
Packit |
e64f81 |
- name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
- name: "{{ host2_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: not result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Hosts "{{ host1_fqdn }}" and "{{ host2_fqdn }}" present with same IP addresses again
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
hosts:
|
|
Packit |
e64f81 |
- name: "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
- name: "{{ host2_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Hosts "{{ host3_fqdn }}" present with same IP addresses
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
hosts:
|
|
Packit |
e64f81 |
- name: "{{ host3_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: not result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Hosts "{{ host3_fqdn }}" present with same IP addresses again
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
hosts:
|
|
Packit |
e64f81 |
- name: "{{ host3_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host3_fqdn }}" present with differnt IP addresses
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
hosts:
|
|
Packit |
e64f81 |
- name: "{{ host3_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.111' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b1
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.121' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b2
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: not result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host3_fqdn }}" present with different IP addresses again
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
hosts:
|
|
Packit |
e64f81 |
- name: "{{ host3_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.111' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b1
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.121' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b2
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host3_fqdn }}" present with old IP addresses
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
hosts:
|
|
Packit |
e64f81 |
- name: "{{ host3_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: not result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
e64f81 |
- name: Host "{{ host3_fqdn }}" present with old IP addresses again
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
hosts:
|
|
Packit |
e64f81 |
- name: "{{ host3_fqdn }}"
|
|
Packit |
e64f81 |
ip_address:
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.211' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b3
|
|
Packit |
e64f81 |
- "{{ ipv4_prefix + '.221' }}"
|
|
Packit |
e64f81 |
- fe80::20c:29ff:fe02:a1b4
|
|
Packit |
e64f81 |
register: result
|
|
Packit |
e64f81 |
failed_when: result.changed
|
|
Packit |
e64f81 |
|
|
Packit |
762bda |
- name: Absent host01.ihavenodns.info test
|
|
Packit |
762bda |
ipahost:
|
|
Packit |
762bda |
ipaadmin_password: MyPassword123
|
|
Packit |
762bda |
hosts:
|
|
Packit |
762bda |
- name: host01.ihavenodns.info
|
|
Packit |
762bda |
state: absent
|
|
Packit |
762bda |
register: result
|
|
Packit |
762bda |
failed_when: result.changed
|
|
Packit |
762bda |
|
|
Packit |
e64f81 |
- name: Host absent
|
|
Packit |
e64f81 |
ipahost:
|
|
Packit |
e64f81 |
ipaadmin_password: MyPassword123
|
|
Packit |
e64f81 |
name:
|
|
Packit |
e64f81 |
- "{{ host1_fqdn }}"
|
|
Packit |
e64f81 |
- "{{ host2_fqdn }}"
|
|
Packit |
e64f81 |
- "{{ host3_fqdn }}"
|
|
Packit |
e64f81 |
update_dns: yes
|
|
Packit |
e64f81 |
state: absent
|