Skip to content
Snippets Groups Projects
Commit 062b53a6 authored by Thomas Woerner's avatar Thomas Woerner
Browse files

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
parent 470d0ddc
No related branches found
No related tags found
No related merge requests found
...@@ -8,12 +8,12 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment