diff --git a/playbooks/config/retrieve-config.yml b/playbooks/config/retrieve-config.yml index 1756368041f3c49df4db1cd04cf595b7903ea396..7e7633ff2e8fcf7d75a42bb3e36364a4480ff8f7 100644 --- a/playbooks/config/retrieve-config.yml +++ b/playbooks/config/retrieve-config.yml @@ -11,5 +11,5 @@ register: serverconfig - name: Display current configuration. - debug: + ansible.builtin.debug: msg: "{{ serverconfig }}" diff --git a/playbooks/dnszone/dnszone-reverse-from-ip.yml b/playbooks/dnszone/dnszone-reverse-from-ip.yml index 218a31895d285096eb0a1ce75b18e304b77cccae..a8259c9be91a4f932d33b00212d681ede28671ef 100644 --- a/playbooks/dnszone/dnszone-reverse-from-ip.yml +++ b/playbooks/dnszone/dnszone-reverse-from-ip.yml @@ -11,5 +11,5 @@ register: result - name: Zone name inferred from `name_from_ip` - debug: + ansible.builtin.debug: msg: "Zone created: {{ result.dnszone.name }}" 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/playbooks/user/ensure_user_with_randompassword.yml b/playbooks/user/ensure_user_with_randompassword.yml index ee821f0a01f3a84c53d312bec2632e9a14e28211..6c0f8295ec2cfab3c4fae98e91d8595e3fad8494 100644 --- a/playbooks/user/ensure_user_with_randompassword.yml +++ b/playbooks/user/ensure_user_with_randompassword.yml @@ -15,5 +15,5 @@ register: ipauser - name: Print generated random password - debug: + ansible.builtin.debug: var: ipauser.user.randompassword diff --git a/playbooks/user/ensure_users_with_randompasswords.yml b/playbooks/user/ensure_users_with_randompasswords.yml index c03988778685502b56a9d80eb127d001a717a454..17783f5868421e29426d93a2d6568efd7e442a9d 100644 --- a/playbooks/user/ensure_users_with_randompasswords.yml +++ b/playbooks/user/ensure_users_with_randompasswords.yml @@ -20,9 +20,9 @@ register: ipauser - name: Print generated random password for user1 - debug: + ansible.builtin.debug: var: ipauser.user.user1.randompassword - name: Print generated random password for user2 - debug: + ansible.builtin.debug: var: ipauser.user.user2.randompassword diff --git a/playbooks/vault/retrive-data-asymmetric-vault.yml b/playbooks/vault/retrive-data-asymmetric-vault.yml index 35472d20addde667bd1011b289422e79bd818d13..89359872aea98b39a94c520ef1dcdeb76a36f18a 100644 --- a/playbooks/vault/retrive-data-asymmetric-vault.yml +++ b/playbooks/vault/retrive-data-asymmetric-vault.yml @@ -15,5 +15,5 @@ register: result no_log: true - name: Display retrieved data. - debug: + ansible.builtin.debug: msg: "Data: {{ result.vault.data }}" diff --git a/playbooks/vault/retrive-data-symmetric-vault.yml b/playbooks/vault/retrive-data-symmetric-vault.yml index 98902a1bcb4f44d2ee8d666555476340fe9eaf7f..a415d33dc25ac7181a6527bff8cc1c7f81802f34 100644 --- a/playbooks/vault/retrive-data-symmetric-vault.yml +++ b/playbooks/vault/retrive-data-symmetric-vault.yml @@ -15,5 +15,5 @@ register: result no_log: true - name: Display retrieved data. - debug: + ansible.builtin.debug: msg: "Data: {{ result.vault.data }}" diff --git a/playbooks/vault/vault-is-present-with-password-file.yml b/playbooks/vault/vault-is-present-with-password-file.yml index c92e2a6bfcd7ba93429ddad589817776ab416eaa..aa1700ce04806ca4a66356a515da32eb6ba5964b 100644 --- a/playbooks/vault/vault-is-present-with-password-file.yml +++ b/playbooks/vault/vault-is-present-with-password-file.yml @@ -6,7 +6,7 @@ tasks: - name: Copy file containing password to server. - copy: + ansible.builtin.copy: src: "{{ playbook_dir }}/password.txt" dest: "{{ ansible_facts['env'].HOME }}/password.txt" owner: "{{ ansible_user }}" @@ -20,6 +20,6 @@ vault_type: symmetric vault_password_file: "{{ ansible_facts['env'].HOME }}/password.txt" - name: Remove file containing password from server. - file: + ansible.builtin.file: path: "{{ ansible_facts['env'].HOME }}/password.txt" state: absent diff --git a/playbooks/vault/vault-is-present-with-public-key-file.yml b/playbooks/vault/vault-is-present-with-public-key-file.yml index cd1e7597cf1b8d0d6ac09772bc76023cf19d54a1..fbd6d7d98ffd9266c98fbdf0ccd4bfa70ec04695 100644 --- a/playbooks/vault/vault-is-present-with-public-key-file.yml +++ b/playbooks/vault/vault-is-present-with-public-key-file.yml @@ -11,7 +11,7 @@ tasks: - name: Copy public key file to server. - copy: + ansible.builtin.copy: src: "{{ playbook_dir }}/public.pem" dest: "{{ ansible_facts['env'].HOME }}/public.pem" owner: "{{ ansible_user }}" @@ -25,6 +25,6 @@ vault_type: asymmetric vault_public_key_file: "{{ ansible_facts['env'].HOME }}/public.pem" - name: Remove public key file from server. - file: + ansible.builtin.file: path: "{{ ansible_facts['env'].HOME }}/public.pem" state: absent diff --git a/roles/ipabackup/tasks/backup.yml b/roles/ipabackup/tasks/backup.yml index 94a4a547a8160f7726fa8c583ac81138cdac8080..2b426d08667944c78ecfa51b8669a85b63349355 100644 --- a/roles/ipabackup/tasks/backup.yml +++ b/roles/ipabackup/tasks/backup.yml @@ -2,7 +2,7 @@ # tasks file for ipabackup - name: Create backup - shell: > + ansible.builtin.shell: > ipa-backup {{ "--gpg" if ipabackup_gpg | bool else "" }} {{ "--gpg-keyring="+ipabackup_gpg_keyring if ipabackup_gpg_keyring is defined else "" }} @@ -15,7 +15,7 @@ - block: - name: Get ipabackup_item from stderr or stdout output - set_fact: + ansible.builtin.set_fact: ipabackup_item: "{{ item | regex_search('\n.*/([^\n]+)','\\1') | first }}" when: item.find("Backed up to "+ipabackup_dir+"/") > 0 with_items: @@ -25,15 +25,15 @@ label: "" - name: Fail on missing ipabackup_item - fail: msg="Failed to get ipabackup_item" + ansible.builtin.fail: msg="Failed to get ipabackup_item" when: ipabackup_item is not defined - name: Copy backup to controller - include_tasks: "{{ role_path }}/tasks/copy_backup_from_server.yml" + ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_backup_from_server.yml" when: state|default("present") == "present" - name: Remove backup on server - include_tasks: "{{ role_path }}/tasks/remove_backup_from_server.yml" + ansible.builtin.include_tasks: "{{ role_path }}/tasks/remove_backup_from_server.yml" when: not ipabackup_keep_on_server when: ipabackup_to_controller diff --git a/roles/ipabackup/tasks/copy_backup_from_server.yml b/roles/ipabackup/tasks/copy_backup_from_server.yml index e9964fdd9fe1b751fb83bbb1364e446916b780d7..516814b1316a98253cf6a3b0f51a00ae7d5339b3 100644 --- a/roles/ipabackup/tasks/copy_backup_from_server.yml +++ b/roles/ipabackup/tasks/copy_backup_from_server.yml @@ -1,36 +1,36 @@ --- - name: Fail on invalid ipabackup_item - fail: msg="ipabackup_item {{ ipabackup_item }} is not valid" + ansible.builtin.fail: msg="ipabackup_item {{ ipabackup_item }} is not valid" when: ipabackup_item is not defined or ipabackup_item | length < 1 or (ipabackup_item.find("ipa-full-") == -1 and ipabackup_item.find("ipa-data-") == -1) - name: Set controller destination directory - set_fact: + ansible.builtin.set_fact: ipabackup_controller_dir: "{{ ipabackup_controller_path | default(lookup('env','PWD')) }}/{{ ipabackup_name_prefix | default(ansible_facts['fqdn']) }}_{{ ipabackup_item }}/" - name: Stat backup on server - stat: + ansible.builtin.stat: path: "{{ ipabackup_dir }}/{{ ipabackup_item }}" register: result_backup_stat - name: Fail on missing backup directory - fail: msg="Unable to find backup {{ ipabackup_item }}" + ansible.builtin.fail: msg="Unable to find backup {{ ipabackup_item }}" when: result_backup_stat.stat.isdir is not defined - name: Get backup files to copy for "{{ ipabackup_item }}" - shell: + ansible.builtin.shell: find . -type f | cut -d"/" -f 2 args: chdir: "{{ ipabackup_dir }}/{{ ipabackup_item }}" register: result_find_backup_files - name: Copy server backup files to controller - fetch: + ansible.builtin.fetch: flat: yes src: "{{ ipabackup_dir }}/{{ ipabackup_item }}/{{ item }}" dest: "{{ ipabackup_controller_dir }}" @@ -38,7 +38,7 @@ - "{{ result_find_backup_files.stdout_lines }}" - name: Fix file modes for backup on controller - file: + ansible.builtin.file: dest: "{{ ipabackup_controller_dir }}" mode: u=rwX,go= recurse: yes diff --git a/roles/ipabackup/tasks/copy_backup_to_server.yml b/roles/ipabackup/tasks/copy_backup_to_server.yml index 73c6ef39b7ed5e724478fbe2005de5707eb6d5a6..6fa206131e79b0b385110bc1d16636e8e36e7858 100644 --- a/roles/ipabackup/tasks/copy_backup_to_server.yml +++ b/roles/ipabackup/tasks/copy_backup_to_server.yml @@ -1,40 +1,40 @@ --- - name: Fail on invalid ipabackup_name - fail: msg="ipabackup_name {{ ipabackup_name }} is not valid" + ansible.builtin.fail: msg="ipabackup_name {{ ipabackup_name }} is not valid" when: ipabackup_name is not defined or ipabackup_name | length < 1 or (ipabackup_name.find("ipa-full-") == -1 and ipabackup_name.find("ipa-data-") == -1) - name: Set controller source directory - set_fact: + ansible.builtin.set_fact: ipabackup_controller_dir: "{{ ipabackup_controller_path | default(lookup('env','PWD')) }}" - name: Set ipabackup_item - set_fact: + ansible.builtin.set_fact: ipabackup_item: "{{ ipabackup_name | regex_search('.*_(ipa-.+)','\\1') | first }}" when: "'_ipa-' in ipabackup_name" - name: Set ipabackup_item - set_fact: + ansible.builtin.set_fact: ipabackup_item: "{{ ipabackup_name }}" when: "'_ipa-' not in ipabackup_name" - name: Stat backup to copy - stat: + ansible.builtin.stat: path: "{{ ipabackup_controller_dir }}/{{ ipabackup_name }}" register: result_backup_stat delegate_to: localhost become: no - name: Fail on missing backup to copy - fail: msg="Unable to find backup {{ ipabackup_name }}" + ansible.builtin.fail: msg="Unable to find backup {{ ipabackup_name }}" when: result_backup_stat.stat.isdir is not defined - name: Copy backup files to server for "{{ ipabackup_item }}" - copy: + ansible.builtin.copy: src: "{{ ipabackup_controller_dir }}/{{ ipabackup_name }}/" dest: "{{ ipabackup_dir }}/{{ ipabackup_item }}" owner: root diff --git a/roles/ipabackup/tasks/get_ipabackup_dir.yml b/roles/ipabackup/tasks/get_ipabackup_dir.yml index a7cb29d3d983758c77daf9eb1a5f11b873cb57f2..649f90fa5050bd7542a1ae510a3c942e7f97412f 100644 --- a/roles/ipabackup/tasks/get_ipabackup_dir.yml +++ b/roles/ipabackup/tasks/get_ipabackup_dir.yml @@ -4,5 +4,5 @@ register: result_ipabackup_get_backup_dir - name: Set IPA backup dir - set_fact: + ansible.builtin.set_fact: ipabackup_dir: "{{ result_ipabackup_get_backup_dir.backup_dir }}" diff --git a/roles/ipabackup/tasks/main.yml b/roles/ipabackup/tasks/main.yml index 1ae6b28141ed034534e4ff500969babcca279197..524cd594971ca404d4c1b80f78e9cba148f6b4dd 100644 --- a/roles/ipabackup/tasks/main.yml +++ b/roles/ipabackup/tasks/main.yml @@ -2,7 +2,7 @@ # tasks file for ipabackup - name: Check for empty vars - fail: msg="Variable {{ item }} is empty" + ansible.builtin.fail: msg="Variable {{ item }} is empty" when: "item in vars and not vars[item]" with_items: "{{ ipabackup_empty_var_checks }}" vars: @@ -18,43 +18,43 @@ - ipabackup_firewalld_zone - name: Set ipabackup_data if ipabackup_data is not set but ipabackup_online is - set_fact: + ansible.builtin.set_fact: ipabackup_data: yes when: ipabackup_online | bool and not ipabackup_data | bool - name: Fail if ipabackup_from_controller and ipabackup_to_controller are set - fail: msg="ipabackup_from_controller and ipabackup_to_controller are set" + ansible.builtin.fail: msg="ipabackup_from_controller and ipabackup_to_controller are set" when: ipabackup_from_controller | bool and ipabackup_to_controller | bool - name: Fail for given ipabackup_name if state is not copied, restored or absent - fail: msg="ipabackup_name is given and state is not copied, restored or absent" + ansible.builtin.fail: msg="ipabackup_name is given and state is not copied, restored or absent" when: state is not defined or (state != "copied" and state != "restored" and state != "absent") and ipabackup_name is defined - name: Get ipabackup_dir from IPA installation - include_tasks: "{{ role_path }}/tasks/get_ipabackup_dir.yml" + ansible.builtin.include_tasks: "{{ role_path }}/tasks/get_ipabackup_dir.yml" - name: Backup IPA server - include_tasks: "{{ role_path }}/tasks/backup.yml" + ansible.builtin.include_tasks: "{{ role_path }}/tasks/backup.yml" when: state|default("present") == "present" - name: Fail on missing ipabackup_name - fail: msg="ipabackup_name is not set" + ansible.builtin.fail: msg="ipabackup_name is not set" when: (ipabackup_name is not defined or not ipabackup_name) and state is defined and (state == "copied" or state == "restored" or state == "absent") - block: - name: Get list of all backups on IPA server - shell: + ansible.builtin.shell: find . -name "ipa-full-*" -o -name "ipa-data-*" | cut -d"/" -f 2 args: chdir: "{{ ipabackup_dir }}/" register: result_backup_find_backup_files - name: Set ipabackup_names using backup list - set_fact: + ansible.builtin.set_fact: ipabackup_names: "{{ result_backup_find_backup_files.stdout_lines }}" when: state is defined and @@ -64,28 +64,28 @@ - block: - name: Fail on ipabackup_name all - fail: msg="ipabackup_name can not be all in this case" + ansible.builtin.fail: msg="ipabackup_name can not be all in this case" when: ipabackup_name is defined and ipabackup_name == "all" - name: Set ipabackup_names from ipabackup_name string - set_fact: + ansible.builtin.set_fact: ipabackup_names: ["{{ ipabackup_name }}"] when: ipabackup_name | type_debug != "list" - name: Set ipabackup_names from ipabackup_name list - set_fact: + ansible.builtin.set_fact: ipabackup_names: "{{ ipabackup_name }}" when: ipabackup_name | type_debug == "list" when: ipabackup_names is not defined and ipabackup_name is defined - name: Set empty ipabackup_names if ipabackup_name is not defined - set_fact: + ansible.builtin.set_fact: ipabackup_names: [] when: ipabackup_names is not defined and ipabackup_name is not defined - block: - name: Copy backup from IPA server - include_tasks: "{{ role_path }}/tasks/copy_backup_from_server.yml" + ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_backup_from_server.yml" vars: ipabackup_item: "{{ main_item | basename }}" with_items: @@ -95,7 +95,7 @@ when: state is defined and state == "copied" - name: Remove backup from IPA server - include_tasks: "{{ role_path }}/tasks/remove_backup_from_server.yml" + ansible.builtin.include_tasks: "{{ role_path }}/tasks/remove_backup_from_server.yml" vars: ipabackup_item: "{{ main_item | basename }}" with_items: @@ -111,7 +111,7 @@ # restore. - name: Fail to copy or restore more than one backup on the server - fail: msg="Only one backup can be copied to the server or restored" + ansible.builtin.fail: msg="Only one backup can be copied to the server or restored" when: state is defined and (state == "copied" or state == "restored") and ipabackup_from_controller | bool and ipabackup_names | length != 1 @@ -119,10 +119,10 @@ - block: - name: Copy backup to server - include_tasks: "{{ role_path }}/tasks/copy_backup_to_server.yml" + ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_backup_to_server.yml" - name: Restore IPA server after copy - include_tasks: "{{ role_path }}/tasks/restore.yml" + ansible.builtin.include_tasks: "{{ role_path }}/tasks/restore.yml" when: state|default("present") == "restored" vars: @@ -131,7 +131,7 @@ (state|default("present") == "copied" and not ipabackup_to_controller) - name: Restore IPA server - include_tasks: "{{ role_path }}/tasks/restore.yml" + ansible.builtin.include_tasks: "{{ role_path }}/tasks/restore.yml" vars: ipabackup_item: "{{ ipabackup_names[0] | basename }}" when: not ipabackup_from_controller and diff --git a/roles/ipabackup/tasks/remove_backup_from_server.yml b/roles/ipabackup/tasks/remove_backup_from_server.yml index 52c071cc0538558253799ada408bdeecf0620889..5faedfc493b287f750d4ea309a73c458bcef049f 100644 --- a/roles/ipabackup/tasks/remove_backup_from_server.yml +++ b/roles/ipabackup/tasks/remove_backup_from_server.yml @@ -1,5 +1,5 @@ --- - name: Remove backup "{{ ipabackup_item }}" - file: + ansible.builtin.file: path: "{{ ipabackup_dir }}/{{ ipabackup_item }}" state: absent diff --git a/roles/ipabackup/tasks/restore.yml b/roles/ipabackup/tasks/restore.yml index 455dea38c015d857111607058d8b9e5deabbb7c2..09c8a827a2d456fcd71e78c05c80fe5aa2fc1254 100644 --- a/roles/ipabackup/tasks/restore.yml +++ b/roles/ipabackup/tasks/restore.yml @@ -4,7 +4,7 @@ ### VARIABLES - name: Import variables specific to distribution - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml" - "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" @@ -21,30 +21,30 @@ ### GET SERVICES FROM BACKUP - name: Stat backup on server - stat: + ansible.builtin.stat: path: "{{ ipabackup_dir }}/{{ ipabackup_item }}" register: result_backup_stat - name: Fail on missing backup directory - fail: msg="Unable to find backup {{ ipabackup_item }}" + ansible.builtin.fail: msg="Unable to find backup {{ ipabackup_item }}" when: result_backup_stat.stat.isdir is not defined - name: Stat header file in backup "{{ ipabackup_item }}" - stat: + ansible.builtin.stat: path: "{{ ipabackup_dir }}/{{ ipabackup_item }}/header" register: result_backup_header_stat - name: Fail on missing header file in backup - fail: msg="Unable to find backup {{ ipabackup_item }} header file" + ansible.builtin.fail: msg="Unable to find backup {{ ipabackup_item }} header file" when: result_backup_header_stat.stat.isreg is not defined - name: Get services from backup - shell: > + ansible.builtin.shell: > grep "^services = " "{{ ipabackup_dir }}/{{ ipabackup_item }}/header" | cut -d"=" -f2 | tr -d '[:space:]' register: result_services_grep - name: Set ipabackup_services - set_fact: + ansible.builtin.set_fact: ipabackup_services: "{{ result_services_grep.stdout.split(',') }}" ipabackup_service_dns: DNS ipabackup_service_adtrust: ADTRUST @@ -54,24 +54,24 @@ - block: - name: Ensure that IPA server packages are installed - package: + ansible.builtin.package: name: "{{ ipaserver_packages }}" state: present - name: Ensure that IPA server packages for dns are installed - package: + ansible.builtin.package: name: "{{ ipaserver_packages_dns }}" state: present when: ipabackup_service_dns in ipabackup_services - name: Ensure that IPA server packages for adtrust are installed - package: + ansible.builtin.package: name: "{{ ipaserver_packages_adtrust }}" state: present when: ipabackup_service_adtrust in ipabackup_services - name: Ensure that firewalld packages are installed - package: + ansible.builtin.package: name: "{{ ipaserver_packages_firewalld }}" state: present when: ipabackup_setup_firewalld | bool @@ -82,20 +82,20 @@ - block: - name: Ensure that firewalld is running - systemd: + ansible.builtin.systemd: name: firewalld enabled: yes state: started - name: Firewalld - Verify runtime zone "{{ ipabackup_firewalld_zone }}" - shell: > + ansible.builtin.shell: > firewall-cmd --info-zone="{{ ipabackup_firewalld_zone }}" >/dev/null when: ipabackup_firewalld_zone is defined - name: Firewalld - Verify permanent zone "{{ ipabackup_firewalld_zone }}" - shell: > + ansible.builtin.shell: > firewall-cmd --permanent --info-zone="{{ ipabackup_firewalld_zone }}" @@ -108,7 +108,7 @@ - name: Restore backup no_log: True - shell: > + ansible.builtin.shell: > ipa-restore {{ ipabackup_item }} --unattended @@ -123,7 +123,7 @@ ignore_errors: yes - name: Report error for restore operation - debug: + ansible.builtin.debug: msg: "{{ result_iparestore.stderr }}" when: result_iparestore is failed failed_when: yes @@ -131,7 +131,7 @@ ### CONFIGURE FIREWALLD - name: Configure firewalld - command: > + ansible.builtin.command: > firewall-cmd --permanent {{ "--zone="+ipabackup_firewalld_zone if ipabackup_firewalld_zone is defined else "" }} @@ -143,7 +143,7 @@ when: ipabackup_setup_firewalld | bool - name: Configure firewalld runtime - command: > + ansible.builtin.command: > firewall-cmd {{ "--zone="+ipabackup_firewalld_zone if ipabackup_firewalld_zone is defined else "" }} --add-service=freeipa-ldap diff --git a/roles/ipaclient/tasks/install.yml b/roles/ipaclient/tasks/install.yml index 3efc8b609a2c5cee78c8336cf1674e1526be2c4e..fa64afb6d98dcd79434c9b8d0049e000bfb71702 100644 --- a/roles/ipaclient/tasks/install.yml +++ b/roles/ipaclient/tasks/install.yml @@ -2,28 +2,28 @@ # tasks file for ipaclient - name: Install - Ensure that IPA client packages are installed - package: + ansible.builtin.package: name: "{{ ipaclient_packages }}" state: present when: ipaclient_install_packages | bool - name: Install - Set ipaclient_servers - set_fact: + ansible.builtin.set_fact: ipaclient_servers: "{{ groups['ipaservers'] | list }}" when: groups.ipaservers is defined and ipaclient_servers is not defined - name: Install - Set ipaclient_servers from cluster inventory - set_fact: + ansible.builtin.set_fact: ipaclient_servers: "{{ groups['ipaserver'] | list }}" when: ipaclient_no_dns_lookup | bool and groups.ipaserver is defined and ipaclient_servers is not defined - name: Install - Check that either password or keytab is set - fail: msg="ipaadmin_password and ipaadmin_keytab cannot be used together" + ansible.builtin.fail: msg="ipaadmin_password and ipaadmin_keytab cannot be used together" when: ipaadmin_keytab is defined and ipaadmin_password is defined - name: Install - Set default principal if no keytab is given - set_fact: + ansible.builtin.set_fact: ipaadmin_principal: admin when: ipaadmin_principal is undefined and ipaclient_keytab is undefined @@ -31,11 +31,11 @@ block: - name: Install - Fail on missing ipaclient_domain and ipaserver_domain - fail: msg="ipaclient_domain or ipaserver_domain is required for ipaclient_configure_dns_resolver" + ansible.builtin.fail: msg="ipaclient_domain or ipaserver_domain is required for ipaclient_configure_dns_resolver" when: ipaserver_domain is not defined and ipaclient_domain is not defined - name: Install - Fail on missing ipaclient_servers - fail: msg="ipaclient_dns_servers is required for ipaclient_configure_dns_resolver" + ansible.builtin.fail: msg="ipaclient_dns_servers is required for ipaclient_configure_dns_resolver" when: ipaclient_dns_servers is not defined - name: Install - Configure DNS resolver @@ -74,7 +74,7 @@ - block: - name: Install - Cleanup leftover ccache - file: + ansible.builtin.file: path: "/etc/ipa/.dns_ccache" state: absent @@ -91,12 +91,12 @@ domain: "{{ result_ipaclient_test.domain }}" - name: Install - Make sure One-Time Password is enabled if it's already defined - set_fact: + ansible.builtin.set_fact: ipaclient_use_otp: "yes" when: ipaclient_otp is defined - name: Install - Disable One-Time Password for on_master - set_fact: + ansible.builtin.set_fact: ipaclient_use_otp: "no" when: ipaclient_use_otp | bool and ipaclient_on_master | bool @@ -112,7 +112,7 @@ - name: Install - Disable One-Time Password for client with working krb5.keytab - set_fact: + ansible.builtin.set_fact: ipaclient_use_otp: "no" when: ipaclient_use_otp | bool and result_ipaclient_test_keytab.krb5_keytab_ok and @@ -159,14 +159,14 @@ delegate_to: "{{ result_ipaclient_test.servers[0] }}" - name: Install - Report error for OTP generation - debug: + ansible.builtin.debug: msg: "{{ result_ipaclient_get_otp.msg }}" when: result_ipaclient_get_otp is failed failed_when: yes - name: Install - Store the previously obtained OTP no_log: yes - set_fact: + ansible.builtin.set_fact: ipaadmin_orig_password: "{{ ipaadmin_password | default(omit) }}" ipaadmin_password: "{{ result_ipaclient_get_otp.host.randompassword if result_ipaclient_get_otp.host is defined }}" @@ -183,7 +183,7 @@ - name: Store predefined OTP in admin_password no_log: yes - set_fact: + ansible.builtin.set_fact: ipaadmin_orig_password: "{{ ipaadmin_password | default(omit) }}" ipaadmin_password: "{{ ipaclient_otp }}" when: ipaclient_otp is defined @@ -198,11 +198,11 @@ # result_ipaclient_join.already_joined))) - name: Install - Check if principal and keytab are set - fail: msg="Admin principal and client keytab cannot be used together" + ansible.builtin.fail: msg="Admin principal and client keytab cannot be used together" when: ipaadmin_principal is defined and ipaclient_keytab is defined - name: Install - Check if one of password or keytabs are set - fail: msg="At least one of password or keytabs must be specified" + ansible.builtin.fail: msg="At least one of password or keytabs must be specified" when: not result_ipaclient_test_keytab.krb5_keytab_ok and ipaadmin_password is undefined and ipaadmin_keytab is undefined @@ -210,7 +210,7 @@ when: not ipaclient_on_master | bool - name: Install - Purge {{ result_ipaclient_test.realm }} from host keytab - command: > + ansible.builtin.command: > /usr/sbin/ipa-rmkeytab -k /etc/krb5.keytab -r "{{ result_ipaclient_test.realm }}" @@ -254,17 +254,17 @@ - block: - name: krb5 configuration not correct - fail: + ansible.builtin.fail: msg: > The krb5 configuration is not correct, please enable allow_repair to fix this. when: not result_ipaclient_test_keytab.krb5_conf_ok - name: IPA test failed - fail: + ansible.builtin.fail: msg: "The IPA test failed, please enable allow_repair to fix this." when: not result_ipaclient_test_keytab.ping_test_ok - name: ca.crt file is missing - fail: + ansible.builtin.fail: msg: > The ca.crt file is missing, please enable allow_repair to fix this. when: not result_ipaclient_test_keytab.ca_crt_exists @@ -411,11 +411,11 @@ always: - name: Install - Restore original admin password if overwritten by OTP no_log: yes - set_fact: + ansible.builtin.set_fact: ipaadmin_password: "{{ ipaadmin_orig_password }}" when: ipaclient_use_otp | bool and ipaadmin_orig_password is defined - name: Cleanup leftover ccache - file: + ansible.builtin.file: path: "/etc/ipa/.dns_ccache" state: absent diff --git a/roles/ipaclient/tasks/main.yml b/roles/ipaclient/tasks/main.yml index 9824eaf4f0bc6aafbebe97ab3a07143913e1b1df..7bd774c7df0d4bfd84f043a0587fee045e40a528 100644 --- a/roles/ipaclient/tasks/main.yml +++ b/roles/ipaclient/tasks/main.yml @@ -2,7 +2,7 @@ # tasks file for ipaclient - name: Import variables specific to distribution - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml" - "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" @@ -17,9 +17,9 @@ - "{{ role_path }}/vars/default.yml" - name: Install IPA client - include_tasks: install.yml + ansible.builtin.include_tasks: install.yml when: state|default('present') == 'present' - name: Uninstall IPA client - include_tasks: uninstall.yml + ansible.builtin.include_tasks: uninstall.yml when: state|default('present') == 'absent' diff --git a/roles/ipaclient/tasks/uninstall.yml b/roles/ipaclient/tasks/uninstall.yml index 7165f2ea4a343ce3d01ace3193b789738f00bab2..2b2996a99b5e914edba1e8be31df2fada06ba942 100644 --- a/roles/ipaclient/tasks/uninstall.yml +++ b/roles/ipaclient/tasks/uninstall.yml @@ -2,7 +2,7 @@ # tasks to uninstall IPA client - name: Uninstall - Uninstall IPA client - command: > + ansible.builtin.command: > /usr/sbin/ipa-client-install --uninstall -U @@ -17,6 +17,6 @@ when: ipaclient_cleanup_dns_resolver | bool #- name: Remove IPA client package -# package: +# ansible.builtin.package: # name: "{{ ipaclient_packages }}" # state: absent diff --git a/roles/ipareplica/tasks/install.yml b/roles/ipareplica/tasks/install.yml index 2bbe607c35d24384ec85ce99594e8e62c9f0ae53..1731a0f8982dcc4494014a085acf2bb054848990 100644 --- a/roles/ipareplica/tasks/install.yml +++ b/roles/ipareplica/tasks/install.yml @@ -4,24 +4,24 @@ - block: - name: Install - Ensure IPA replica packages are installed - package: + ansible.builtin.package: name: "{{ ipareplica_packages }}" state: present - name: Install - Ensure IPA replica packages for dns are installed - package: + ansible.builtin.package: name: "{{ ipareplica_packages_dns }}" state: present when: ipareplica_setup_dns | bool - name: Install - Ensure IPA replica packages for adtrust are installed - package: + ansible.builtin.package: name: "{{ ipareplica_packages_adtrust }}" state: present when: ipareplica_setup_adtrust | bool - name: Install - Ensure that firewall packages installed - package: + ansible.builtin.package: name: "{{ ipareplica_packages_firewalld }}" state: present when: ipareplica_setup_firewalld | bool @@ -30,20 +30,20 @@ - block: - name: Firewalld service - Ensure that firewalld is running - systemd: + ansible.builtin.systemd: name: firewalld enabled: yes state: started - name: Firewalld - Verify runtime zone "{{ ipareplica_firewalld_zone }}" - shell: > + ansible.builtin.shell: > firewall-cmd --info-zone="{{ ipareplica_firewalld_zone }}" >/dev/null when: ipareplica_firewalld_zone is defined - name: Firewalld - Verify permanent zone "{{ ipareplica_firewalld_zone }}" - shell: > + ansible.builtin.shell: > firewall-cmd --permanent --info-zone="{{ ipareplica_firewalld_zone }}" @@ -53,12 +53,12 @@ when: ipareplica_setup_firewalld | bool - name: Install - Set ipareplica_servers - set_fact: + ansible.builtin.set_fact: ipareplica_servers: "{{ groups['ipaservers'] | list }}" when: groups.ipaservers is defined and ipareplica_servers is not defined - name: Install - Set default principal if no keytab is given - set_fact: + ansible.builtin.set_fact: ipaadmin_principal: admin when: ipaadmin_principal is undefined and ipaclient_keytab is undefined @@ -108,7 +108,7 @@ # result_ipareplica_test.server_already_configured is defined) - name: Install - Setup client - include_role: + ansible.builtin.include_role: name: ipaclient vars: state: present @@ -120,7 +120,7 @@ when: not result_ipareplica_test.client_enrolled - name: Install - Configure firewalld - command: > + ansible.builtin.command: > firewall-cmd --permanent --zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is @@ -134,7 +134,7 @@ when: ipareplica_setup_firewalld | bool - name: Install - Configure firewalld runtime - command: > + ansible.builtin.command: > firewall-cmd --zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is defined else '' }}" @@ -222,7 +222,7 @@ - name: Install - Set dirman password no_log: yes - set_fact: + ansible.builtin.set_fact: ipareplica_dirman_password: "{{ result_ipareplica_master_password.password }}" @@ -776,14 +776,14 @@ register: result_ipareplica_enable_ipa - name: Install - Cleanup root IPA cache - file: + ansible.builtin.file: path: "/root/.ipa_cache" state: absent when: result_ipareplica_enable_ipa.changed always: - name: Cleanup temporary files - file: + ansible.builtin.file: path: "{{ item }}" state: absent with_items: diff --git a/roles/ipareplica/tasks/main.yml b/roles/ipareplica/tasks/main.yml index 967030c97b9da17bf259c0b6069bfe00c9d8bd5f..943b52c5410d2319eb47b754bb2da75cba9d3108 100644 --- a/roles/ipareplica/tasks/main.yml +++ b/roles/ipareplica/tasks/main.yml @@ -2,7 +2,7 @@ # tasks file for ipareplica - name: Import variables specific to distribution - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml" - "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" @@ -17,9 +17,9 @@ - "vars/default.yml" - name: Install IPA replica - include_tasks: install.yml + ansible.builtin.include_tasks: install.yml when: state|default('present') == 'present' - name: Uninstall IPA replica - include_tasks: uninstall.yml + ansible.builtin.include_tasks: uninstall.yml when: state|default('present') == 'absent' diff --git a/roles/ipareplica/tasks/uninstall.yml b/roles/ipareplica/tasks/uninstall.yml index a9240d776ca7b9777d6b18d0adb7622061a25f47..a5998ece0a7a119b00a821e248a28b1068eae7d0 100644 --- a/roles/ipareplica/tasks/uninstall.yml +++ b/roles/ipareplica/tasks/uninstall.yml @@ -2,7 +2,7 @@ # tasks to uninstall IPA replica - name: Uninstall - Uninstall IPA replica - command: > + ansible.builtin.command: > /usr/sbin/ipa-server-install --uninstall -U @@ -22,7 +22,7 @@ delay: 1 #- name: Uninstall - Remove all replication agreements and data about replica -# command: > +# ansible.builtin.command: > # /usr/sbin/ipa-replica-manage # del # {{ ipareplica_hostname | default(ansible_facts['fqdn']) }} @@ -32,6 +32,6 @@ # delegate_to: "{{ groups.ipaserver[0] | default(fail) }}" #- name: Remove IPA replica packages -# package: +# ansible.builtin.package: # name: "{{ ipareplica_packages }}" # state: absent diff --git a/roles/ipaserver/tasks/copy_external_cert.yml b/roles/ipaserver/tasks/copy_external_cert.yml index e91b9c7f8ba9dd48b42114bf73f6657098a2bdc0..8d30aca4219a91d6972cd16f75b44a992ae1f890 100644 --- a/roles/ipaserver/tasks/copy_external_cert.yml +++ b/roles/ipaserver/tasks/copy_external_cert.yml @@ -1,14 +1,14 @@ --- - name: Install - Initialize ipaserver_external_cert_files - set_fact: + ansible.builtin.set_fact: ipaserver_external_cert_files: [] when: ipaserver_external_cert_files is undefined - name: Install - Copy "{{ item }}" "{{ inventory_hostname }}':/root/'{{ item | basename }}" - copy: + ansible.builtin.copy: src: "{{ item }}" dest: "/root/{{ item | basename }}" mode: preserve force: yes - name: Install - Extend ipaserver_external_cert_files with "/root/{{ item | basename }}" - set_fact: + ansible.builtin.set_fact: ipaserver_external_cert_files: "{{ ipaserver_external_cert_files + [ '/root/' + (item | basename) ] }}" diff --git a/roles/ipaserver/tasks/install.yml b/roles/ipaserver/tasks/install.yml index ad135d1aa8814cf16c81323af01e901cdba6897b..70238d9ccf7bb86077b23e28d70e2d49523c5aa2 100644 --- a/roles/ipaserver/tasks/install.yml +++ b/roles/ipaserver/tasks/install.yml @@ -3,24 +3,24 @@ - block: - name: Install - Ensure that IPA server packages are installed - package: + ansible.builtin.package: name: "{{ ipaserver_packages }}" state: present - name: Install - Ensure that IPA server packages for dns are installed - package: + ansible.builtin.package: name: "{{ ipaserver_packages_dns }}" state: present when: ipaserver_setup_dns | bool - name: Install - Ensure that IPA server packages for adtrust are installed - package: + ansible.builtin.package: name: "{{ ipaserver_packages_adtrust }}" state: present when: ipaserver_setup_adtrust | bool - name: Install - Ensure that firewall packages installed - package: + ansible.builtin.package: name: "{{ ipaserver_packages_firewalld }}" state: present when: ipaserver_setup_firewalld | bool @@ -29,20 +29,20 @@ - block: - name: Firewalld service - Ensure that firewalld is running - systemd: + ansible.builtin.systemd: name: firewalld enabled: yes state: started - name: Firewalld - Verify runtime zone "{{ ipaserver_firewalld_zone }}" - shell: > + ansible.builtin.shell: > firewall-cmd --info-zone="{{ ipaserver_firewalld_zone }}" >/dev/null when: ipaserver_firewalld_zone is defined - name: Firewalld - Verify permanent zone "{{ ipaserver_firewalld_zone }}" - shell: > + ansible.builtin.shell: > firewall-cmd --permanent --info-zone="{{ ipaserver_firewalld_zone }}" @@ -51,7 +51,7 @@ when: ipaserver_setup_firewalld | bool -- include_tasks: "{{ role_path }}/tasks/copy_external_cert.yml" +- ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_external_cert.yml" with_items: "{{ ipaserver_external_cert_files_from_controller }}" when: ipaserver_external_cert_files_from_controller is defined and ipaserver_external_cert_files_from_controller|length > 0 and @@ -144,7 +144,7 @@ - name: Install - Use new master password no_log: yes - set_fact: + ansible.builtin.set_fact: ipaserver_master_password: "{{ result_ipaserver_master_password.password }}" @@ -308,7 +308,7 @@ register: result_ipaserver_setup_ca - name: Copy /root/ipa.csr to "{{ inventory_hostname }}-ipa.csr" - fetch: + ansible.builtin.fetch: src: /root/ipa.csr dest: "{{ inventory_hostname }}-ipa.csr" flat: yes @@ -416,7 +416,7 @@ _dirsrv_pkcs12_info: "{{ result_ipaserver_test._dirsrv_pkcs12_info if result_ipaserver_test._dirsrv_pkcs12_info != None else omit }}" - name: Install - Setup client - include_role: + ansible.builtin.include_role: name: ipaclient vars: state: present @@ -438,13 +438,13 @@ register: result_ipaserver_enable_ipa - name: Install - Cleanup root IPA cache - file: + ansible.builtin.file: path: "/root/.ipa_cache" state: absent when: result_ipaserver_enable_ipa.changed - name: Install - Configure firewalld - command: > + ansible.builtin.command: > firewall-cmd --permanent --zone="{{ ipaserver_firewalld_zone if ipaserver_firewalld_zone is @@ -458,7 +458,7 @@ when: ipaserver_setup_firewalld | bool - name: Install - Configure firewalld runtime - command: > + ansible.builtin.command: > firewall-cmd --zone="{{ ipaserver_firewalld_zone if ipaserver_firewalld_zone is defined else '' }}" @@ -474,7 +474,7 @@ always: - name: Cleanup temporary files - file: + ansible.builtin.file: path: "{{ item }}" state: absent with_items: diff --git a/roles/ipaserver/tasks/main.yml b/roles/ipaserver/tasks/main.yml index 23f8aec4fd2e52e8c5c0126a39b5b648e64e604a..8e8d9b8e0a9ad733386d44b112c946eb5fe68abc 100644 --- a/roles/ipaserver/tasks/main.yml +++ b/roles/ipaserver/tasks/main.yml @@ -2,7 +2,7 @@ # tasks file for ipaserver - name: Import variables specific to distribution - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml" - "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" @@ -17,9 +17,9 @@ - "vars/default.yml" - name: Install IPA server - include_tasks: install.yml + ansible.builtin.include_tasks: install.yml when: state|default('present') == 'present' - name: Uninstall IPA server - include_tasks: uninstall.yml + ansible.builtin.include_tasks: uninstall.yml when: state|default('present') == 'absent' diff --git a/roles/ipaserver/tasks/uninstall.yml b/roles/ipaserver/tasks/uninstall.yml index 27d8356aea11e031f53d166c3c288c94192cf344..7b69f229946e2f7de4641b49b38719aebe75cf60 100644 --- a/roles/ipaserver/tasks/uninstall.yml +++ b/roles/ipaserver/tasks/uninstall.yml @@ -2,7 +2,7 @@ # tasks to uninstall IPA server - name: Uninstall - Uninstall IPA server - command: > + ansible.builtin.command: > /usr/sbin/ipa-server-install --uninstall -U @@ -15,6 +15,6 @@ changed_when: uninstall.rc == 0 #- name: Remove IPA server packages -# package: +# ansible.builtin.package: # name: "{{ ipaserver_packages }}" # state: absent diff --git a/tests/automember/test_automember_client_context.yml b/tests/automember/test_automember_client_context.yml index 5e03302c7ddb444eea310ed0f769f66fb258ff0a..b796a065b90f8057160d8fc4b0263e949c7d8225 100644 --- a/tests/automember/test_automember_client_context.yml +++ b/tests/automember/test_automember_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. @@ -28,13 +28,13 @@ # in upstream CI. - name: Test automember using client context, in client host. - import_playbook: test_automember.yml + ansible.builtin.import_playbook: test_automember.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test automember using client context, in server host. - import_playbook: test_automember.yml + ansible.builtin.import_playbook: test_automember.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/automember/test_automember_orphans_removed.yml b/tests/automember/test_automember_orphans_removed.yml index 0b9bcd3a32dd375364268ee22c9b2dc5dc790406..697f78d418e99a983aef00faa08e1f6f3185ecc2 100644 --- a/tests/automember/test_automember_orphans_removed.yml +++ b/tests/automember/test_automember_orphans_removed.yml @@ -8,7 +8,7 @@ # SET FACTS - 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/automember/test_automember_rebuilt.yml b/tests/automember/test_automember_rebuilt.yml index 4458e202766f736bc500401eacb8c3eaebfbee4d..34b981b78af2948ca3a354a5b7624d619f757afc 100644 --- a/tests/automember/test_automember_rebuilt.yml +++ b/tests/automember/test_automember_rebuilt.yml @@ -8,7 +8,7 @@ # SET FACTS - 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/automount/test_automountkey_client_context.yml b/tests/automount/test_automountkey_client_context.yml index e6d611b249d7731d688b9426fbc43858b761e4fb..2c4ff096408e130610a2fb9873970e8620fbefdf 100644 --- a/tests/automount/test_automountkey_client_context.yml +++ b/tests/automount/test_automountkey_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. @@ -29,13 +29,13 @@ # in upstream CI. - name: Test automountlocation using client context, in client host. - import_playbook: test_automountkey.yml + ansible.builtin.import_playbook: test_automountkey.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test automountlocation using client context, in server host. - import_playbook: test_automountkey.yml + ansible.builtin.import_playbook: test_automountkey.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/automount/test_automountlocation_client_context.yml b/tests/automount/test_automountlocation_client_context.yml index 15c2fecd64d2e2c92d5af0352daf9cb908855dd3..1190a187c75c877efae0e4693e21cff656fc42b8 100644 --- a/tests/automount/test_automountlocation_client_context.yml +++ b/tests/automount/test_automountlocation_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 automountlocation using client context, in client host. - import_playbook: test_automountlocation.yml + ansible.builtin.import_playbook: test_automountlocation.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test automountlocation using client context, in server host. - import_playbook: test_automountlocation.yml + ansible.builtin.import_playbook: test_automountlocation.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/automount/test_automountmap_client_context.yml b/tests/automount/test_automountmap_client_context.yml index cec2271dc34e5e0e82167f5b592a8a2001325770..3e1fbfb80ab578d137133c2fb088908c88d01597 100644 --- a/tests/automount/test_automountmap_client_context.yml +++ b/tests/automount/test_automountmap_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. @@ -28,13 +28,13 @@ # in upstream CI. - name: Test automountmap using client context, in client host. - import_playbook: test_automountmap.yml + ansible.builtin.import_playbook: test_automountmap.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test automountmap using client context, in server host. - import_playbook: test_automountmap.yml + ansible.builtin.import_playbook: test_automountmap.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/ca-less/clean_up_certificates.yml b/tests/ca-less/clean_up_certificates.yml index 23c025b381bfa97e74285a0ac0a6050c9793d871..2f499dc5f479c6dd3d1542fe57af46f99d6d3bde 100644 --- a/tests/ca-less/clean_up_certificates.yml +++ b/tests/ca-less/clean_up_certificates.yml @@ -5,7 +5,7 @@ tasks: - name: Run generate-certificates.sh - command: > + ansible.builtin.command: > /bin/bash generate-certificates.sh delete "{{ item }}" args: diff --git a/tests/ca-less/install_replica_without_ca.yml b/tests/ca-less/install_replica_without_ca.yml index dc026220d66cf2a04e3f03551121209c40918063..676083129a5643ff1f69b3555ecacd26a6bd8ad7 100644 --- a/tests/ca-less/install_replica_without_ca.yml +++ b/tests/ca-less/install_replica_without_ca.yml @@ -5,7 +5,7 @@ tasks: - name: Run generate-certificates.sh - command: > + ansible.builtin.command: > /bin/bash generate-certificates.sh create "{{ groups.ipareplicas[0] }}" @@ -40,18 +40,18 @@ pre_tasks: - name: Remove "/root/ca-less-test" - file: + ansible.builtin.file: path: "/root/ca-less-test" state: absent - name: Generate "/root/ca-less-test" - file: + ansible.builtin.file: path: "/root/ca-less-test" state: directory mode: 0775 - name: Copy CA certificate - copy: + ansible.builtin.copy: src: "{{ playbook_dir }}/certificates/root-ca/cert.pem" dest: "/root/ca-less-test/ca.crt" owner: root @@ -59,7 +59,7 @@ mode: "0644" - name: Copy p12 certificates - copy: + ansible.builtin.copy: src: "{{ playbook_dir }}/certificates/{{ item }}/{{ groups.ipareplicas[0] }}/cert.p12" dest: "/root/ca-less-test/{{ item }}.p12" owner: root @@ -76,7 +76,7 @@ post_tasks: - name: Fix KDC certificate permissions - file: + ansible.builtin.file: path: /var/kerberos/krb5kdc/kdc.crt owner: root group: root diff --git a/tests/ca-less/install_server_without_ca.yml b/tests/ca-less/install_server_without_ca.yml index add0f622ecf3f37aca092c115a39ac2f66085ccf..a29cb0c231d078c08f156eb0c17f64c6b3308e69 100644 --- a/tests/ca-less/install_server_without_ca.yml +++ b/tests/ca-less/install_server_without_ca.yml @@ -5,7 +5,7 @@ tasks: - name: Run generate-certificates.sh - command: > + ansible.builtin.command: > /bin/bash generate-certificates.sh create "{{ groups.ipaserver[0] }}" @@ -40,18 +40,18 @@ pre_tasks: - name: Remove "/root/ca-less-test" - file: + ansible.builtin.file: path: "/root/ca-less-test" state: absent - name: Generate "/root/ca-less-test" - file: + ansible.builtin.file: path: "/root/ca-less-test" state: directory mode: 0775 - name: Copy CA certificate - copy: + ansible.builtin.copy: src: "{{ playbook_dir }}/certificates/root-ca/cert.pem" dest: "/root/ca-less-test/ca.crt" owner: root @@ -59,7 +59,7 @@ mode: "0644" - name: Copy p12 certificates - copy: + ansible.builtin.copy: src: "{{ playbook_dir }}/certificates/{{ item }}/{{ groups.ipaserver[0] }}/cert.p12" dest: "/root/ca-less-test/{{ item }}.p12" owner: root diff --git a/tests/config/test_config.yml b/tests/config/test_config.yml index cac579d451cf030378c3205f0944e670174294c2..a4a841030c5258ce55fab09d0650f1ecfea1a9f4 100644 --- a/tests/config/test_config.yml +++ b/tests/config/test_config.yml @@ -5,7 +5,7 @@ gather_facts: false tasks: - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml - block: # Retrieve current configuration. @@ -16,7 +16,7 @@ register: previousconfig - name: Display current configuration. - debug: + ansible.builtin.debug: var: previousconfig # setup environment. @@ -481,7 +481,7 @@ register: result - name: "CA-Renewal server warning." - debug: + ansible.builtin.debug: msg: "Due to a test failure, IPA CA-Renewal Server might not be correctly be set. Check your configuration." always: diff --git a/tests/config/test_config_client_context.yml b/tests/config/test_config_client_context.yml index 515f313b1b1c31bde9cb0436121d4026236a5184..6ac552fb1e2fbdc03545391f0447fa909c207209 100644 --- a/tests/config/test_config_client_context.yml +++ b/tests/config/test_config_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. @@ -26,13 +26,13 @@ # in upstream CI. - name: Test config using client context, in client host. - import_playbook: test_config.yml + ansible.builtin.import_playbook: test_config.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test config using client context, in server host. - import_playbook: test_config.yml + ansible.builtin.import_playbook: test_config.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/config/test_config_sid.yml b/tests/config/test_config_sid.yml index d8d78f12536619590440d1c4b16ae2eb909265a5..5f8a1ef05c36a7fd82e4e3282e69c212f8df3500 100644 --- a/tests/config/test_config_sid.yml +++ b/tests/config/test_config_sid.yml @@ -7,7 +7,7 @@ tasks: - name: Set FreeIPA facts. - include_tasks: ../env_freeipa_facts.yml + ansible.builtin.include_tasks: ../env_freeipa_facts.yml # GET CURRENT CONFIG diff --git a/tests/delegation/test_delegation_client_context.yml b/tests/delegation/test_delegation_client_context.yml index cfefaed13fa1fa789f783c538eee5c9318a46cf0..c5446963c583be3d6907d0d872152da7bc5b8ce0 100644 --- a/tests/delegation/test_delegation_client_context.yml +++ b/tests/delegation/test_delegation_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 delegation using client context, in client host. - import_playbook: test_delegation.yml + ansible.builtin.import_playbook: test_delegation.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test delegation using client context, in server host. - import_playbook: test_delegation.yml + ansible.builtin.import_playbook: test_delegation.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/dnsconfig/test_dnsconfig_client_context.yml b/tests/dnsconfig/test_dnsconfig_client_context.yml index 5337747f46001ffa46e1931076a484ff83eb2733..bd5095e9d30fc06895cd9108fad8220ca95be7d1 100644 --- a/tests/dnsconfig/test_dnsconfig_client_context.yml +++ b/tests/dnsconfig/test_dnsconfig_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 dnsconfig using client context, in client host. - import_playbook: test_dnsconfig.yml + ansible.builtin.import_playbook: test_dnsconfig.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test dnsconfig using client context, in server host. - import_playbook: test_dnsconfig.yml + ansible.builtin.import_playbook: test_dnsconfig.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/dnsforwardzone/test_dnsforwardzone_client_context.yml b/tests/dnsforwardzone/test_dnsforwardzone_client_context.yml index 1e31194d6517d7f24a86213caa2134f609e8afcc..3d0e12920eec61e99049bc716f65f1f93db12cb8 100644 --- a/tests/dnsforwardzone/test_dnsforwardzone_client_context.yml +++ b/tests/dnsforwardzone/test_dnsforwardzone_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 dnsforwardzone using client context, in client host. - import_playbook: test_dnsforwardzone.yml + ansible.builtin.import_playbook: test_dnsforwardzone.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test dnsforwardzone using client context, in server host. - import_playbook: test_dnsforwardzone.yml + ansible.builtin.import_playbook: test_dnsforwardzone.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/dnsrecord/env_setup.yml b/tests/dnsrecord/env_setup.yml index 7c0c0810aff01125626fe3317c53928249497e30..73e9f30597b7b360f7a32b66eacc1be4e89b0a2c 100644 --- a/tests/dnsrecord/env_setup.yml +++ b/tests/dnsrecord/env_setup.yml @@ -1,10 +1,10 @@ --- - name: Setup variables and facts. - include_tasks: env_vars.yml + ansible.builtin.include_tasks: env_vars.yml # Cleanup before setup. - name: Cleanup test environment. - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml # Common setup tasks. - name: Ensure DNS testing zones are present. diff --git a/tests/dnsrecord/env_vars.yml b/tests/dnsrecord/env_vars.yml index 0e979988e2283823db6f35efb48acd65f5ef9471..dfa7a8cddb7c351c4ad4b3f6b3be7dac9ff302bf 100644 --- a/tests/dnsrecord/env_vars.yml +++ b/tests/dnsrecord/env_vars.yml @@ -1,7 +1,7 @@ --- # Set common vars and facts for test. - name: Set IPv4 address prefix. - set_fact: + ansible.builtin.set_fact: ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | join('.') }}" ipv4_reverse: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | @@ -9,7 +9,7 @@ join('.') }}" - name: Set zone prefixes. - set_fact: + ansible.builtin.set_fact: testzone: 'testzone.test' safezone: 'safezone.test' zone_ipv6_reverse: "ip6.arpa." diff --git a/tests/dnsrecord/test_dnsrecord.yml b/tests/dnsrecord/test_dnsrecord.yml index d13807f6c4c8f1e54dfd86de6fc98c93991f37ca..b203d366001a48117de2860e24b6f37625c861dd 100644 --- a/tests/dnsrecord/test_dnsrecord.yml +++ b/tests/dnsrecord/test_dnsrecord.yml @@ -7,10 +7,10 @@ tasks: - name: Setup testing environment. - include_tasks: env_setup.yml + ansible.builtin.include_tasks: env_setup.yml - 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" @@ -1547,7 +1547,7 @@ # cleanup - name: Cleanup test environment. - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml - name: Remove certificate files. # noqa: deprecated-command-syntax ansible.builtin.shell: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64" diff --git a/tests/dnsrecord/test_dnsrecord_client_context.yml b/tests/dnsrecord/test_dnsrecord_client_context.yml index 44f59d5631a9ee591810b0fe10e784041450c116..651e17b5b61f9b38b830263e1bfdb797b6faec58 100644 --- a/tests/dnsrecord/test_dnsrecord_client_context.yml +++ b/tests/dnsrecord/test_dnsrecord_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 dnsrecord using client context, in client host. - import_playbook: test_dnsrecord.yml + ansible.builtin.import_playbook: test_dnsrecord.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test dnsrecord using client context, in server host. - import_playbook: test_dnsrecord.yml + ansible.builtin.import_playbook: test_dnsrecord.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/dnsrecord/test_dnsrecord_full_records.yml b/tests/dnsrecord/test_dnsrecord_full_records.yml index cd703d137ea11fab94bd857d094d07c3436b312d..af0bc8cb2e4669d550218f3ff34e81ba6d34a26a 100644 --- a/tests/dnsrecord/test_dnsrecord_full_records.yml +++ b/tests/dnsrecord/test_dnsrecord_full_records.yml @@ -7,7 +7,7 @@ tasks: - name: Setup test environment - include_tasks: env_setup.yml + ansible.builtin.include_tasks: env_setup.yml # tests @@ -147,4 +147,4 @@ # Cleanup - name: Cleanup test environment. - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml diff --git a/tests/dnsrecord/test_dnsrecord_modify_record.yml b/tests/dnsrecord/test_dnsrecord_modify_record.yml index 6ffd583b8552f3805b7860b3aeb0e70fb8383595..20d787419dfab80ac33c9fa04f5dc68dbb6f58ae 100644 --- a/tests/dnsrecord/test_dnsrecord_modify_record.yml +++ b/tests/dnsrecord/test_dnsrecord_modify_record.yml @@ -6,7 +6,7 @@ tasks: - name: Setup testing environment. - include_tasks: env_setup.yml + ansible.builtin.include_tasks: env_setup.yml - name: Add test host. ipahost: @@ -177,4 +177,4 @@ state: absent # cleanup - name: Cleanup test environment. - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml diff --git a/tests/dnszone/env_setup.yml b/tests/dnszone/env_setup.yml index ce4378111367260b8d52a7c6a60ccc01b638355a..1518c506bc0caa80410323072714cb2ea574063d 100644 --- a/tests/dnszone/env_setup.yml +++ b/tests/dnszone/env_setup.yml @@ -1,3 +1,3 @@ --- - name: Cleanup test environment. - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml diff --git a/tests/dnszone/env_teardown.yml b/tests/dnszone/env_teardown.yml index ce4378111367260b8d52a7c6a60ccc01b638355a..1518c506bc0caa80410323072714cb2ea574063d 100644 --- a/tests/dnszone/env_teardown.yml +++ b/tests/dnszone/env_teardown.yml @@ -1,3 +1,3 @@ --- - name: Cleanup test environment. - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml diff --git a/tests/dnszone/test_dnszone.yml b/tests/dnszone/test_dnszone.yml index b7e01d4c669cc8d4b3ca0abbab40a00f8541a4fb..ef0f2d236c23acd962a863335e076461bcf879ce 100644 --- a/tests/dnszone/test_dnszone.yml +++ b/tests/dnszone/test_dnszone.yml @@ -8,7 +8,7 @@ # Setup - name: Setup testing environment - include_tasks: env_setup.yml + ansible.builtin.include_tasks: env_setup.yml # Tests - name: Check if zone is present, when in shouldn't be. @@ -267,4 +267,4 @@ # Teardown - name: Teardown testing environment - include_tasks: env_teardown.yml + ansible.builtin.include_tasks: env_teardown.yml diff --git a/tests/dnszone/test_dnszone_client_context.yml b/tests/dnszone/test_dnszone_client_context.yml index 79a00ff11a4d311a575fd4079042d4f151a8a223..a2cf652b930fd4edf361d9740fb4126c4c8da94f 100644 --- a/tests/dnszone/test_dnszone_client_context.yml +++ b/tests/dnszone/test_dnszone_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 dnszone using client context, in client host. - import_playbook: test_dnszone.yml + ansible.builtin.import_playbook: test_dnszone.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test dnszone using client context, in server host. - import_playbook: test_dnszone.yml + ansible.builtin.import_playbook: test_dnszone.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/dnszone/test_dnszone_mod.yml b/tests/dnszone/test_dnszone_mod.yml index 5bb33d683dea6e0c6e5cab5f040eca8f28007d49..5dbbe9e38b93d45c76b2e301aa6de3c17d13236f 100644 --- a/tests/dnszone/test_dnszone_mod.yml +++ b/tests/dnszone/test_dnszone_mod.yml @@ -8,7 +8,7 @@ # Setup - name: Setup testing environment - include_tasks: env_setup.yml + ansible.builtin.include_tasks: env_setup.yml - name: Ensure zone is present. ipadnszone: @@ -291,4 +291,4 @@ # Teardown - name: Teardown testing environment - include_tasks: env_teardown.yml + ansible.builtin.include_tasks: env_teardown.yml diff --git a/tests/dnszone/test_dnszone_name_from_ip.yml b/tests/dnszone/test_dnszone_name_from_ip.yml index 62295742106f69d4fffb83437d044f770f7c7920..53afe23bbbbc283994752d075639e61719dfca4c 100644 --- a/tests/dnszone/test_dnszone_name_from_ip.yml +++ b/tests/dnszone/test_dnszone_name_from_ip.yml @@ -8,7 +8,7 @@ # Setup - name: Setup testing environment - include_tasks: env_setup.yml + ansible.builtin.include_tasks: env_setup.yml # Tests - name: Ensure zone exists for reverse IP. @@ -55,7 +55,7 @@ register: ipv6_zone failed_when: not ipv6_zone.changed or ipv6_zone.failed - # - debug: + # - ansible.builtin.debug: # msg: "{{ipv6_zone}}" - name: Ensure ipv6 zone was created. @@ -95,4 +95,4 @@ # Teardown - name: Teardown testing environment - include_tasks: env_teardown.yml + ansible.builtin.include_tasks: env_teardown.yml diff --git a/tests/env_freeipa_facts.yml b/tests/env_freeipa_facts.yml index b9bce90aafd1174e9b578aebf1436d29ba7f61eb..938efdbb0aa66ae638bfa7ad07b000720142f856 100644 --- a/tests/env_freeipa_facts.yml +++ b/tests/env_freeipa_facts.yml @@ -8,12 +8,12 @@ # --- - name: Retrieving FreeIPA version. - shell: + ansible.builtin.shell: cmd: 'ipa --version | sed -n "s/VERSION: \([^,]*\).*API_VERSION: \([^,]*\).*/\1\\n\2/p"' register: ipa_cmd_version - name: Verify if host is an IPA server or client. - shell: + ansible.builtin.shell: cmd: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin RESULT=$(KRB5CCNAME={{ krb5ccname }} ipa server-show `hostname` && echo SERVER || echo CLIENT) @@ -24,7 +24,7 @@ register: output - name: Set FreeIPA facts. - set_fact: + ansible.builtin.set_fact: ipa_version: "{{ ipa_cmd_version.stdout_lines[0] }}" ipa_api_version: "{{ ipa_cmd_version.stdout_lines[1] }}" ipa_host_is_client: "{{ (output.stdout_lines[-1] == 'CLIENT') | bool }}" @@ -32,12 +32,12 @@ - block: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: "'fqdn' in ansible_facts" - name: Set Domain to 'ipa.test' if FQDN could not be retrieved. - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "ipa.test" when: "'fqdn' not in ansible_facts" when: ipaserver_domain is not defined diff --git a/tests/external-signed-ca-with-automatic-copy/install-server-with-external-ca-with-automatic-copy.yml b/tests/external-signed-ca-with-automatic-copy/install-server-with-external-ca-with-automatic-copy.yml index 02e20d951d4d103cee61a69dbce3f87c16f77a4b..0e668a8a82abe4a07ad50790461c98a5fae0cbcd 100644 --- a/tests/external-signed-ca-with-automatic-copy/install-server-with-external-ca-with-automatic-copy.yml +++ b/tests/external-signed-ca-with-automatic-copy/install-server-with-external-ca-with-automatic-copy.yml @@ -15,7 +15,7 @@ tasks: - name: Run external-ca.sh - command: > + ansible.builtin.command: > /bin/bash external-ca.sh "{{ groups.ipaserver[0] }}" diff --git a/tests/external-signed-ca-with-manual-copy/install-server-with-external-ca-with-manual-copy.yml b/tests/external-signed-ca-with-manual-copy/install-server-with-external-ca-with-manual-copy.yml index 9ab763bd67aa2f7269b7231451d695f6a55dc754..564ea167350b17fa722a4cc959423e4d3d2532c9 100644 --- a/tests/external-signed-ca-with-manual-copy/install-server-with-external-ca-with-manual-copy.yml +++ b/tests/external-signed-ca-with-manual-copy/install-server-with-external-ca-with-manual-copy.yml @@ -11,7 +11,7 @@ post_tasks: - name: Copy CSR /root/ipa.csr from node to "{{ groups.ipaserver[0] + '-ipa.csr' }}" - fetch: + ansible.builtin.fetch: src: /root/ipa.csr dest: "{{ groups.ipaserver[0] + '-ipa.csr' }}" flat: yes @@ -21,7 +21,7 @@ tasks: - name: Run external-ca.sh - command: > + ansible.builtin.command: > /bin/bash external-ca.sh "{{ groups.ipaserver[0] }}" @@ -38,7 +38,7 @@ pre_tasks: - name: Copy "{{ groups.ipaserver[0] + '-chain.crt' }}" to /root/chain.crt on node - copy: + ansible.builtin.copy: src: "{{ groups.ipaserver[0] + '-chain.crt' }}" dest: "/root/chain.crt" force: yes diff --git a/tests/group/test_group.yml b/tests/group/test_group.yml index 8395d6b57269b215973de8ea41ce6b64b194d8da..d728e45f61e82f6e88eb457cc2c4eb1bdb3a34ec 100644 --- a/tests/group/test_group.yml +++ b/tests/group/test_group.yml @@ -6,12 +6,12 @@ tasks: # setup - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml # GET FQDN_AT_DOMAIN - name: Get fqdn_at_domain - set_fact: + ansible.builtin.set_fact: fqdn_at_domain: "{{ ansible_facts['fqdn'] + '@' + ipaserver_realm }}" # CLEANUP TEST ITEMS diff --git a/tests/group/test_group_client_context.yml b/tests/group/test_group_client_context.yml index 45e8467b2e76b0778276484fe50ebf9e745cd8bb..4a1d7ac92013f1c6e7f290d7c02621cfce23bc43 100644 --- a/tests/group/test_group_client_context.yml +++ b/tests/group/test_group_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 group using client context, in client host. - import_playbook: test_group.yml + ansible.builtin.import_playbook: test_group.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test group using client context, in server host. - import_playbook: test_group.yml + ansible.builtin.import_playbook: test_group.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/group/test_group_external_members.yml b/tests/group/test_group_external_members.yml index 5b2f320275bb6829e56586925d87cdb01b42260d..a24958d5ddb3677b2fde7e18f5834bb05dc01a9c 100644 --- a/tests/group/test_group_external_members.yml +++ b/tests/group/test_group_external_members.yml @@ -6,7 +6,7 @@ tasks: - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml - block: diff --git a/tests/group/test_group_idoverrideuser.yml b/tests/group/test_group_idoverrideuser.yml index 3a5be5069ce27a318b0425984aa2360b3adf87d5..2dc788451e7fce21c8eb5fcf562549b9d89451b6 100644 --- a/tests/group/test_group_idoverrideuser.yml +++ b/tests/group/test_group_idoverrideuser.yml @@ -9,11 +9,11 @@ ad_domain: "{{ test_ad_domain | default('ad.ipa.test') }}" tasks: - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml - block: - name: Create idoverrideuser. - shell: | + ansible.builtin.shell: | kinit -c idoverride_cache admin <<< SomeADMINpassword ipa idoverrideuser-add "Default Trust View" {{ ad_user }} kdestroy -A -q -c idoverride_cache @@ -95,7 +95,7 @@ always: - name: Remove idoverrideuser. - shell: | + ansible.builtin.shell: | kinit -c idoverride_cache admin <<< SomeADMINpassword ipa idoverrideuser-del "Default Trust View" {{ ad_user }} kdestroy -A -q -c idoverride_cache diff --git a/tests/group/test_group_membermanager.yml b/tests/group/test_group_membermanager.yml index 4105e75de22541c00b81af19f5954a72fbc47837..209301b8c601a4055361e684f11a8b119244a4f6 100644 --- a/tests/group/test_group_membermanager.yml +++ b/tests/group/test_group_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/hbacrule/test_hbacrule.yml b/tests/hbacrule/test_hbacrule.yml index 0c1616444fcb60316260741bbf91a4a25fabd555..7699360e9c30e9a84deccdbfa193a0fd2445d23d 100644 --- a/tests/hbacrule/test_hbacrule.yml +++ b/tests/hbacrule/test_hbacrule.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 diff --git a/tests/hbacrule/test_hbacrule_client_context.yml b/tests/hbacrule/test_hbacrule_client_context.yml index bafc93c55a615cc84d88497bcc73fe80b5287334..fa5056c8d90698be23a80ee08755bc099d113611 100644 --- a/tests/hbacrule/test_hbacrule_client_context.yml +++ b/tests/hbacrule/test_hbacrule_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 hbacrule using client context, in client host. - import_playbook: test_hbacrule.yml + ansible.builtin.import_playbook: test_hbacrule.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test hbacrule using client context, in server host. - import_playbook: test_hbacrule.yml + ansible.builtin.import_playbook: test_hbacrule.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/hbacrule/test_hbacrule_member_case_insensitive.yml b/tests/hbacrule/test_hbacrule_member_case_insensitive.yml index 5f4e010aea1f8677505a25a45dfc8ed97bc45fa5..da47f3937a6bacc026ae00c7c091722ca4b6c81a 100644 --- a/tests/hbacrule/test_hbacrule_member_case_insensitive.yml +++ b/tests/hbacrule/test_hbacrule_member_case_insensitive.yml @@ -25,7 +25,7 @@ - sVCgrOUp1 tasks: - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml - block: # setup diff --git a/tests/hbacrule/test_hbacrule_member_empty.yml b/tests/hbacrule/test_hbacrule_member_empty.yml index 92dcac930d0f8d313d05048a5b7f430e9bc4b66c..0238dc474bfe228981d3b4a0415ccbfe0e3d35eb 100644 --- a/tests/hbacrule/test_hbacrule_member_empty.yml +++ b/tests/hbacrule/test_hbacrule_member_empty.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 diff --git a/tests/hbacsvc/test_hbacsvc_client_context.yml b/tests/hbacsvc/test_hbacsvc_client_context.yml index 25b2f8f395c4ca7b7b7cdb456e4ef1e4afdf73c2..5c2e941784cfbfde836795ff2b30c42120a902c1 100644 --- a/tests/hbacsvc/test_hbacsvc_client_context.yml +++ b/tests/hbacsvc/test_hbacsvc_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 hbacsvc using client context, in client host. - import_playbook: test_hbacsvc.yml + ansible.builtin.import_playbook: test_hbacsvc.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test hbacsvc using client context, in server host. - import_playbook: test_hbacsvc.yml + ansible.builtin.import_playbook: test_hbacsvc.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/hbacsvcgroup/test_hbacsvcgroup_client_context.yml b/tests/hbacsvcgroup/test_hbacsvcgroup_client_context.yml index cc433ac2d18f502d6dfbe1f600ab07f0b4f1f5f0..6fd73d6db0609893233c04cfbbc9e46751e32bee 100644 --- a/tests/hbacsvcgroup/test_hbacsvcgroup_client_context.yml +++ b/tests/hbacsvcgroup/test_hbacsvcgroup_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 hbacsvcgroup using client context, in client host. - import_playbook: test_hbacsvcgroup.yml + ansible.builtin.import_playbook: test_hbacsvcgroup.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test hbacsvcgroup using client context, in server host. - import_playbook: test_hbacsvcgroup.yml + ansible.builtin.import_playbook: test_hbacsvcgroup.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client 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: diff --git a/tests/idrange/tasks_set_trust.yml b/tests/idrange/tasks_set_trust.yml index 4c414bbe3815877b45ab15abba65b99c11fdee28..bb81bf309eb24868077e0c0efd2df72615c14b9c 100644 --- a/tests/idrange/tasks_set_trust.yml +++ b/tests/idrange/tasks_set_trust.yml @@ -23,7 +23,7 @@ failed_when: result.failed - name: Retrieve Domain Security Identifier - shell: + ansible.builtin.shell: cmd: | kinit -c test_krb5_cache admin <<< SomeADMINpassword > /dev/null KRB5CCNAME=test_krb5_cache ipa trust-show {{ adserver.domain }} | sed -n "/Domain Security Identifier/s/ //gp" | cut -d":" -f2 @@ -32,5 +32,5 @@ no_log: yes - name: Set ipa_domain_sid. - set_fact: + ansible.builtin.set_fact: ipa_domain_sid: "{{ getsid.stdout }}" diff --git a/tests/idrange/test_idrange.yml b/tests/idrange/test_idrange.yml index 5c4da9404006f1d4d0b5e847c5b1a80001d750be..32a3231ff85b53c1dd3b4e598831c2d07e664d0d 100644 --- a/tests/idrange/test_idrange.yml +++ b/tests/idrange/test_idrange.yml @@ -14,7 +14,7 @@ tasks: # CLEANUP TEST ITEMS - name: Remove test trust. - include_tasks: tasks_remove_trust.yml + ansible.builtin.include_tasks: tasks_remove_trust.yml when: trust_test_is_supported | default(false) - name: Ensure testing idranges are absent @@ -121,7 +121,7 @@ - block: # Create trust with range_type: ipa-ad-trust - name: Create trust with range_type 'ipa-ad-trust' - include_tasks: tasks_set_trust.yml + ansible.builtin.include_tasks: tasks_set_trust.yml vars: trust_base_id: 10000000 trust_range_size: 200000 @@ -218,7 +218,7 @@ # Remove trust and idrange - name: Remove test trust. - include_tasks: tasks_remove_trust.yml + ansible.builtin.include_tasks: tasks_remove_trust.yml - name: Ensure AD-trust idrange is absent ipaidrange: @@ -229,7 +229,7 @@ # Create trust with range_type: ipa-ad-trust-posix - name: Create trust with range_type 'ipa-ad-trust' - include_tasks: tasks_set_trust.yml + ansible.builtin.include_tasks: tasks_set_trust.yml vars: trust_base_id: 10000000 trust_range_size: 200000 @@ -251,7 +251,7 @@ # Remove trust and idrange - name: Remove test trust. - include_tasks: tasks_remove_trust.yml + ansible.builtin.include_tasks: tasks_remove_trust.yml - name: Ensure AD-trust idrange is absent ipaidrange: @@ -262,7 +262,7 @@ # Remove trust and idrange - name: Remove test trust. - include_tasks: tasks_remove_trust.yml + ansible.builtin.include_tasks: tasks_remove_trust.yml - name: Ensure AD-trust idrange is absent ipaidrange: @@ -273,7 +273,7 @@ # Create trust with range_type: ipa-ad-trust-posix - name: Create trust with range_type 'ipa-ad-trust-posix' - include_tasks: tasks_set_trust.yml + ansible.builtin.include_tasks: tasks_set_trust.yml vars: trust_base_id: 10000000 trust_range_size: 2000000 @@ -319,7 +319,7 @@ # Remove trust and idrange - name: Remove test trust. - include_tasks: tasks_remove_trust.yml + ansible.builtin.include_tasks: tasks_remove_trust.yml - name: Ensure AD-trust idrange is absent ipaidrange: @@ -330,7 +330,7 @@ # Create trust with range_type: ipa-ad-trust-posix - name: Create trust with range_type 'ipa-ad-trust-posix' - include_tasks: tasks_set_trust.yml + ansible.builtin.include_tasks: tasks_set_trust.yml vars: trust_base_id: 10000000 trust_range_size: 2000000 @@ -352,7 +352,7 @@ always: # CLEANUP TEST ITEMS - name: Remove test trust. - include_tasks: tasks_remove_trust.yml + ansible.builtin.include_tasks: tasks_remove_trust.yml - name: Ensure testing idranges are absent ipaidrange: diff --git a/tests/idrange/test_idrange_client_context.yml b/tests/idrange/test_idrange_client_context.yml index e0f4447a5e0055b744a67d935c97541eaefc6f12..71f188d672516d229ecd4907e0c5f268c478908c 100644 --- a/tests/idrange/test_idrange_client_context.yml +++ b/tests/idrange/test_idrange_client_context.yml @@ -8,7 +8,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. @@ -29,11 +29,11 @@ # in upstream CI. - name: Test idrange using client context, in client host. - import_playbook: test_idrange.yml + ansible.builtin.import_playbook: test_idrange.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test idrange using client context, in server host. - import_playbook: test_idrange.yml + ansible.builtin.import_playbook: test_idrange.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] diff --git a/tests/location/test_location_client_context.yml b/tests/location/test_location_client_context.yml index e37e8693026430ef334fd536d0b50ad55b4549ee..a0e3f6f7b833b1a411e55b21791e94a61d9050f7 100644 --- a/tests/location/test_location_client_context.yml +++ b/tests/location/test_location_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 location using client context, in client host. - import_playbook: test_location.yml + ansible.builtin.import_playbook: test_location.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test location using client context, in server host. - import_playbook: test_location.yml + ansible.builtin.import_playbook: test_location.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/netgroup/test_netgroup.yml b/tests/netgroup/test_netgroup.yml index d4ac69e9610bd8a689e30318b7d11dc6035c5188..ffc8cef117b1ec51de93d2e6768c1d07bd2f2c8e 100644 --- a/tests/netgroup/test_netgroup.yml +++ b/tests/netgroup/test_netgroup.yml @@ -19,7 +19,7 @@ # CREATE TEST ITEMS - 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/netgroup/test_netgroup_client_context.yml b/tests/netgroup/test_netgroup_client_context.yml index f5a4dd3ad25b7ce3c9dac2617ba7101e11345f70..8d92ee6f71ea8b0e478d2b57c1f4ac3b05214ad7 100644 --- a/tests/netgroup/test_netgroup_client_context.yml +++ b/tests/netgroup/test_netgroup_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,25 +27,25 @@ # in upstream CI. - name: Test netgroup using client context, in client host. - import_playbook: test_netgroup.yml + ansible.builtin.import_playbook: test_netgroup.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test netgroup using client context, in server host. - import_playbook: test_netgroup.yml + ansible.builtin.import_playbook: test_netgroup.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client - name: Test netgroup with member using client context, in client host. - import_playbook: test_netgroup_member.yml + ansible.builtin.import_playbook: test_netgroup_member.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test netgroup with member using client context, in server host. - import_playbook: test_netgroup_member.yml + ansible.builtin.import_playbook: test_netgroup_member.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/netgroup/test_netgroup_member.yml b/tests/netgroup/test_netgroup_member.yml index c8365422861c80edda17b5f189855b5854c9943f..ac67fbe844f8e38589aa10add8c6668c6f48c0f6 100644 --- a/tests/netgroup/test_netgroup_member.yml +++ b/tests/netgroup/test_netgroup_member.yml @@ -7,12 +7,12 @@ tasks: - block: - 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/netgroup/test_netgroup_member_absent.yml b/tests/netgroup/test_netgroup_member_absent.yml index 14376cd2431771ebf5c7bb0988ae8a8c7733ec64..2da3125be03c62149f303309e22828e331a285af 100644 --- a/tests/netgroup/test_netgroup_member_absent.yml +++ b/tests/netgroup/test_netgroup_member_absent.yml @@ -7,12 +7,12 @@ tasks: - block: - 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/netgroup/test_netgroup_member_case_insensitive.yml b/tests/netgroup/test_netgroup_member_case_insensitive.yml index abd12593e13aeeae0e2d3035115ef4de64d44040..62aadc52f0ee725de25b94a5846b76f9858552d7 100644 --- a/tests/netgroup/test_netgroup_member_case_insensitive.yml +++ b/tests/netgroup/test_netgroup_member_case_insensitive.yml @@ -16,7 +16,7 @@ - block: # SETUP - 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 @@ -62,7 +62,7 @@ # TESTS - name: Start tests. - debug: + ansible.builtin.debug: msg: "Tests are starting." - name: Ensure netgroups exist @@ -203,7 +203,7 @@ failed_when: result.failed or result.changed - name: End tests. - debug: + ansible.builtin.debug: msg: "All tests executed." always: diff --git a/tests/permission/test_permission.yml b/tests/permission/test_permission.yml index d7edc102c0def2e0c99d69ac4a95e022b067e128..6a987295005b6e73446291691d762bd5ceb98882 100644 --- a/tests/permission/test_permission.yml +++ b/tests/permission/test_permission.yml @@ -4,7 +4,7 @@ become: true tasks: - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml - name: Ensure testing groups are present. ipagroup: diff --git a/tests/permission/test_permission_client_context.yml b/tests/permission/test_permission_client_context.yml index ca2eb2fcb5152f51bfb704506fc5267d23d4e6fa..c4a435cff1b2423d25de37e5ba9afab534f7a340 100644 --- a/tests/permission/test_permission_client_context.yml +++ b/tests/permission/test_permission_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 permission using client context, in client host. - import_playbook: test_permission.yml + ansible.builtin.import_playbook: test_permission.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test permission using client context, in server host. - import_playbook: test_permission.yml + ansible.builtin.import_playbook: test_permission.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/privilege/test_privilege_client_context.yml b/tests/privilege/test_privilege_client_context.yml index ad6397641449dab904f93b9b3d0bfc8e3fc414b2..63063f2e9d1b1d665a20ef8a27780baee021c8ca 100644 --- a/tests/privilege/test_privilege_client_context.yml +++ b/tests/privilege/test_privilege_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 privilege using client context, in client host. - import_playbook: test_privilege.yml + ansible.builtin.import_playbook: test_privilege.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test privilege using client context, in server host. - import_playbook: test_privilege.yml + ansible.builtin.import_playbook: test_privilege.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/pwpolicy/test_pwpolicy.yml b/tests/pwpolicy/test_pwpolicy.yml index e98689349aa55dfa1ce28d1e605edbf211d26f8a..db064d57b6a7f421806b9ca6979b19d3337f27ab 100644 --- a/tests/pwpolicy/test_pwpolicy.yml +++ b/tests/pwpolicy/test_pwpolicy.yml @@ -6,7 +6,7 @@ tasks: - name: Setup FreeIPA test facts. - import_tasks: ../env_freeipa_facts.yml + ansible.builtin.import_tasks: ../env_freeipa_facts.yml - name: Ensure maxlife of 90 for global_policy ipapwpolicy: diff --git a/tests/pwpolicy/test_pwpolicy_client_context.yml b/tests/pwpolicy/test_pwpolicy_client_context.yml index 14107ff7b5b9b9de5c9a0b0fe1dfda4ff7a01fba..13b47e5bae88781f1e5aaa053884565f57aeee64 100644 --- a/tests/pwpolicy/test_pwpolicy_client_context.yml +++ b/tests/pwpolicy/test_pwpolicy_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 pwpolicy using client context, in client host. - import_playbook: test_pwpolicy.yml + ansible.builtin.import_playbook: test_pwpolicy.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test pwpolicy using client context, in server host. - import_playbook: test_pwpolicy.yml + ansible.builtin.import_playbook: test_pwpolicy.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/role/env_facts.yml b/tests/role/env_facts.yml index dbc16a962e2f4d18d712c345dca3482f27113998..30341839bffa2ceba1bd7ab5642b9c265412273d 100644 --- a/tests/role/env_facts.yml +++ b/tests/role/env_facts.yml @@ -1,21 +1,21 @@ --- - block: - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" when: "'fqdn' in ansible_facts" - name: Set Domain to 'ipa.test' if FQDN could not be retrieved. - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "ipa.test" when: "'fqdn' not in ansible_facts" when: ipaserver_domain is not defined - name: Set ipaserver_realm. - set_fact: + ansible.builtin.set_fact: ipaserver_realm: "{{ ipaserver_domain | upper }}" when: ipaserver_realm is not defined - name: Create FQDN for host01 - set_fact: + ansible.builtin.set_fact: host1_fqdn: "host01.{{ ipaserver_domain }}" host2_fqdn: "host02.{{ ipaserver_domain }}" diff --git a/tests/role/env_setup.yml b/tests/role/env_setup.yml index eb72c82be49c03a491075353eb066c9cc279ceeb..6a24839e11ff6e47fa21409e9d96e0ac50dd6eee 100644 --- a/tests/role/env_setup.yml +++ b/tests/role/env_setup.yml @@ -1,6 +1,6 @@ --- - name: Cleanup environment. - import_tasks: env_cleanup.yml + ansible.builtin.import_tasks: env_cleanup.yml - name: Ensure test user is present. ipauser: diff --git a/tests/role/test_role.yml b/tests/role/test_role.yml index 5c4f81b924e7459d04ff0f64337ab6e8794137f0..884cbcd3e74cfc0c85a824d775ea8cc1f4312adb 100644 --- a/tests/role/test_role.yml +++ b/tests/role/test_role.yml @@ -6,10 +6,10 @@ tasks: - name: Set environment facts. - import_tasks: env_facts.yml + ansible.builtin.import_tasks: env_facts.yml - name: Setup environment. - import_tasks: env_setup.yml + ansible.builtin.import_tasks: env_setup.yml # tests - name: Ensure role is present. @@ -424,4 +424,4 @@ # cleanup - name: Cleanup environment. - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml diff --git a/tests/role/test_role_client_context.yml b/tests/role/test_role_client_context.yml index cb1bbba8e85acadc4ab32ba987fad79f74df20d3..3a87a2cc69af39411042fd0c10ae910d5c0e8d0b 100644 --- a/tests/role/test_role_client_context.yml +++ b/tests/role/test_role_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 role using client context, in client host. - import_playbook: test_role.yml + ansible.builtin.import_playbook: test_role.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test role using client context, in server host. - import_playbook: test_role.yml + ansible.builtin.import_playbook: test_role.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/role/test_role_lists_handling.yml b/tests/role/test_role_lists_handling.yml index ca3f023c81c11c9631a4d1b4e806988d388a0de3..f8911ac428b8056cb810e74efa77385b9595ca6e 100644 --- a/tests/role/test_role_lists_handling.yml +++ b/tests/role/test_role_lists_handling.yml @@ -6,10 +6,10 @@ tasks: - name: Set environment facts. - import_tasks: env_facts.yml + ansible.builtin.import_tasks: env_facts.yml - name: Setup environment. - import_tasks: env_setup.yml + ansible.builtin.import_tasks: env_setup.yml - name: Add role. iparole: @@ -41,7 +41,7 @@ failed_when: result.failed or not result.changed - name: Verify role privileges. - shell: + ansible.builtin.shell: cmd: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa role-show testrole @@ -71,7 +71,7 @@ failed_when: result.failed or not result.changed - name: Verify role users. - shell: + ansible.builtin.shell: cmd: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa role-show testrole @@ -95,7 +95,7 @@ failed_when: result.failed or not result.changed - name: Verify role group. - shell: + ansible.builtin.shell: cmd: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa role-show testrole @@ -119,7 +119,7 @@ failed_when: result.failed or not result.changed - name: Verify role hosts. - shell: + ansible.builtin.shell: cmd: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa role-show testrole @@ -145,7 +145,7 @@ failed_when: result.failed or not result.changed - name: Verify role hostgroups. - shell: + ansible.builtin.shell: cmd: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa role-show testrole @@ -169,7 +169,7 @@ failed_when: result.failed or not result.changed - name: Verify role services. - shell: + ansible.builtin.shell: cmd: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa role-show testrole @@ -197,7 +197,7 @@ failed_when: result.failed or not result.changed - name: Verify role services. - shell: + ansible.builtin.shell: cmd: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa role-show testrole @@ -225,7 +225,7 @@ failed_when: result.failed or not result.changed - name: Verify role services. - shell: + ansible.builtin.shell: cmd: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa role-show testrole @@ -256,4 +256,4 @@ # cleanup - name: Cleanup environment. - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml diff --git a/tests/role/test_role_member_case_insensitive.yml b/tests/role/test_role_member_case_insensitive.yml index 3f386fc3eaaf1b44a6b4fe03475f3543dbd63a08..d5d5a6c6e078500616baa173dc88a839e0d07d0f 100644 --- a/tests/role/test_role_member_case_insensitive.yml +++ b/tests/role/test_role_member_case_insensitive.yml @@ -22,7 +22,7 @@ - MySVC/host01 tasks: - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml - block: # setup diff --git a/tests/role/test_role_service_member.yml b/tests/role/test_role_service_member.yml index 307dc94f3cedc9d1124fd99983a112909e3ff55f..13fa083eb8f241e432adc64e648f556f8c4df0de 100644 --- a/tests/role/test_role_service_member.yml +++ b/tests/role/test_role_service_member.yml @@ -6,10 +6,10 @@ tasks: - name: Set environment facts. - import_tasks: env_facts.yml + ansible.builtin.import_tasks: env_facts.yml - name: Setup environment. - import_tasks: env_setup.yml + ansible.builtin.import_tasks: env_setup.yml # tests @@ -92,4 +92,4 @@ # cleanup - name: Cleanup environment. - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml diff --git a/tests/selfservice/test_selfservice_client_context.yml b/tests/selfservice/test_selfservice_client_context.yml index 04533ab7ff04ea9a596fdeb03f6bd11557c1962c..fc196a270fa8ca3f494557e5c953289b3a020847 100644 --- a/tests/selfservice/test_selfservice_client_context.yml +++ b/tests/selfservice/test_selfservice_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 selfservice using client context, in client host. - import_playbook: test_selfservice.yml + ansible.builtin.import_playbook: test_selfservice.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test selfservice using client context, in server host. - import_playbook: test_selfservice.yml + ansible.builtin.import_playbook: test_selfservice.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/server/test_server.yml b/tests/server/test_server.yml index 0216cd8c76975e71be172f866c437f8327ed794b..c27da846cd9d6cced8cb989314cff45470f00a36 100644 --- a/tests/server/test_server.yml +++ b/tests/server/test_server.yml @@ -9,21 +9,21 @@ # CLEANUP TEST ITEMS - block: - name: Get server name from hostname - set_fact: + ansible.builtin.set_fact: ipa_server_name: "{{ ansible_facts['fqdn'].split('.')[0] }}" rescue: - name: Fallback to 'ipaserver' - set_fact: + ansible.builtin.set_fact: ipa_server_name: ipaserver when: ipa_server_name is not defined - block: - name: Get domain name from hostname. - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join('.') }}" rescue: - name: Fallback to 'ipa.test' - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "ipa.test" when: ipaserver_domain is not defined diff --git a/tests/server/test_server_client_context.yml b/tests/server/test_server_client_context.yml index be7d08f158e6665ac67813bf707846bcb041d75e..6b9b1ca9aa3e8fccf3988c0df63e4b144a41e8c5 100644 --- a/tests/server/test_server_client_context.yml +++ b/tests/server/test_server_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 server using client context, in client host. - import_playbook: test_server.yml + ansible.builtin.import_playbook: test_server.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test server using client context, in server host. - import_playbook: test_server.yml + ansible.builtin.import_playbook: test_server.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/service/certificate/test_service_certificate.yml b/tests/service/certificate/test_service_certificate.yml index bbac408bcba08efdd7e2a80971d5281e58fd6e31..2eb207db1d4d6a77c4874afd4ff398f05e228ae6 100644 --- a/tests/service/certificate/test_service_certificate.yml +++ b/tests/service/certificate/test_service_certificate.yml @@ -6,7 +6,7 @@ tasks: # setup - 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" @@ -16,17 +16,17 @@ delegate_to: localhost - 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 IPv4 address prefix from server node - set_fact: + ansible.builtin.set_fact: ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | join('.') }}" - name: Set test host FQDN - set_fact: + ansible.builtin.set_fact: test_subdomain: testcert test_host: "{{ 'testcert.' + ipaserver_domain }}" @@ -215,7 +215,7 @@ state: absent - 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] become: no diff --git a/tests/service/env_setup.yml b/tests/service/env_setup.yml index 9c92a64ec15a2888eded5cb816d93474b60e5c84..5cf814a4e2919d49394c55a8f38d9c37110b1951 100644 --- a/tests/service/env_setup.yml +++ b/tests/service/env_setup.yml @@ -1,11 +1,11 @@ # Setup environment for service module tests. --- - name: Setup variables and facts. - include_tasks: env_vars.yml + ansible.builtin.include_tasks: env_vars.yml # Cleanup before setup. - name: Cleanup test environment. - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml - name: Add IP address for "nohost" host. ipadnsrecord: diff --git a/tests/service/env_vars.yml b/tests/service/env_vars.yml index 37c9e1cbe325905fb8de09be197c681ad9575540..db11dcd635650bbe4aa1f8c42febc3ec894601e2 100644 --- a/tests/service/env_vars.yml +++ b/tests/service/env_vars.yml @@ -1,15 +1,15 @@ --- - name: Get Domain from server name - set_fact: + ansible.builtin.set_fact: test_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join('.') }}" - name: Set host1, host2 and svc hosts fqdn - set_fact: + ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + test_domain }}" host2_fqdn: "{{ 'host2.' + test_domain }}" svc_fqdn: "{{ 'svc.' + test_domain }}" nohost_fqdn: "{{ 'nohost.' + test_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/service/test_service.yml b/tests/service/test_service.yml index 3436f032b0dbb8c8ad6efc489bb38c4f7f5ef12c..b206d84ef831b29f85519f51e38cb54383a584fb 100644 --- a/tests/service/test_service.yml +++ b/tests/service/test_service.yml @@ -17,13 +17,13 @@ tasks: # setup - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml # tests - name: Tests with skip_host_check, require IPA version 4.8.0+. block: - name: Setup test environment - include_tasks: env_setup.yml + ansible.builtin.include_tasks: env_setup.yml - name: Ensure service is present ipaservice: @@ -575,5 +575,5 @@ # cleanup - name: Cleanup test environment - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml when: ipa_version is version('4.7.0', '>=') diff --git a/tests/service/test_service_client_context.yml b/tests/service/test_service_client_context.yml index 902be4ddce94ccc5c1283069d69943f5a6fad423..2187fbf81ee2e1872a0d6f04e977c49ad5a2150e 100644 --- a/tests/service/test_service_client_context.yml +++ b/tests/service/test_service_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 service using client context, in client host. - import_playbook: test_service.yml + ansible.builtin.import_playbook: test_service.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test service using client context, in server host. - import_playbook: test_service.yml + ansible.builtin.import_playbook: test_service.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/service/test_service_disable.yml b/tests/service/test_service_disable.yml index 822fb9faaf7830a5f9920e4a4596e7f85ea551be..068fecffd786a8b0bfc9d57b0f79de7af16af612 100644 --- a/tests/service/test_service_disable.yml +++ b/tests/service/test_service_disable.yml @@ -14,10 +14,10 @@ tasks: - name: Get Kerberos ticket for `admin`. - shell: echo SomeADMINpassword | kinit -c ${KRB5CCNAME} admin + ansible.builtin.shell: echo SomeADMINpassword | kinit -c ${KRB5CCNAME} admin - 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" @@ -43,10 +43,10 @@ failed_when: not result.changed or result.failed - name: Obtain keytab - shell: ipa-getkeytab -s "{{ ansible_facts['fqdn'] }}" -p "mysvc1/{{ ansible_facts['fqdn'] }}" -k mysvc1.keytab + ansible.builtin.shell: ipa-getkeytab -s "{{ ansible_facts['fqdn'] }}" -p "mysvc1/{{ ansible_facts['fqdn'] }}" -k mysvc1.keytab - name: Verify keytab - shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}" + ansible.builtin.shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}" register: result failed_when: result.failed or result.stdout | regex_search(" Keytab. true") @@ -59,15 +59,15 @@ failed_when: not result.changed or result.failed - name: Verify keytab - shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}" + ansible.builtin.shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}" register: result failed_when: result.failed or result.stdout | regex_search(" Keytab. true") - name: Obtain keytab - shell: ipa-getkeytab -s "{{ ansible_facts['fqdn'] }}" -p "mysvc1/{{ ansible_facts['fqdn'] }}" -k mysvc1.keytab + ansible.builtin.shell: ipa-getkeytab -s "{{ ansible_facts['fqdn'] }}" -p "mysvc1/{{ ansible_facts['fqdn'] }}" -k mysvc1.keytab - name: Verify keytab - shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}" + ansible.builtin.shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}" register: result failed_when: result.failed or result.stdout | regex_search(" Keytab. true") @@ -80,7 +80,7 @@ failed_when: not result.changed or result.failed - name: Verify keytab - shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}" + ansible.builtin.shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}" register: result failed_when: result.failed or result.stdout | regex_search(" Keytab. true") @@ -98,10 +98,10 @@ name: "mysvc1/{{ ansible_facts['fqdn'] }}" - name: Destroy Kerberos tickets. - shell: kdestroy -A -q -c ${KRB5CCNAME} + ansible.builtin.shell: kdestroy -A -q -c ${KRB5CCNAME} - 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] become: no diff --git a/tests/service/test_service_keytab.yml b/tests/service/test_service_keytab.yml index 2d20a7e6685b530801acfd39ae9fdb420974c42b..5b0710a2d622d918107a71d4521445ce7222c822 100644 --- a/tests/service/test_service_keytab.yml +++ b/tests/service/test_service_keytab.yml @@ -6,7 +6,7 @@ tasks: # setup - name: Setup test envirnoment. - include_tasks: env_setup.yml + ansible.builtin.include_tasks: env_setup.yml # Add service to test keytab create/retrieve attributes. - name: Ensure test service is present @@ -394,4 +394,4 @@ # cleanup - name: Clean-up envirnoment. - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml diff --git a/tests/service/test_service_without_skip_host_check.yml b/tests/service/test_service_without_skip_host_check.yml index 763a56aafbedd0f26df5b99b27fe425f55662ac4..b7accbbc7a13282083b11808d3e9bda429af1e60 100644 --- a/tests/service/test_service_without_skip_host_check.yml +++ b/tests/service/test_service_without_skip_host_check.yml @@ -8,7 +8,7 @@ # setup - name: Setup test environment - include_tasks: env_setup.yml + ansible.builtin.include_tasks: env_setup.yml # tests - name: Ensure service is present @@ -461,4 +461,4 @@ # cleanup - name: Cleanup test environment - include_tasks: env_cleanup.yml + ansible.builtin.include_tasks: env_cleanup.yml diff --git a/tests/servicedelegationrule/test_servicedelegationrule_client_context.yml b/tests/servicedelegationrule/test_servicedelegationrule_client_context.yml index 03546ffc179fd831eeaaaca9be320810c84ac268..4e633728e77ed9e143a2ece5c0ffca105e5b1e85 100644 --- a/tests/servicedelegationrule/test_servicedelegationrule_client_context.yml +++ b/tests/servicedelegationrule/test_servicedelegationrule_client_context.yml @@ -8,7 +8,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. @@ -29,11 +29,11 @@ # in upstream CI. - name: Test servicedelegationrule using client context, in client host. - import_playbook: test_servicedelegationrule.yml + ansible.builtin.import_playbook: test_servicedelegationrule.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test servicedelegationrule using client context, in server host. - import_playbook: test_servicedelegationrule.yml + ansible.builtin.import_playbook: test_servicedelegationrule.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] diff --git a/tests/servicedelegationrule/test_servicedelegationrule_hostprincipal.yml b/tests/servicedelegationrule/test_servicedelegationrule_hostprincipal.yml index f0f79a76e69278b885fb9657895aa06473571ece..4d0bd7641454f2efe33b2fde154677b398e90e03 100644 --- a/tests/servicedelegationrule/test_servicedelegationrule_hostprincipal.yml +++ b/tests/servicedelegationrule/test_servicedelegationrule_hostprincipal.yml @@ -6,7 +6,7 @@ tasks: # setup - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml # host principals are only possible with IPA 4.9.0+ - block: @@ -14,17 +14,17 @@ # SET FACTS - 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: "{{ ipaserver_domain | upper }}" when: ipaserver_realm is not defined - name: Set test-host fqdn - set_fact: + ansible.builtin.set_fact: test_host_fqdn: "{{ 'test-host.' + ipaserver_domain }}" test_host_fqdn_realm: "{{ 'test-host.' + ipaserver_domain + '@' + ipaserver_realm }}" diff --git a/tests/servicedelegationtarget/test_servicedelegationtarget_client_context.yml b/tests/servicedelegationtarget/test_servicedelegationtarget_client_context.yml index 04927b93d064517fafe81a73f996cd12c560c950..cf1a9d9e9d135c3392c4e3aef8afa7f850841b39 100644 --- a/tests/servicedelegationtarget/test_servicedelegationtarget_client_context.yml +++ b/tests/servicedelegationtarget/test_servicedelegationtarget_client_context.yml @@ -8,7 +8,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. @@ -29,11 +29,11 @@ # in upstream CI. - name: Test servicedelegationtarget using client context, in client host. - import_playbook: test_servicedelegationtarget.yml + ansible.builtin.import_playbook: test_servicedelegationtarget.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test servicedelegationtarget using client context, in server host. - import_playbook: test_servicedelegationtarget.yml + ansible.builtin.import_playbook: test_servicedelegationtarget.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] diff --git a/tests/servicedelegationtarget/test_servicedelegationtarget_hostprincipal.yml b/tests/servicedelegationtarget/test_servicedelegationtarget_hostprincipal.yml index f59d0c45136585f393039377219369c342347562..aedfc69728ecc48dd4e680d3028b9bc4b3f10ab9 100644 --- a/tests/servicedelegationtarget/test_servicedelegationtarget_hostprincipal.yml +++ b/tests/servicedelegationtarget/test_servicedelegationtarget_hostprincipal.yml @@ -6,7 +6,7 @@ tasks: # setup - - include_tasks: ../env_freeipa_facts.yml + - ansible.builtin.include_tasks: ../env_freeipa_facts.yml # host principals are only possible with IPA 4.9.0+ - block: @@ -14,17 +14,17 @@ # SET FACTS - 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: "{{ ipaserver_domain | upper }}" when: ipaserver_realm is not defined - name: Set test-host fqdn - set_fact: + ansible.builtin.set_fact: test_host_fqdn: "{{ 'test-host.' + ipaserver_domain }}" test_host_fqdn_realm: "{{ 'test-host.' + ipaserver_domain + '@' + ipaserver_realm }}" diff --git a/tests/sudocmd/test_sudocmd_client_context.yml b/tests/sudocmd/test_sudocmd_client_context.yml index ce8c307d24bf6d53112c77ae062ffc3cc7497392..c10f7ffed268a819e7d2cc1b8a82d9aa65a41922 100644 --- a/tests/sudocmd/test_sudocmd_client_context.yml +++ b/tests/sudocmd/test_sudocmd_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 sudocmd using client context, in client host. - import_playbook: test_sudocmd.yml + ansible.builtin.import_playbook: test_sudocmd.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test sudocmd using client context, in server host. - import_playbook: test_sudocmd.yml + ansible.builtin.import_playbook: test_sudocmd.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/sudocmdgroup/test_sudocmdgroup.yml b/tests/sudocmdgroup/test_sudocmdgroup.yml index 59f6306167e07621a38f017b3ab558d4947e5147..39f222f888076f5b05b19537a4c640851773e9fa 100644 --- a/tests/sudocmdgroup/test_sudocmdgroup.yml +++ b/tests/sudocmdgroup/test_sudocmdgroup.yml @@ -83,7 +83,7 @@ failed_when: result.changed or result.failed - name: Verify sudocmdgroup creation with sudocmds - shell: | + ansible.builtin.shell: | echo SomeADMINpassword | kinit -c verify_sudocmdgroup admin KRB5CCNAME="verify_sudocmdgroup" ipa sudocmdgroup-show network --all kdestroy -A -q -c verify_sudocmdgroup diff --git a/tests/sudocmdgroup/test_sudocmdgroup_client_context.yml b/tests/sudocmdgroup/test_sudocmdgroup_client_context.yml index 96d39a83bd7fdc127523e26a388058ddf59c23da..ff4e9c8eb22bf53b36aac36f73ca5e5594c46953 100644 --- a/tests/sudocmdgroup/test_sudocmdgroup_client_context.yml +++ b/tests/sudocmdgroup/test_sudocmdgroup_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 sudocmdgroup using client context, in client host. - import_playbook: test_sudocmdgroup.yml + ansible.builtin.import_playbook: test_sudocmdgroup.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test sudocmdgroup using client context, in server host. - import_playbook: test_sudocmdgroup.yml + ansible.builtin.import_playbook: test_sudocmdgroup.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/sudorule/test_sudorule_categories.yml b/tests/sudorule/test_sudorule_categories.yml index 3b8c1926e1f75ab27e83eb10a34591f3f6d6af8c..5fdf24d9ef9aad392b652a5a014b8a6e70e8622c 100644 --- a/tests/sudorule/test_sudorule_categories.yml +++ b/tests/sudorule/test_sudorule_categories.yml @@ -6,7 +6,7 @@ tasks: - name: Get Domain from the server name - set_fact: + ansible.builtin.set_fact: ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" - name: Ensure sudorules are absent diff --git a/tests/sudorule/test_sudorule_client_context.yml b/tests/sudorule/test_sudorule_client_context.yml index 696cd67014683b1dbc99f45dbd11936de52fbcd0..9df585cb378e779ff1e1aa08728cdaac8c087222 100644 --- a/tests/sudorule/test_sudorule_client_context.yml +++ b/tests/sudorule/test_sudorule_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 sudorule using client context, in client host. - import_playbook: test_sudorule.yml + ansible.builtin.import_playbook: test_sudorule.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test sudorule using client context, in server host. - import_playbook: test_sudorule.yml + ansible.builtin.import_playbook: test_sudorule.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/sudorule/test_sudorule_member_case_insensitive.yml b/tests/sudorule/test_sudorule_member_case_insensitive.yml index ec1507afa61917d77f16f41e242cd5fcb767561a..724dabda6f44302247ced940f8cfa2f9907c1423 100644 --- a/tests/sudorule/test_sudorule_member_case_insensitive.yml +++ b/tests/sudorule/test_sudorule_member_case_insensitive.yml @@ -16,7 +16,7 @@ - block: # SETUP - name: Ensure domain name - set_fact: + ansible.builtin.set_fact: ipa_domain: ipa.test when: ipa_domain is not defined @@ -56,7 +56,7 @@ # TESTS - name: Start tests. - debug: + ansible.builtin.debug: msg: "Tests are starting." - name: Ensure sudorule exist with runasusers members @@ -249,7 +249,7 @@ failed_when: result.failed or result.changed - name: End tests. - debug: + ansible.builtin.debug: msg: "All tests executed." always: diff --git a/tests/sudorule/test_sudorule_single_hostnames.yml b/tests/sudorule/test_sudorule_single_hostnames.yml index 38ccad9a508216bdfc5c13a39607685610e47990..24acd8b64bdb41c64b1cca9fee0e3f88f25de2ab 100644 --- a/tests/sudorule/test_sudorule_single_hostnames.yml +++ b/tests/sudorule/test_sudorule_single_hostnames.yml @@ -8,7 +8,7 @@ - block: # setup test environment - name: Get Domain from the 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/trust/test_trust.yml b/tests/trust/test_trust.yml index 5d1280d05bd154b64345a6e90d83ca1601c61fc6..f998c6fc791252d5fabe05e053c2a554e9a78acc 100644 --- a/tests/trust/test_trust.yml +++ b/tests/trust/test_trust.yml @@ -28,7 +28,7 @@ state: absent - name: Clear test idranges - shell: | + ansible.builtin.shell: | kinit -c test_krb5_cache admin <<< SomeADMINpassword ipa idrange-del {{ adserver.realm }}_id_range || true ipa idrange-del {{ ipaserver.realm }}_subid_range || true @@ -48,7 +48,7 @@ failed_when: result.failed or not result.changed - name: check if 'ipa-ad-trust' trust exists - shell: | + ansible.builtin.shell: | echo 'SomeADMINpassword' | kinit admin ipa trust-find kdestroy -c test_krb5_cache -q -A @@ -77,7 +77,7 @@ failed_when: result.failed or not result.changed - name: Check if 'ipa-ad-trust' trust was removed - shell: | + ansible.builtin.shell: | kinit -c test_krb5_cache admin <<< SomeADMINpassword ipa trust-find kdestroy -c test_krb5_cache -q -A @@ -94,7 +94,7 @@ failed_when: result.failed or result.changed - name: Clear test idranges - shell: | + ansible.builtin.shell: | kinit -c test_krb5_cache admin <<< SomeADMINpassword ipa idrange-del {{ adserver.realm }}_id_range || true ipa idrange-del {{ ipaserver.realm }}_subid_range || true @@ -113,7 +113,7 @@ failed_when: result.failed or not result.changed - name: Check if 'ipa-ad-trust-posix' trust exists - shell: | + ansible.builtin.shell: | kinit -c test_krb5_cache admin <<< SomeADMINpassword ipa trust-find kdestroy -c test_krb5_cache -q -A @@ -142,7 +142,7 @@ failed_when: result.failed or not result.changed - name: Check if trust 'ipa-ad-trust-posix' was removed - shell: | + ansible.builtin.shell: | kinit -c test_krb5_cache admin <<< SomeADMINpassword ipa trust-find kdestroy -c test_krb5_cache -q -A @@ -159,7 +159,7 @@ failed_when: result.failed or result.changed - name: Clear test idranges - shell: | + ansible.builtin.shell: | kinit -c test_krb5_cache admin <<< SomeADMINpassword ipa idrange-del {{ adserver.realm }}_id_range || true ipa idrange-del {{ ipaserver.realm }}_subid_range || true diff --git a/tests/trust/test_trust_client_context.yml b/tests/trust/test_trust_client_context.yml index 6f4ff06edf6d1c727d5f1d1c2a65c593e26736d4..c60f9d889b5c97e7a2c0af01fc35e948a0d46d45 100644 --- a/tests/trust/test_trust_client_context.yml +++ b/tests/trust/test_trust_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 trust using client context, in client host. - import_playbook: test_trust.yml + ansible.builtin.import_playbook: test_trust.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test trust using client context, in server host. - import_playbook: test_trust.yml + ansible.builtin.import_playbook: test_trust.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/user/certificate/test_user_certificate.yml b/tests/user/certificate/test_user_certificate.yml index 09dacbb35e54e66aa1b3693dd8e7b06197e5128b..cad033aae40aaf4083ac817754416ef111442403 100644 --- a/tests/user/certificate/test_user_certificate.yml +++ b/tests/user/certificate/test_user_certificate.yml @@ -6,7 +6,7 @@ tasks: - 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" @@ -81,7 +81,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/user/certificate/test_users_certificate.yml b/tests/user/certificate/test_users_certificate.yml index d649f848e6558862f68128f7da23d70949b1efc6..55d73e230109f0f0e9ac9cb3de87b395fe188a8e 100644 --- a/tests/user/certificate/test_users_certificate.yml +++ b/tests/user/certificate/test_users_certificate.yml @@ -6,7 +6,7 @@ tasks: - 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" @@ -94,7 +94,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/user/certmapdata/test_user_certmapdata.yml b/tests/user/certmapdata/test_user_certmapdata.yml index 0257b23b4849e352155c88b5fe58adf049a66cba..7bb71ddd9382d3013f2473625a932ccad8d5bb06 100644 --- a/tests/user/certmapdata/test_user_certmapdata.yml +++ b/tests/user/certmapdata/test_user_certmapdata.yml @@ -6,7 +6,7 @@ tasks: - 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" @@ -226,7 +226,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/user/certmapdata/test_users_certmapdata.yml b/tests/user/certmapdata/test_users_certmapdata.yml index 491face65ffa79ea2872c6814b523f91e045c40a..83a4ce8c4fe8029548ebe4137a325dddedc14667 100644 --- a/tests/user/certmapdata/test_users_certmapdata.yml +++ b/tests/user/certmapdata/test_users_certmapdata.yml @@ -6,7 +6,7 @@ tasks: - 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" @@ -162,7 +162,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/user/create_users_json.yml b/tests/user/create_users_json.yml index f066b0b50853f49c98d2adfb72fe7a76e36d0070..15c3701f3f32e9c0c04287545be2199b404b819e 100644 --- a/tests/user/create_users_json.yml +++ b/tests/user/create_users_json.yml @@ -4,10 +4,10 @@ tasks: - name: Check if users.json exists - stat: + ansible.builtin.stat: path: users.json register: register_stat_users - name: Create users.json - command: /bin/bash users.sh 500 + ansible.builtin.command: /bin/bash users.sh 500 when: not register_stat_users.stat.exists diff --git a/tests/user/test_user_client_context.yml b/tests/user/test_user_client_context.yml index b4a37a35572fb67ba63a0a6db1ca437de051d7a8..fbb75dbcd8e32d841a179321fffdcf74afb02af3 100644 --- a/tests/user/test_user_client_context.yml +++ b/tests/user/test_user_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 user using client context, in client host. - import_playbook: test_user.yml + ansible.builtin.import_playbook: test_user.yml when: groups['ipaclients'] vars: ipa_test_host: ipaclients - name: Test user using client context, in server host. - import_playbook: test_user.yml + ansible.builtin.import_playbook: test_user.yml when: groups['ipaclients'] is not defined or not groups['ipaclients'] vars: ipa_context: client diff --git a/tests/user/test_user_random.yml b/tests/user/test_user_random.yml index ce56abb020048f1a57c3484d2fdf951713e794df..205f057d146d5d76bf0637ff4b79f38bb8e71b2b 100644 --- a/tests/user/test_user_random.yml +++ b/tests/user/test_user_random.yml @@ -26,7 +26,7 @@ ipauser.failed - name: Print generated random password - debug: + ansible.builtin.debug: var: ipauser.user.randompassword - name: User user1 absent @@ -56,11 +56,11 @@ ipauser.failed - name: Print generated random password for user1 - debug: + ansible.builtin.debug: var: ipauser.user.user1.randompassword - name: Print generated random password for user2 - debug: + ansible.builtin.debug: var: ipauser.user.user2.randompassword - name: Users user1 and user2 absent diff --git a/tests/user/test_users_absent.yml b/tests/user/test_users_absent.yml index 6195374d312807c3b3f886fc35aefc23cdb210fb..23670510ed8cf35b050df6923cb6b34766b5b924 100644 --- a/tests/user/test_users_absent.yml +++ b/tests/user/test_users_absent.yml @@ -1,6 +1,6 @@ --- - name: Include create_users_json.yml - import_playbook: create_users_json.yml + ansible.builtin.import_playbook: create_users_json.yml - name: Test users absent hosts: ipaserver @@ -9,11 +9,11 @@ tasks: - name: Include users.json - include_vars: + ansible.builtin.include_vars: file: users.json # noqa 505 - name: Create dict with user names - set_fact: + ansible.builtin.set_fact: user_names: "{{ user_names | default([]) + [{ 'name': item.name }] }}" loop: "{{ users }}" diff --git a/tests/user/test_users_invalid_cert.yml b/tests/user/test_users_invalid_cert.yml index 50112ce5e14712147ae4a6ab72f5666d3a9af906..50600e697f68a07fb2b68bc44f96283186017bf8 100644 --- a/tests/user/test_users_invalid_cert.yml +++ b/tests/user/test_users_invalid_cert.yml @@ -6,7 +6,7 @@ tasks: - 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" @@ -55,7 +55,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] become: no diff --git a/tests/user/test_users_present.yml b/tests/user/test_users_present.yml index 75dfdbfd7537245303e0f128b096949d14f60a7a..0a3279fa70d2371d1320f96b5f0b10a68eb8d443 100644 --- a/tests/user/test_users_present.yml +++ b/tests/user/test_users_present.yml @@ -1,6 +1,6 @@ --- - name: Include create_users_json.yml - import_playbook: create_users_json.yml + ansible.builtin.import_playbook: create_users_json.yml - name: Test users present hosts: ipaserver @@ -9,7 +9,7 @@ tasks: - name: Include users.json - include_vars: + ansible.builtin.include_vars: file: users.json # noqa 505 - name: Users present len:{{ users | length }} diff --git a/tests/user/test_users_present_slice.yml b/tests/user/test_users_present_slice.yml index 8f1c6dd4e1a2f16bdfccdaeb15f42cc074673206..904be415ae8c13342a7c0345805807160c0e4900 100644 --- a/tests/user/test_users_present_slice.yml +++ b/tests/user/test_users_present_slice.yml @@ -1,6 +1,6 @@ --- - name: Include create_users_json.yml - import_playbook: create_users_json.yml + ansible.builtin.import_playbook: create_users_json.yml - name: Test users present slice hosts: ipaserver @@ -11,10 +11,10 @@ slice_size: 500 tasks: - name: Include users.json - include_vars: + ansible.builtin.include_vars: file: users.json # noqa 505 - name: Size of users slice. - debug: + ansible.builtin.debug: msg: "{{ users | length }}" - name: Users present ipauser: diff --git a/tests/vault/env_cleanup.yml b/tests/vault/env_cleanup.yml index 85f4d10c9e9d6eb912295aaeb5766ffd538e71f6..c91ae40981f71631f4015000026ee2e409697941 100644 --- a/tests/vault/env_cleanup.yml +++ b/tests/vault/env_cleanup.yml @@ -41,7 +41,7 @@ state: absent - name: Remove files from target host. - file: + ansible.builtin.file: path: "{{ ansible_facts['env'].HOME }}/{{ item }}" state: absent with_items: @@ -58,7 +58,7 @@ - out.txt - name: Remove files from controller. - file: + ansible.builtin.file: path: "{{ playbook_dir }}/{{ item }}" state: absent delegate_to: localhost diff --git a/tests/vault/env_setup.yml b/tests/vault/env_setup.yml index 69e9cb71589cf49707e549bdc8e432b6f1405b5c..a122454998cf367a3d3d32ef8e5508163c43fcdd 100644 --- a/tests/vault/env_setup.yml +++ b/tests/vault/env_setup.yml @@ -1,10 +1,10 @@ --- # Tasks executed to ensure a sane environment to test IPA Vault module. - name: Ensure environment is clean. - import_tasks: env_cleanup.yml + ansible.builtin.import_tasks: env_cleanup.yml - name: Create private/public key pair. - shell: + ansible.builtin.shell: cmd: | openssl genrsa -out "{{ item }}private.pem" 2048 openssl rsa -in "{{ item }}private.pem" -outform PEM -pubout -out "{{ item }}public.pem" @@ -17,7 +17,7 @@ - B_ - name: Copy files to target host. - copy: + ansible.builtin.copy: src: "{{ playbook_dir }}/{{ item }}" dest: "{{ ansible_facts['env'].HOME }}/{{ item }}" mode: 0644 diff --git a/tests/vault/tasks_vault_members.yml b/tests/vault/tasks_vault_members.yml index d3af934727fc20c5e75b36eb518c6e11fdcd9404..a68d5aac2d82749cdd12300052cbe28010c8ab3b 100644 --- a/tests/vault/tasks_vault_members.yml +++ b/tests/vault/tasks_vault_members.yml @@ -1,7 +1,7 @@ --- # Tasks to test member management for Vault module. - name: Setup testing environment. - import_tasks: env_setup.yml + ansible.builtin.import_tasks: env_setup.yml - name: Ensure vault is present ipavault: @@ -315,4 +315,4 @@ failed_when: result.changed or result.failed - name: Cleanup testing environment. - import_tasks: env_cleanup.yml + ansible.builtin.import_tasks: env_cleanup.yml diff --git a/tests/vault/test_vault_asymmetric.yml b/tests/vault/test_vault_asymmetric.yml index a757e7fd9c1b328b8b41d44d075325babc30a621..2790cf5e019dfb7c2eecb66695c91f9a8fcbbae7 100644 --- a/tests/vault/test_vault_asymmetric.yml +++ b/tests/vault/test_vault_asymmetric.yml @@ -7,7 +7,7 @@ tasks: - name: Setup testing environment. - import_tasks: env_setup.yml + ansible.builtin.import_tasks: env_setup.yml - name: Ensure asymmetric vault is present ipavault: @@ -165,7 +165,7 @@ failed_when: result.changed or result.failed or (result.vault.data | default(false)) - name: Verify retrieved data. - slurp: + ansible.builtin.slurp: src: "{{ ansible_facts['env'].HOME }}/data.txt" register: slurpfile failed_when: slurpfile['content'] | b64decode != 'Hello World.' @@ -299,4 +299,4 @@ failed_when: result.changed or result.failed - name: Cleanup testing environment. - import_tasks: env_cleanup.yml + ansible.builtin.import_tasks: env_cleanup.yml diff --git a/tests/vault/test_vault_change_type.yml b/tests/vault/test_vault_change_type.yml index 8490a2c9a5f6582379c03ff7a0694e2d52e99e77..a5fb0c8bd0138133beb92ac39bbd40473d06554b 100644 --- a/tests/vault/test_vault_change_type.yml +++ b/tests/vault/test_vault_change_type.yml @@ -7,7 +7,7 @@ tasks: - name: Setup testing environment. - import_tasks: env_setup.yml + ansible.builtin.import_tasks: env_setup.yml - name: Ensure test_vault is absent. ipavault: @@ -42,7 +42,7 @@ failed_when: result.failed or not result.changed - name: Verify assymetric-only fields are not present. - shell: | + ansible.builtin.shell: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa vault-show test_vault kdestroy -A -q -c {{ krb5ccname }} @@ -63,7 +63,7 @@ failed_when: result.failed or not result.changed - name: Verify salt is not present. - shell: | + ansible.builtin.shell: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa vault-show test_vault kdestroy -A -q -c {{ krb5ccname }} @@ -94,7 +94,7 @@ failed_when: result.failed or not result.changed - name: Verify salt is not present. - shell: | + ansible.builtin.shell: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa vault-show test_vault kdestroy -A -q -c {{ krb5ccname }} @@ -115,7 +115,7 @@ failed_when: result.failed or not result.changed - name: Verify assymetric-only fields are not present. - shell: | + ansible.builtin.shell: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa vault-show test_vault kdestroy -A -q -c {{ krb5ccname }} @@ -168,7 +168,7 @@ failed_when: result.failed or not result.changed - name: Verify assymetric-only fields are not present. - shell: | + ansible.builtin.shell: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa vault-show test_vault kdestroy -A -q -c {{ krb5ccname }} @@ -198,7 +198,7 @@ failed_when: result.failed or not result.changed - name: Verify salt is not present. - shell: | + ansible.builtin.shell: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa vault-show test_vault kdestroy -A -q -c {{ krb5ccname }} @@ -246,7 +246,7 @@ failed_when: result.failed or not result.changed - name: Verify salt is not present. - shell: | + ansible.builtin.shell: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa vault-show test_vault kdestroy -A -q -c {{ krb5ccname }} @@ -276,7 +276,7 @@ failed_when: result.failed or not result.changed or result.failed - name: Verify assymetric-only fields are not present. - shell: | + ansible.builtin.shell: | echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin KRB5CCNAME={{ krb5ccname }} ipa vault-show test_vault kdestroy -A -q -c {{ krb5ccname }} @@ -301,4 +301,4 @@ state: absent - name: Cleanup testing environment. - import_tasks: env_cleanup.yml + ansible.builtin.import_tasks: env_cleanup.yml diff --git a/tests/vault/test_vault_client_context.yml b/tests/vault/test_vault_client_context.yml index 2ebb410e9633aed52ac1dc22374daca7065b63dc..7f6fa452a5bb71e914bbd323a7ed06ac59aacc48 100644 --- a/tests/vault/test_vault_client_context.yml +++ b/tests/vault/test_vault_client_context.yml @@ -7,7 +7,7 @@ tasks: - name: Setup testing environment. - import_tasks: env_setup.yml + ansible.builtin.import_tasks: env_setup.yml # vault requires 'ipaapi_context: client', and uses this # context by defoult, so we test only for the case where @@ -22,4 +22,4 @@ failed_when: not (result.failed and result.msg is regex("Context 'server' for ipavault not yet supported.")) - name: Cleanup testing environment. - import_tasks: env_cleanup.yml + ansible.builtin.import_tasks: env_cleanup.yml diff --git a/tests/vault/test_vault_members.yml b/tests/vault/test_vault_members.yml index 219236aef176b86732f3a501b17172e0e5415da5..eb22e78eea79145c497f9a478afd7421737f86d5 100644 --- a/tests/vault/test_vault_members.yml +++ b/tests/vault/test_vault_members.yml @@ -7,7 +7,7 @@ tasks: - name: Test vault module member operations. - include_tasks: + ansible.builtin.include_tasks: file: tasks_vault_members.yml apply: tags: diff --git a/tests/vault/test_vault_standard.yml b/tests/vault/test_vault_standard.yml index 67aca2039feba07d8c6d819d36bae74918f1517d..c828d1bfb739526f254806aad23c3bdc70b2fee1 100644 --- a/tests/vault/test_vault_standard.yml +++ b/tests/vault/test_vault_standard.yml @@ -7,7 +7,7 @@ tasks: - name: Setup testing environment. - import_tasks: env_setup.yml + ansible.builtin.import_tasks: env_setup.yml - name: Ensure standard vault is present ipavault: @@ -67,7 +67,7 @@ failed_when: result.changed or result.failed or (result.vault.data | default(false)) - name: Verify retrieved data. - slurp: + ansible.builtin.slurp: src: "{{ ansible_facts['env'].HOME }}/data.txt" register: slurpfile failed_when: slurpfile['content'] | b64decode != 'Hello World.' @@ -138,4 +138,4 @@ failed_when: result.changed or result.failed - name: Cleanup testing environment. - import_tasks: env_cleanup.yml + ansible.builtin.import_tasks: env_cleanup.yml diff --git a/tests/vault/test_vault_symmetric.yml b/tests/vault/test_vault_symmetric.yml index 0ae79349703d57afb7fcd93f4152885c1f5b1432..89ee142482f067b9f0ee7023a113926b9e968002 100644 --- a/tests/vault/test_vault_symmetric.yml +++ b/tests/vault/test_vault_symmetric.yml @@ -7,7 +7,7 @@ tasks: - name: Setup testing environment. - import_tasks: env_setup.yml + ansible.builtin.import_tasks: env_setup.yml - name: Ensure symmetric vault is present ipavault: @@ -74,7 +74,7 @@ failed_when: result.changed or result.failed or (result.vault.data | default(false)) - name: Verify retrieved data. - slurp: + ansible.builtin.slurp: src: "{{ ansible_facts['env'].HOME }}/data.txt" register: slurpfile failed_when: slurpfile['content'] | b64decode != 'Hello World.' @@ -351,4 +351,4 @@ failed_when: result.failed or not result.changed - name: Cleanup testing environment. - import_tasks: env_cleanup.yml + ansible.builtin.import_tasks: env_cleanup.yml