mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-30 11:24:50 +00:00
Merge pull request #1186 from t-woerner/test_host_random_conditional_statements_no_jinja2_templating
test_host_random: No jinja2 templating in conditional statements
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
|
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
|
||||||
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
|
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
|
||||||
|
server_fqdn: "{{ ansible_facts['fqdn'] }}"
|
||||||
|
|
||||||
- name: Test hosts absent
|
- name: Test hosts absent
|
||||||
ipahost:
|
ipahost:
|
||||||
@@ -86,10 +87,8 @@
|
|||||||
- name: Assert randompassword is defined for host1 and host2.
|
- name: Assert randompassword is defined for host1 and host2.
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- ipahost.host["{{ host1_fqdn }}"].randompassword is
|
- ipahost.host[host1_fqdn].randompassword is defined
|
||||||
defined
|
- ipahost.host[host2_fqdn].randompassword is defined
|
||||||
- ipahost.host["{{ host2_fqdn }}"].randompassword is
|
|
||||||
defined
|
|
||||||
|
|
||||||
- name: Print generated random password for "{{ host1_fqdn }}"
|
- name: Print generated random password for "{{ host1_fqdn }}"
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
@@ -99,11 +98,11 @@
|
|||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
var: ipahost.host["{{ host2_fqdn }}"].randompassword
|
var: ipahost.host["{{ host2_fqdn }}"].randompassword
|
||||||
|
|
||||||
- name: Enrolled host "{{ ansible_facts['fqdn'] }}" fails to set random password with update_password always
|
- name: Enrolled host "{{ server_fqdn }}" fails to set random password with update_password always
|
||||||
ipahost:
|
ipahost:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
hosts:
|
hosts:
|
||||||
- name: "{{ ansible_facts['fqdn'] }}"
|
- name: "{{ server_fqdn }}"
|
||||||
random: yes
|
random: yes
|
||||||
update_password: always
|
update_password: always
|
||||||
register: ipahost
|
register: ipahost
|
||||||
@@ -112,8 +111,7 @@
|
|||||||
- name: Assert randompassword is not defined for 'ansible_fqdn'.
|
- name: Assert randompassword is not defined for 'ansible_fqdn'.
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- ipahost.host["{{ ansible_facts['fqdn'] }}"].randompassword is
|
- ipahost.host[server_fqdn].randompassword is not defined
|
||||||
not defined
|
|
||||||
- "'Password cannot be set on enrolled host' in ipahost.msg"
|
- "'Password cannot be set on enrolled host' in ipahost.msg"
|
||||||
|
|
||||||
- name: Hosts "{{ host1_fqdn }}" and "{{ host2_fqdn }}" absent
|
- name: Hosts "{{ host1_fqdn }}" and "{{ host2_fqdn }}" absent
|
||||||
|
|||||||
Reference in New Issue
Block a user