Replaced groups.ipaserver[0] by ansible_fqdn.

Since we are using docker for running the tests we can no longer rely on
groups.ipaserver[0] as the managed host hostname.
This commit is contained in:
Sergio Oliveira Campos
2020-07-24 11:09:23 -03:00
parent 4e89da8536
commit 7a6036f7cf
25 changed files with 51 additions and 58 deletions

View File

@@ -3,7 +3,7 @@
- name: Test sudorule
hosts: ipaserver
become: true
gather_facts: false
gather_facts: true
tasks:
@@ -43,8 +43,7 @@
ipahostgroup:
ipaadmin_password: SomeADMINpassword
name: cluster
host:
- "{{ groups.ipaserver[0] }}"
host: "{{ ansible_fqdn }}"
- name: Ensure some sudocmds are available
ipasudocmd:
@@ -501,20 +500,20 @@
register: result
failed_when: result.changed
- name: Ensure host "{{ groups.ipaserver[0] }}" is present in sudorule.
- name: Ensure host "{{ ansible_fqdn }}" is present in sudorule.
ipasudorule:
ipaadmin_password: SomeADMINpassword
name: testrule1
host: "{{ groups.ipaserver[0] }}"
host: "{{ ansible_fqdn }}"
action: member
register: result
failed_when: not result.changed
- name: Ensure host "{{ groups.ipaserver[0] }}" is present in sudorule, again.
- name: Ensure host "{{ ansible_fqdn }}" is present in sudorule, again.
ipasudorule:
ipaadmin_password: SomeADMINpassword
name: testrule1
host: "{{ groups.ipaserver[0] }}"
host: "{{ ansible_fqdn }}"
action: member
register: result
failed_when: result.changed

View File

@@ -7,7 +7,7 @@
tasks:
- name: Get Domain from the server name
set_fact:
ipaserver_domain: "{{ groups.ipaserver[0].split('.')[1:] | join ('.') }}"
ipaserver_domain: "{{ ansible_fqdn.split('.')[1:] | join ('.') }}"
- name: Ensure sudorules are absent
ipasudorule: