diff --git a/playbooks/host/ensure_host_with_randompassword.yml b/playbooks/host/ensure_host_with_randompassword.yml index d6376033a9fbbc513ab1f806a02f6a646217be0b..6e49e86dc62104d83b3d32a92885067be69444dc 100644 --- a/playbooks/host/ensure_host_with_randompassword.yml +++ b/playbooks/host/ensure_host_with_randompassword.yml @@ -14,5 +14,5 @@ register: ipahost - name: Print generated random password - debug: + ansible.builtin.debug: var: ipahost.host.randompassword diff --git a/playbooks/host/host-present-with-randompassword.yml b/playbooks/host/host-present-with-randompassword.yml index 2e9d793dd2814ea3e3358fd3e7a025b7f5bc931f..d26f2b606446d4b437fbe74fb09e6d64c33198c6 100644 --- a/playbooks/host/host-present-with-randompassword.yml +++ b/playbooks/host/host-present-with-randompassword.yml @@ -13,5 +13,5 @@ register: ipahost - name: Print generated random password - debug: + ansible.builtin.debug: var: ipahost.host.randompassword diff --git a/playbooks/host/hosts-present-with-randompasswords.yml b/playbooks/host/hosts-present-with-randompasswords.yml index 8f330c0db2dfef7cb960981db18ee8f6a19b9589..892fabc45496360013c976358e50adfa87b7cfa7 100644 --- a/playbooks/host/hosts-present-with-randompasswords.yml +++ b/playbooks/host/hosts-present-with-randompasswords.yml @@ -17,9 +17,9 @@ register: ipahost - name: Print generated random password for host01.example.com - debug: + ansible.builtin.debug: var: ipahost.host["host01.example.com"].randompassword - name: Print generated random password for host02.example.com - debug: + ansible.builtin.debug: var: ipahost.host["host02.example.com"].randompassword diff --git a/tests/host/certificate/test_host_certificate.yml b/tests/host/certificate/test_host_certificate.yml index b63578083f89c4005c79628e9db339d27d593df0..62c047e84ac9a61d99f92eae46d0f08c831dc2c8 100644 --- a/tests/host/certificate/test_host_certificate.yml +++ b/tests/host/certificate/test_host_certificate.yml @@ -5,12 +5,12 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Generate self-signed certificates. - shell: + ansible.builtin.shell: cmd: | openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test' openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der" @@ -100,7 +100,7 @@ failed_when: result.changed or result.failed - name: Remove certificate files. # noqa: deprecated-command-syntax - shell: + ansible.builtin.shell: cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64" with_items: [1, 2, 3] become: no diff --git a/tests/host/certificate/test_hosts_certificate.yml b/tests/host/certificate/test_hosts_certificate.yml index 77f861c0bf7043cb52cb934aed0b19cf62fb787f..3e8779b1d5ebb9cc7c57eafe13fe74e88f8ebb03 100644 --- a/tests/host/certificate/test_hosts_certificate.yml +++ b/tests/host/certificate/test_hosts_certificate.yml @@ -5,7 +5,7 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined @@ -26,7 +26,7 @@ failed_when: not result.changed or result.failed - name: Generate self-signed certificates. - shell: + ansible.builtin.shell: cmd: | openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test' openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der" @@ -99,7 +99,7 @@ failed_when: not result.changed or result.failed - name: Remove certificate files. # noqa: deprecated-command-syntax - shell: + ansible.builtin.shell: cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64" with_items: [1, 2, 3] become: no diff --git a/tests/host/test_host.yml b/tests/host/test_host.yml index bee85ef74948d859bbe1ae60cb048b2a8a40a9b1..ac62b71e247d3019e6f81af8fd0d750fd8bf0e21 100644 --- a/tests/host/test_host.yml +++ b/tests/host/test_host.yml @@ -5,12 +5,12 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Set host1_fqdn .. host6_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" @@ -33,7 +33,7 @@ state: absent - name: Get IPv4 address prefix from server node - set_fact: + ansible.builtin.set_fact: ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | join('.') }}" diff --git a/tests/host/test_host_allow_create_keytab.yml b/tests/host/test_host_allow_create_keytab.yml index b5242422586b587b179b893ca26c8fee886b1cb0..ee2da2f6fb17f6cf473dbead670de85589ae2ba6 100644 --- a/tests/host/test_host_allow_create_keytab.yml +++ b/tests/host/test_host_allow_create_keytab.yml @@ -5,17 +5,17 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Get Realm from server name - set_fact: + ansible.builtin.set_fact: ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}" when: ipaserver_realm is not defined - name: Set host1_fqdn .. host3_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" diff --git a/tests/host/test_host_allow_retrieve_keytab.yml b/tests/host/test_host_allow_retrieve_keytab.yml index f38ea30220dbf77c35eb01ba864c3780c76ec824..13af3d0165bfe3269c2ace28149bd465b33d245c 100644 --- a/tests/host/test_host_allow_retrieve_keytab.yml +++ b/tests/host/test_host_allow_retrieve_keytab.yml @@ -5,17 +5,17 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Get Realm from server name - set_fact: + ansible.builtin.set_fact: ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}" when: ipaserver_realm is not defined - name: Set host1_fqdn .. host3_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" diff --git a/tests/host/test_host_bool_params.yml b/tests/host/test_host_bool_params.yml index cfb2f653c4b0ba78714f65bed5d41f2534a76e00..e5d4dfd03f05804e585878c92b7b3d143a0d7e29 100644 --- a/tests/host/test_host_bool_params.yml +++ b/tests/host/test_host_bool_params.yml @@ -5,12 +5,12 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Set host1_fqdn .. host6_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" - name: Host absent diff --git a/tests/host/test_host_client_context.yml b/tests/host/test_host_client_context.yml index 8afcef328a3d931fcb85e7bcc391ec8087e60fab..e36b0925e63b3fe575e236d317c9f108fa0e75fa 100644 --- a/tests/host/test_host_client_context.yml +++ b/tests/host/test_host_client_context.yml @@ -6,7 +6,7 @@ tasks: - name: Include FreeIPA facts. - include_tasks: ../env_freeipa_facts.yml + ansible.builtin.include_tasks: ../env_freeipa_facts.yml # Test will only be executed if host is not a server. - name: Execute with server context in the client. @@ -27,13 +27,13 @@ # in upstream CI. - name: Test automember using client context, in client host. - import_playbook: test_host.yml + ansible.builtin.import_playbook: test_host.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test automember using client context, in server host. - import_playbook: test_host.yml + ansible.builtin.import_playbook: test_host.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/host/test_host_empty_string_params.yml b/tests/host/test_host_empty_string_params.yml index 59481d1198d048d87a45c7c03ccc90cb455a3daa..1103b0f82a85c6d212660f77cc14177e2f0a7afa 100644 --- a/tests/host/test_host_empty_string_params.yml +++ b/tests/host/test_host_empty_string_params.yml @@ -6,12 +6,12 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Set host1_fqdn .. host6_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" # CLEANUP TEST ITEMS diff --git a/tests/host/test_host_ipaddresses.yml b/tests/host/test_host_ipaddresses.yml index 9ff9a0909b5f5ca46a23d7286df14ab1dd28f595..e85916178e9ca58d7d823aede2e5201a02b0ab88 100644 --- a/tests/host/test_host_ipaddresses.yml +++ b/tests/host/test_host_ipaddresses.yml @@ -5,18 +5,18 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Set host1_fqdn .. host6_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" - name: Get IPv4 address prefix from server node - set_fact: + ansible.builtin.set_fact: ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | join('.') }}" diff --git a/tests/host/test_host_managedby_host.yml b/tests/host/test_host_managedby_host.yml index a96b674f68d65a49bc018dac59154662819e15f6..36551d02c40f5d1ffe75feded2e3091e43116bb5 100644 --- a/tests/host/test_host_managedby_host.yml +++ b/tests/host/test_host_managedby_host.yml @@ -5,12 +5,12 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Set host1_fqdn .. host2_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" diff --git a/tests/host/test_host_principal.yml b/tests/host/test_host_principal.yml index 7dcbc42cb75ccdd09785c8b5d0809ace98c90543..1f6dbb151527428401f9d8a120c8ff0b7ce2d33a 100644 --- a/tests/host/test_host_principal.yml +++ b/tests/host/test_host_principal.yml @@ -5,17 +5,17 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Get Realm from server name - set_fact: + ansible.builtin.set_fact: ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}" when: ipaserver_realm is not defined - name: Set host1_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" - name: Host host1 absent diff --git a/tests/host/test_host_random.yml b/tests/host/test_host_random.yml index 8b9a2c081741a98ec45a81f5a0ad7ebbaec03edb..1f49b43e0cc1276c4b032fe3a4a961bf8b73161a 100644 --- a/tests/host/test_host_random.yml +++ b/tests/host/test_host_random.yml @@ -5,12 +5,12 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Set host1_fqdn and host2_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" @@ -34,12 +34,12 @@ failed_when: not ipahost.changed or ipahost.failed - name: Assert ipahost.host.randompassword is defined. - assert: + ansible.builtin.assert: that: - ipahost.host.randompassword is defined - name: Print generated random password - debug: + ansible.builtin.debug: var: ipahost.host.randompassword - name: Host "{{ host1_fqdn }}" absent @@ -64,7 +64,7 @@ failed_when: not ipahost.changed or ipahost.failed - name: Assert randompassword is defined for host1 and host2. - assert: + ansible.builtin.assert: that: - ipahost.host["{{ host1_fqdn }}"].randompassword is defined @@ -72,11 +72,11 @@ defined - name: Print generated random password for "{{ host1_fqdn }}" - debug: + ansible.builtin.debug: var: ipahost.host["{{ host1_fqdn }}"].randompassword - name: Print generated random password for "{{ host2_fqdn }}" - debug: + ansible.builtin.debug: var: ipahost.host["{{ host2_fqdn }}"].randompassword - name: Enrolled host "{{ ansible_facts['fqdn'] }}" fails to set random password with update_password always @@ -90,7 +90,7 @@ failed_when: ipahost.changed or not ipahost.failed - name: Assert randompassword is not defined for 'ansible_fqdn'. - assert: + ansible.builtin.assert: that: - ipahost.host["{{ ansible_facts['fqdn'] }}"].randompassword is not defined diff --git a/tests/host/test_host_reverse.yml b/tests/host/test_host_reverse.yml index 8e5e337e168f61acead6011167c8070fae48fa0c..27c64328726fce9099f74e46e3185c5b523ee62b 100644 --- a/tests/host/test_host_reverse.yml +++ b/tests/host/test_host_reverse.yml @@ -5,12 +5,12 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Set host1_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" - name: Host absent @@ -22,12 +22,12 @@ state: absent - name: Get IPv4 address prefix from server node - set_fact: + ansible.builtin.set_fact: ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | join('.') }}" - name: Set zone prefixes. - set_fact: + ansible.builtin.set_fact: zone_ipv6_reverse: "ip6.arpa." zone_ipv6_reverse_workaround: "d.f.ip6.arpa." zone_prefix_reverse: "in-addr.arpa" diff --git a/tests/host/test_host_sshpubkey.yml b/tests/host/test_host_sshpubkey.yml index c9c79fd66d3b40e18320c23dadc6d9498d5c7522..7bf0da164fc3df96f44eca9ca944a6ec487754e8 100644 --- a/tests/host/test_host_sshpubkey.yml +++ b/tests/host/test_host_sshpubkey.yml @@ -5,12 +5,12 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Set host1_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" - name: Host host1 absent diff --git a/tests/host/test_hosts.yml b/tests/host/test_hosts.yml index 53e3b092ee2ba817be77458a1464f7e3808c59f1..d462bd47e80a99483cd4f23cfc4cbdbd0d2a79dc 100644 --- a/tests/host/test_hosts.yml +++ b/tests/host/test_hosts.yml @@ -5,12 +5,12 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Set host1_fqdn .. host6_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" diff --git a/tests/host/test_hosts_managedby_host.yml b/tests/host/test_hosts_managedby_host.yml index 51d7272cd5cd7b299812a71f305dae0b3d183271..ec0208a5285648f482df12ff164f45b2ec6b2bb4 100644 --- a/tests/host/test_hosts_managedby_host.yml +++ b/tests/host/test_hosts_managedby_host.yml @@ -5,12 +5,12 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Set host1_fqdn .. host5_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" diff --git a/tests/host/test_hosts_principal.yml b/tests/host/test_hosts_principal.yml index 973afdc4a69d098b89eca83af3d1eecf7992bb60..77fee9e3a5399d9374fce1692bccc93928fd54eb 100644 --- a/tests/host/test_hosts_principal.yml +++ b/tests/host/test_hosts_principal.yml @@ -5,17 +5,17 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined - name: Get Realm from server name - set_fact: + ansible.builtin.set_fact: ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}" when: ipaserver_realm is not defined - name: Set host1_fqdn .. host2_fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" diff --git a/tests/hostgroup/test_hostgroup.yml b/tests/hostgroup/test_hostgroup.yml index d8a7305d3af2275a1944511688f073bbfee66597..b667d56ad66b6662bb110f95803d943090225d71 100644 --- a/tests/hostgroup/test_hostgroup.yml +++ b/tests/hostgroup/test_hostgroup.yml @@ -6,7 +6,7 @@ tasks: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: ipaserver_domain is not defined diff --git a/tests/hostgroup/test_hostgroup_client_context.yml b/tests/hostgroup/test_hostgroup_client_context.yml index c412d31b47b442a2dfcb7349c7ec03e61c861d9f..127565465d838faf6fb7e32d26227e532ea56e9a 100644 --- a/tests/hostgroup/test_hostgroup_client_context.yml +++ b/tests/hostgroup/test_hostgroup_client_context.yml @@ -6,7 +6,7 @@ tasks: - name: Include FreeIPA facts. - include_tasks: ../env_freeipa_facts.yml + ansible.builtin.include_tasks: ../env_freeipa_facts.yml # Test will only be executed if host is not a server. - name: Execute with server context in the client. @@ -27,13 +27,13 @@ # in upstream CI. - name: Test hostgroup using client context, in client host. - import_playbook: test_hostgroup.yml + ansible.builtin.import_playbook: test_hostgroup.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test hostgroup using client context, in server host. - import_playbook: test_hostgroup.yml + ansible.builtin.import_playbook: test_hostgroup.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/hostgroup/test_hostgroup_membermanager.yml b/tests/hostgroup/test_hostgroup_membermanager.yml index ff8adc87844dd106e0c448163f50d4d4b3198552..9005cd5142af3bd9b520e1b23bf52733ba22406e 100644 --- a/tests/hostgroup/test_hostgroup_membermanager.yml +++ b/tests/hostgroup/test_hostgroup_membermanager.yml @@ -5,7 +5,7 @@ gather_facts: false tasks: - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml - name: Tests requiring IPA version 4.8.4+ block: diff --git a/tests/hostgroup/test_hostgroup_rename.yml b/tests/hostgroup/test_hostgroup_rename.yml index d3dd33b25b962c96fb2c8f2f7076f7e76c950bf4..d0321796b3fa262f4646431c5a6a5636c4ee37c2 100644 --- a/tests/hostgroup/test_hostgroup_rename.yml +++ b/tests/hostgroup/test_hostgroup_rename.yml @@ -5,7 +5,7 @@ gather_facts: false tasks: - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml - name: Tests requiring IPA version 4.8.7+ block: