From: David Galloway Date: Mon, 4 Nov 2019 21:32:18 +0000 (-0500) Subject: all: Using tests as filters is deprecated X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9102929d9de2987bd38aa9dcfd6715752d2c3fd5;p=ceph-cm-ansible.git all: Using tests as filters is deprecated Signed-off-by: David Galloway --- diff --git a/roles/ansible-managed/tasks/main.yml b/roles/ansible-managed/tasks/main.yml index cf5f23e8..a30c1276 100644 --- a/roles/ansible-managed/tasks/main.yml +++ b/roles/ansible-managed/tasks/main.yml @@ -20,7 +20,7 @@ - name: Delete the ansible users password. command: "passwd -d {{ cm_user }}" - when: user_created is defined and user_created|changed + when: user_created is defined and user_created is changed tags: - user diff --git a/roles/cobbler/tasks/main.yml b/roles/cobbler/tasks/main.yml index 82520919..c2aa71f3 100644 --- a/roles/cobbler/tasks/main.yml +++ b/roles/cobbler/tasks/main.yml @@ -59,7 +59,7 @@ name: xinetd state: reloaded enabled: yes - when: tftp_enabled is defined and tftp_enabled|changed + when: tftp_enabled is defined and tftp_enabled is changed tags: - tftp diff --git a/roles/cobbler/tasks/settings.yml b/roles/cobbler/tasks/settings.yml index e9037f03..0456e3b8 100644 --- a/roles/cobbler/tasks/settings.yml +++ b/roles/cobbler/tasks/settings.yml @@ -25,7 +25,7 @@ register: server_value - import_tasks: restart.yml - when: users_digest|changed or dynamic_settings|changed or server_value|changed + when: users_digest is changed or dynamic_settings is changed or server_value is changed - name: Update settings command: cobbler setting edit --name={{ item.name }} --value={{ item.value}} diff --git a/roles/cobbler_profile/tasks/download_image.yml b/roles/cobbler_profile/tasks/download_image.yml index 33f35625..a5acfd44 100644 --- a/roles/cobbler_profile/tasks/download_image.yml +++ b/roles/cobbler_profile/tasks/download_image.yml @@ -25,4 +25,4 @@ - name: Set files_exist if the required files are in place set_fact: - files_exist: "{{ ( kernel_stat.stat.exists or download_kernel|changed) and ( initrd_stat.stat.exists or download_initrd|changed ) }}" + files_exist: "{{ ( kernel_stat.stat.exists or download_kernel is changed) and ( initrd_stat.stat.exists or download_initrd is changed ) }}" diff --git a/roles/cobbler_profile/tasks/import_distro_image.yml b/roles/cobbler_profile/tasks/import_distro_image.yml index 01535c29..29d8e1e1 100644 --- a/roles/cobbler_profile/tasks/import_distro_image.yml +++ b/roles/cobbler_profile/tasks/import_distro_image.yml @@ -25,11 +25,11 @@ - name: Set arch set_fact: arch: "{{ distro.arch|default('x86_64') }}" - when: download_kernel is defined and download_kernel|success + when: download_kernel is defined and download_kernel is success - name: Add the distro to cobbler command: cobbler distro add --kernel {{ kernel_path }} --initrd {{ initrd_path }} --name {{ distro_name }} - when: download|changed or (files_exist and + when: download is changed or (files_exist and profile is defined and profile.stdout == '') register: import diff --git a/roles/cobbler_profile/tasks/import_distro_iso.yml b/roles/cobbler_profile/tasks/import_distro_iso.yml index 8cc382e3..76a1bd6d 100644 --- a/roles/cobbler_profile/tasks/import_distro_iso.yml +++ b/roles/cobbler_profile/tasks/import_distro_iso.yml @@ -28,19 +28,19 @@ opts: "loop" fstype: "iso9660" state: mounted - when: download|changed or (iso_stat.stat.exists and + when: download is changed or (iso_stat.stat.exists and profile is defined and profile.stdout == '') register: mount - name: Set arch set_fact: arch: "{{ distro.arch|default('x86_64') }}" - when: mount is defined and mount|changed + when: mount is defined and mount is changed - name: Import the distro (also creates the profile) command: cobbler import --path={{ iso_mount }} --name={{ distro_name }} --arch={{ arch }} register: import - when: mount is defined and mount|changed + when: mount is defined and mount is changed - name: Unmount ISO mount: @@ -48,4 +48,4 @@ src: "{{ iso_path }}" fstype: "iso9660" state: unmounted - when: mount is defined and mount|changed + when: mount is defined and mount is changed diff --git a/roles/common/tasks/apt_systems.yml b/roles/common/tasks/apt_systems.yml index 619be91d..e5fe259a 100644 --- a/roles/common/tasks/apt_systems.yml +++ b/roles/common/tasks/apt_systems.yml @@ -21,6 +21,6 @@ - name: Inform the OS of the new timezone command: dpkg-reconfigure --frontend noninteractive tzdata - when: etc_timezone|changed + when: etc_timezone is changed tags: - timezone diff --git a/roles/common/tasks/beta_repos.yml b/roles/common/tasks/beta_repos.yml index f5e91741..fec85741 100644 --- a/roles/common/tasks/beta_repos.yml +++ b/roles/common/tasks/beta_repos.yml @@ -12,4 +12,4 @@ - name: Clean yum cache shell: yum clean all - when: beta_repo is defined and beta_repo|changed + when: beta_repo is defined and beta_repo is changed diff --git a/roles/common/tasks/epel.yml b/roles/common/tasks/epel.yml index 0cbded29..f3befb8d 100644 --- a/roles/common/tasks/epel.yml +++ b/roles/common/tasks/epel.yml @@ -29,4 +29,4 @@ - name: Clean yum cache shell: yum clean all - when: epel_repo is defined and epel_repo|changed + when: epel_repo is defined and epel_repo is changed diff --git a/roles/common/tasks/kerberos.yml b/roles/common/tasks/kerberos.yml index 6f1c04ca..d50fa632 100644 --- a/roles/common/tasks/kerberos.yml +++ b/roles/common/tasks/kerberos.yml @@ -17,7 +17,7 @@ update_cache: yes # Register and retry to work around transient http issues register: apt_cache_update - until: apt_cache_update|success + until: apt_cache_update is success # try for 2 minutes before failing retries: 24 delay: 5 diff --git a/roles/common/tasks/rhel-entitlements.yml b/roles/common/tasks/rhel-entitlements.yml index 6a4033bd..0b016ce2 100644 --- a/roles/common/tasks/rhel-entitlements.yml +++ b/roles/common/tasks/rhel-entitlements.yml @@ -44,7 +44,7 @@ no_log: true when: rhsm_registered == false and have_entitlements == true register: entitled - until: entitled|success + until: entitled is success retries: 5 delay: 10 failed_when: @@ -54,7 +54,7 @@ - name: Set rhsm_registered if we just registered set_fact: rhsm_registered: true - when: entitled|success + when: entitled is success # Output of this command is, for example: # 7.1 @@ -75,7 +75,7 @@ command: subscription-manager unregister when: ansible_distribution_version not in rhsm_release_list.stdout_lines register: unregistered_beta_distro - until: unregistered_beta_distro|success + until: unregistered_beta_distro is success retries: 5 delay: 10 @@ -84,7 +84,7 @@ - name: Set rhsm_registered to false if Beta/Alpha/RC release set_fact: rhsm_registered: false - when: not unregistered_beta_distro|skipped + when: unregistered_beta_distro is not skipped - name: Run beta_repos.yml playbook for Beta/Alpha/RC release import_tasks: beta_repos.yml @@ -99,12 +99,12 @@ - name: Store list of enabled repos set_fact: repo_list: "{{ repo_list_cmd.stdout.split('\n') }}" - when: repo_list_cmd is defined and not repo_list_cmd|skipped + when: repo_list_cmd is defined and repo_list_cmd is not skipped - name: Set replace_repos false if entitlements are missing or if we unregistered set_fact: replace_repos: false - when: have_entitlements == false or unregistered_beta_distro|changed + when: have_entitlements == false or unregistered_beta_distro is changed - name: Set replace_repos true if rhsm_repos differs from repo_list set_fact: @@ -115,7 +115,7 @@ set_fact: replace_repos: true when: rhsm_registered == true and - (entitled|changed and entitled.rc == 0) + (entitled is changed and entitled.rc == 0) - name: Disable all rhsm repos command: subscription-manager repos --disable '*' @@ -136,4 +136,4 @@ file: path: /etc/yum.repos.d/cd.repo state: absent - when: entitled|success + when: entitled is success diff --git a/roles/dhcp-server/tasks/main.yml b/roles/dhcp-server/tasks/main.yml index d68e5996..38e0c6e9 100644 --- a/roles/dhcp-server/tasks/main.yml +++ b/roles/dhcp-server/tasks/main.yml @@ -48,13 +48,13 @@ - name: Test new config command: dhcpd -t -cf /etc/dhcp/dhcpd.conf register: dhcpd_config_test_result - when: dhcp_global_config|changed or dhcp_subnet_config|changed + when: dhcp_global_config is changed or dhcp_subnet_config is changed - name: Restart dhcpd service: name: dhcpd state: restarted when: - - (dhcp_global_config|changed or dhcp_subnet_config|changed) + - (dhcp_global_config is changed or dhcp_subnet_config is changed) - dhcpd_config_test_result is defined - dhcpd_config_test_result.rc == 0 diff --git a/roles/nsupdate_web/tasks/main.yml b/roles/nsupdate_web/tasks/main.yml index 11f32a22..3d29452a 100644 --- a/roles/nsupdate_web/tasks/main.yml +++ b/roles/nsupdate_web/tasks/main.yml @@ -67,7 +67,7 @@ daemon_reload: true enabled: true state: restarted - when: ship_service|changed + when: ship_service is changed - name: Ship nginx configuration template: diff --git a/roles/ntp-server/tasks/main.yml b/roles/ntp-server/tasks/main.yml index 3dfc2c63..dd6fba4f 100644 --- a/roles/ntp-server/tasks/main.yml +++ b/roles/ntp-server/tasks/main.yml @@ -87,7 +87,7 @@ name: ntpd state: restarted when: - - conf_written|changed + - conf_written is changed - use_ntp == true - name: Restart chronyd service when conf changed @@ -95,7 +95,7 @@ name: chronyd state: restarted when: - - conf_written|changed + - conf_written is changed - use_chrony == true - name: Check for firewalld diff --git a/roles/paddles/tasks/setup_db.yml b/roles/paddles/tasks/setup_db.yml index 347b7a8f..0380f2e4 100644 --- a/roles/paddles/tasks/setup_db.yml +++ b/roles/paddles/tasks/setup_db.yml @@ -11,14 +11,14 @@ name: "{{ paddles_user }}" password: "{{ db_pass }}" become_user: postgres - when: create_db|changed + when: create_db is changed - name: Run pecan populate command: ./virtualenv/bin/pecan populate prod.py args: chdir: "{{ paddles_repo_path }}" become_user: "{{ paddles_user }}" - when: create_db|changed + when: create_db is changed - name: Copy alembic config template to alembic.ini command: cp ./alembic.ini.in alembic.ini @@ -38,5 +38,5 @@ shell: ./virtualenv/bin/alembic stamp head args: chdir: "{{ paddles_repo_path }}" - when: alembic_ini|changed + when: alembic_ini is changed become_user: "{{ paddles_user }}" diff --git a/roles/paddles/tasks/setup_service.yml b/roles/paddles/tasks/setup_service.yml index 91d33ca2..057e89b7 100644 --- a/roles/paddles/tasks/setup_service.yml +++ b/roles/paddles/tasks/setup_service.yml @@ -15,7 +15,7 @@ - name: Read supervisord config command: supervisorctl update - when: supervisor_conf|changed + when: supervisor_conf is changed - name: Ensure paddles is running supervisorctl: @@ -26,7 +26,7 @@ supervisorctl: name: paddles state: restarted - when: prod_conf is defined and prod_conf|changed + when: prod_conf is defined and prod_conf is changed tags: - config diff --git a/roles/pcp/tasks/collector.yml b/roles/pcp/tasks/collector.yml index 55051f05..8c01e5db 100644 --- a/roles/pcp/tasks/collector.yml +++ b/roles/pcp/tasks/collector.yml @@ -31,9 +31,9 @@ state: restarted enabled: yes when: - install_pcp_apt|changed or - install_pcp_yum|changed or - install_pcp_dnf|changed + install_pcp_apt is changed or + install_pcp_yum is changed or + install_pcp_dnf is changed - name: Restart pmlogger service: @@ -41,6 +41,6 @@ state: restarted enabled: yes when: - install_pcp_apt|changed or - install_pcp_yum|changed or - install_pcp_dnf|changed + install_pcp_apt is changed or + install_pcp_yum is changed or + install_pcp_dnf is changed diff --git a/roles/pcp/tasks/manager.yml b/roles/pcp/tasks/manager.yml index b6e450bc..81f34292 100644 --- a/roles/pcp/tasks/manager.yml +++ b/roles/pcp/tasks/manager.yml @@ -106,10 +106,10 @@ state: restarted enabled: yes when: - install_pmmgr_apt|changed or - install_pmmgr_yum|changed or - target_host|changed or - target_discovery|changed or - pmmgr_options|changed or - update_pmlogmerge_retain|changed or - update_pmlogmerge_reduce|changed + install_pmmgr_apt is changed or + install_pmmgr_yum is changed or + target_host is changed or + target_discovery is changed or + pmmgr_options is changed or + update_pmlogmerge_retain is changed or + update_pmlogmerge_reduce is changed diff --git a/roles/pcp/tasks/web.yml b/roles/pcp/tasks/web.yml index 37c3393b..15082b67 100644 --- a/roles/pcp/tasks/web.yml +++ b/roles/pcp/tasks/web.yml @@ -49,6 +49,6 @@ name: "{{ pmmgr_service }}" state: restarted when: - install_pcp_webapi|changed or - install_pcp_webjs|changed or - enable_pmwebd|changed + install_pcp_webapi is changed or + install_pcp_webjs is changed or + enable_pmwebd is changed diff --git a/roles/testnode/tasks/apt_systems.yml b/roles/testnode/tasks/apt_systems.yml index 0a9d2294..8bf81a2b 100644 --- a/roles/testnode/tasks/apt_systems.yml +++ b/roles/testnode/tasks/apt_systems.yml @@ -44,7 +44,7 @@ command: mount -o remount,user_xattr / when: add_user_xattr is defined and - add_user_xattr|changed + add_user_xattr is changed - name: Ensure fuse group exists. group: diff --git a/roles/testnode/tasks/resolvconf.yml b/roles/testnode/tasks/resolvconf.yml index 92b15f1d..f435af29 100644 --- a/roles/testnode/tasks/resolvconf.yml +++ b/roles/testnode/tasks/resolvconf.yml @@ -36,7 +36,7 @@ - name: Set bounce_interface if we just enabled dhcp set_fact: - bounce_interface: "{{ dhcp_enabled|changed }}" + bounce_interface: "{{ dhcp_enabled is changed }}" - name: ifdown and ifup shell: "ifdown {{ interface }} && ifup {{ interface }}" diff --git a/roles/testnode/tasks/secondary_nic.yml b/roles/testnode/tasks/secondary_nic.yml index 08415081..84168621 100644 --- a/roles/testnode/tasks/secondary_nic.yml +++ b/roles/testnode/tasks/secondary_nic.yml @@ -51,7 +51,7 @@ - name: "Bounce {{ nic_to_configure }}" shell: "ifdown {{ nic_to_configure }} && ifup {{ nic_to_configure }}" when: - - wrote_network_config|changed + - wrote_network_config is changed - ansible_os_family == 'Debian' - name: "Write RHEL/CentOS network config for {{ nic_to_configure }}" @@ -76,5 +76,5 @@ - name: "Bounce {{ nic_to_configure }}" shell: "ifdown {{ nic_to_configure }} && ifup {{ nic_to_configure }}" when: - - wrote_network_config|changed + - wrote_network_config is changed - ansible_os_family == 'RedHat' diff --git a/roles/testnode/tasks/ssh.yml b/roles/testnode/tasks/ssh.yml index 81b7d2dd..a0f14550 100644 --- a/roles/testnode/tasks/ssh.yml +++ b/roles/testnode/tasks/ssh.yml @@ -23,7 +23,7 @@ key=https://raw.githubusercontent.com/ceph/keys/autogenerated/ssh/@all.pub # Register and retry to work around transient githubusercontent.com issues register: ssh_key_update - until: ssh_key_update|success + until: ssh_key_update is success # try for 2 minutes to retrieve the key before failing retries: 24 delay: 5 diff --git a/roles/testnode/tasks/user.yml b/roles/testnode/tasks/user.yml index cc127e80..ec83b9ae 100644 --- a/roles/testnode/tasks/user.yml +++ b/roles/testnode/tasks/user.yml @@ -28,7 +28,7 @@ - name: Delete the teuthology users password. command: "passwd -d {{ teuthology_user }}" when: teuthology_user_existence is defined and - teuthology_user_existence|changed + teuthology_user_existence is changed - name: Add a user for xfstests to test user quotas. user: diff --git a/roles/testnode/tasks/yum/repos.yml b/roles/testnode/tasks/yum/repos.yml index 3e9a25b6..9ca8b3ce 100644 --- a/roles/testnode/tasks/yum/repos.yml +++ b/roles/testnode/tasks/yum/repos.yml @@ -28,6 +28,6 @@ - name: Clean yum cache shell: yum clean all - when: (repo_file is defined and repo_file|changed) or - (gpg_keys is defined and gpg_keys|changed) or - (version_repo_file is defined and version_repo_file|changed) + when: (repo_file is defined and repo_file is changed) or + (gpg_keys is defined and gpg_keys is changed) or + (version_repo_file is defined and version_repo_file is changed) diff --git a/roles/users/tasks/update_keys.yml b/roles/users/tasks/update_keys.yml index b93cdb97..8b16fd6c 100644 --- a/roles/users/tasks/update_keys.yml +++ b/roles/users/tasks/update_keys.yml @@ -17,7 +17,7 @@ connection: local run_once: true register: clone_keys - until: clone_keys|success + until: clone_keys is success retries: 5 delay: 10 diff --git a/roles/vmhost/tasks/networking.yml b/roles/vmhost/tasks/networking.yml index db9baa14..a04b8b67 100644 --- a/roles/vmhost/tasks/networking.yml +++ b/roles/vmhost/tasks/networking.yml @@ -14,4 +14,4 @@ - name: Activate new network config shell: /sbin/ifdown -a; /sbin/ifup -a - when: interface_install|changed + when: interface_install is changed diff --git a/tools/set-bmc-static.yml b/tools/set-bmc-static.yml index ec223414..8919c3e8 100644 --- a/tools/set-bmc-static.yml +++ b/tools/set-bmc-static.yml @@ -107,20 +107,20 @@ shell: "ipmitool user set name {{ power_uid }} {{ power_user }}" when: - setup_user - - (set_username_locally is defined and set_username_locally|failed) + - (set_username_locally is defined and set_username_locally is failed) - name: Initial setup of permissions shell: "ipmitool channel setaccess {{ ipmi_channel_id }} {{ power_uid }} privilege=4" when: - setup_user - - (set_permissions_locally is defined and set_permissions_locally|failed) + - (set_permissions_locally is defined and set_permissions_locally is failed) - name: Initial setup of password shell: "ipmitool user set password {{ power_uid }} {{ power_pass }}" register: set_password_locally when: - setup_user - - (set_password_locally is defined and set_password_locally|failed) + - (set_password_locally is defined and set_password_locally is failed) ignore_errors: true - name: Set BMC to use DHCP via SSH @@ -128,7 +128,7 @@ register: set_to_dhcp_remotely when: - use_dhcp - - set_to_dhcp_locally|failed + - set_to_dhcp_locally is failed - name: Check existing network settings via SSH shell: "ipmitool lan print {{ ipmi_channel_id }} | grep 'IP Address Source\\|IP Address\\|Subnet Mask\\|Default Gateway IP\\|VLAN ID' | cut -d ':' -f2 | sed 's/^ //g'" @@ -208,6 +208,6 @@ shell: "ipmitool -I lanplus -U {{ power_user }} -P {{ power_pass }} -H {{ inventory_hostname_short }}.{{ ipmi_domain }} mc reset cold" delegate_to: localhost when: force_mc_reset or - (set_to_dhcp_locally is defined and set_to_dhcp_locally|changed) or - (set_to_dhcp_remotely is defined and set_to_dhcp_remotely|changed) or - (network_settings_change_required is defined and network_settings_change_required and not set_to_static|failed) + (set_to_dhcp_locally is defined and set_to_dhcp_locally is changed) or + (set_to_dhcp_remotely is defined and set_to_dhcp_remotely is changed) or + (network_settings_change_required is defined and network_settings_change_required and not set_to_static is failed) diff --git a/tools/update-nvme-firmware.yml b/tools/update-nvme-firmware.yml index 3ea205df..28480b0e 100644 --- a/tools/update-nvme-firmware.yml +++ b/tools/update-nvme-firmware.yml @@ -17,4 +17,4 @@ - name: Update firmware command: "isdct load -f -intelssd 0" - when: installed|changed + when: installed is changed