mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-31 03:44:41 +00:00
tests/env_freeipa_facts.yml: Use FQCN for ansible.builtin
Use Fully Qualified Collection Name (FQCN) for ansible builtins. This is ansible.builtin.set_fact instead of set_fact for example and aplies for all actions that are part of ansible.builtin. All the replaced ansible.builtins: assert, command, copy, debug, fail, fetch, file, import_playbook, import_tasks, include_role, include_tasks, include_vars, package, set_fact, shell, slurp, stat, systemd
This commit is contained in:
@@ -8,12 +8,12 @@
|
|||||||
#
|
#
|
||||||
---
|
---
|
||||||
- name: Retrieving FreeIPA version.
|
- name: Retrieving FreeIPA version.
|
||||||
shell:
|
ansible.builtin.shell:
|
||||||
cmd: 'ipa --version | sed -n "s/VERSION: \([^,]*\).*API_VERSION: \([^,]*\).*/\1\\n\2/p"'
|
cmd: 'ipa --version | sed -n "s/VERSION: \([^,]*\).*API_VERSION: \([^,]*\).*/\1\\n\2/p"'
|
||||||
register: ipa_cmd_version
|
register: ipa_cmd_version
|
||||||
|
|
||||||
- name: Verify if host is an IPA server or client.
|
- name: Verify if host is an IPA server or client.
|
||||||
shell:
|
ansible.builtin.shell:
|
||||||
cmd: |
|
cmd: |
|
||||||
echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin
|
echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin
|
||||||
RESULT=$(KRB5CCNAME={{ krb5ccname }} ipa server-show `hostname` && echo SERVER || echo CLIENT)
|
RESULT=$(KRB5CCNAME={{ krb5ccname }} ipa server-show `hostname` && echo SERVER || echo CLIENT)
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Set FreeIPA facts.
|
- name: Set FreeIPA facts.
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
ipa_version: "{{ ipa_cmd_version.stdout_lines[0] }}"
|
ipa_version: "{{ ipa_cmd_version.stdout_lines[0] }}"
|
||||||
ipa_api_version: "{{ ipa_cmd_version.stdout_lines[1] }}"
|
ipa_api_version: "{{ ipa_cmd_version.stdout_lines[1] }}"
|
||||||
ipa_host_is_client: "{{ (output.stdout_lines[-1] == 'CLIENT') | bool }}"
|
ipa_host_is_client: "{{ (output.stdout_lines[-1] == 'CLIENT') | bool }}"
|
||||||
@@ -32,12 +32,12 @@
|
|||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Get Domain from server name
|
- name: Get Domain from server name
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
|
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
|
||||||
when: "'fqdn' in ansible_facts"
|
when: "'fqdn' in ansible_facts"
|
||||||
|
|
||||||
- name: Set Domain to 'ipa.test' if FQDN could not be retrieved.
|
- name: Set Domain to 'ipa.test' if FQDN could not be retrieved.
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
ipaserver_domain: "ipa.test"
|
ipaserver_domain: "ipa.test"
|
||||||
when: "'fqdn' not in ansible_facts"
|
when: "'fqdn' not in ansible_facts"
|
||||||
when: ipaserver_domain is not defined
|
when: ipaserver_domain is not defined
|
||||||
|
|||||||
Reference in New Issue
Block a user