Updating Jinja filters to conform to Ansible 2.5+

Since Ansible 2.5, the use of jinja tests as filters has been deprecated.
I've run the script provided by the ansible team to 'fix' the jinja filters
to conform to the newer syntax.

This fixes the deprecation warnings.

This is a specific run of the script against active stein files, rather
than a cherry pick of 656767.

Change-Id: I33f486c4cc2990d270821d70c73e9654004e90e0
This commit is contained in:
Raimund Hook 2019-06-28 12:52:12 +01:00
parent ed3d1e37ff
commit 3f4d10614d
13 changed files with 117 additions and 118 deletions

View File

@ -36,7 +36,7 @@
command: "vgs {{ cinder_volume_group }}"
register: result
changed_when: false
failed_when: result | failed
failed_when: result is failed
when:
- enable_cinder | bool
- enable_cinder_backend_lvm | bool

View File

@ -160,7 +160,7 @@
changed_when: false
failed_when: >-
'169.254.' not in kolla_internal_vip_address and
(ip_addr_output | failed or
(ip_addr_output is failed or
kolla_internal_vip_address | ipaddr(ip_addr_output.stdout.split()[3]) is none)
when:
- enable_haproxy | bool

View File

@ -16,9 +16,9 @@
- kolla_action != "config"
- inventory_hostname in groups[service.group]
- service.enabled | bool
- horizon_config_json | changed
or horizon_conf | changed
or horizon_local_settings | changed
or horizon_custom_local_settings | changed
or policy_jsons | changed
or check_horizon_container | changed
- horizon_config_json is changed
or horizon_conf is changed
or horizon_local_settings is changed
or horizon_custom_local_settings is changed
or policy_jsons is changed
or check_horizon_container is changed

View File

@ -47,4 +47,4 @@
local_action: command awk '/^fernet_token_expiry/ { print $2 }' "{{ node_config }}/globals.yml"
register: result
changed_when: false
failed_when: result.stdout | regex_replace('(60|120|180|240|300|360|600|720|900|1200|1800|3600|7200|10800|14400|21600|28800|43200|86400|604800)', '') | search(".+")
failed_when: result.stdout | regex_replace('(60|120|180|240|300|360|600|720|900|1200|1800|3600|7200|10800|14400|21600|28800|43200|86400|604800)', '') is search(".+")

View File

@ -23,7 +23,7 @@
local_action: copy content={{ ansible_hostname }} dest=/tmp/kolla_mariadb_cluster mode=0644
changed_when: False
check_mode: no
when: not mariadb_volume | changed
when: mariadb_volume is not changed
- name: Registering host from temp file
set_fact:

View File

@ -23,14 +23,14 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_lbaas_conf | changed
or neutron_vpnaas_conf | changed
or neutron_ml2_conf | changed
or nsx_ini | changed
or policy_json | changed
or neutron_server_container | changed
- config_json is changed
or neutron_conf is changed
or neutron_lbaas_conf is changed
or neutron_vpnaas_conf is changed
or neutron_ml2_conf is changed
or nsx_ini is changed
or policy_json is changed
or neutron_server_container is changed
- name: Restart neutron-openvswitch-agent container
vars:
@ -54,11 +54,11 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_ml2_conf | changed
or policy_json | changed
or neutron_openvswitch_agent_container | changed
- config_json is changed
or neutron_conf is changed
or neutron_ml2_conf is changed
or policy_json is changed
or neutron_openvswitch_agent_container is changed
- name: Restart neutron-openvswitch-agent-xenapi container
vars:
@ -82,11 +82,11 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_ml2_xenapi_conf | changed
or policy_json | changed
or neutron_openvswitch_agent_xenapi_container | changed
- config_json is changed
or neutron_conf is changed
or neutron_ml2_xenapi_conf is changed
or policy_json is changed
or neutron_openvswitch_agent_xenapi_container is changed
- name: Restart fake neutron-openvswitch-agent container
vars:
@ -112,10 +112,10 @@
- enable_nova_fake | bool
- neutron_plugin_agent == "openvswitch"
- inventory_hostname in groups["compute"]
- fake_config_json | changed
or fake_neutron_conf | changed
or fake_neutron_ml2_conf_ini | changed
or check_fake_neutron_openvswitch_agent | changed
- fake_config_json is changed
or fake_neutron_conf is changed
or fake_neutron_ml2_conf_ini is changed
or check_fake_neutron_openvswitch_agent is changed
- name: Restart neutron-linuxbridge-agent container
vars:
@ -140,11 +140,11 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_ml2_conf | changed
or policy_json | changed
or neutron_linuxbridge_agent_container | changed
- config_json is changed
or neutron_conf is changed
or neutron_ml2_conf is changed
or policy_json is changed
or neutron_linuxbridge_agent_container is changed
- name: Restart neutron-dhcp-agent container
vars:
@ -167,12 +167,12 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or dhcp_agent_ini | changed
or dnsmasq_conf | changed
or policy_json | changed
or neutron_dhcp_agent_container | changed
- config_json is changed
or neutron_conf is changed
or dhcp_agent_ini is changed
or dnsmasq_conf is changed
or policy_json is changed
or neutron_dhcp_agent_container is changed
- name: Restart neutron-l3-agent container
vars:
@ -199,14 +199,14 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_l3_agent_ini | changed
or neutron_fwaas_driver_ini | changed
or neutron_vpnaas_conf | changed
or policy_json | changed
or neutron_l3_agent_wrapper | changed
or neutron_l3_agent_container | changed
- config_json is changed
or neutron_conf is changed
or neutron_l3_agent_ini is changed
or neutron_fwaas_driver_ini is changed
or neutron_vpnaas_conf is changed
or policy_json is changed
or neutron_l3_agent_wrapper is changed
or neutron_l3_agent_container is changed
- name: Restart neutron-lbaas-agent container
vars:
@ -230,12 +230,12 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_lbaas_conf | changed
or neutron_lbaas_agent_ini | changed
or policy_json | changed
or neutron_lbaas_agent_container | changed
- config_json is changed
or neutron_conf is changed
or neutron_lbaas_conf is changed
or neutron_lbaas_agent_ini is changed
or policy_json is changed
or neutron_lbaas_agent_container is changed
- name: Restart neutron-sriov-agent container
vars:
@ -258,11 +258,11 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_sriov_agent_ini | changed
or policy_json | changed
or neutron_sriov_agent_container | changed
- config_json is changed
or neutron_conf is changed
or neutron_sriov_agent_ini is changed
or policy_json is changed
or neutron_sriov_agent_container is changed
- name: Restart neutron-metadata-agent container
vars:
@ -285,11 +285,11 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_metadata_agent_ini | changed
or policy_json | changed
or neutron_metadata_agent_container | changed
- config_json is changed
or neutron_conf is changed
or neutron_metadata_agent_ini is changed
or policy_json is changed
or neutron_metadata_agent_container is changed
- name: Restart neutron-bgp-dragent container
vars:
@ -312,11 +312,11 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_bgp_dragent_ini | changed
or policy_json | changed
or neutron_bgp_dragent_container | changed
- config_json is changed
or neutron_conf is changed
or neutron_bgp_dragent_ini is changed
or policy_json is changed
or neutron_bgp_dragent_container is changed
- name: Restart neutron-infoblox-ipam-agent container
vars:
@ -339,10 +339,10 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_ml2_conf | changed
or neutron_infoblox_ipam_agent_container | changed
- config_json is changed
or neutron_conf is changed
or neutron_ml2_conf is changed
or neutron_infoblox_ipam_agent_container is changed
- name: Restart neutron-metering-agent container
vars:
@ -364,10 +364,10 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_metering_agent_ini | changed
or neutron_metering_agent_container | changed
- config_json is changed
or neutron_conf is changed
or neutron_metering_agent_ini is changed
or neutron_metering_agent_container is changed
- name: Restart ironic-neutron-agent container
vars:
@ -390,7 +390,7 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or ironic_neutron_agent_ini | changed
or ironic_neutron_agent_container | changed
- config_json is changed
or neutron_conf is changed
or ironic_neutron_agent_ini is changed
or ironic_neutron_agent_container is changed

View File

@ -17,19 +17,19 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- opendaylight_config_json | changed
or opendaylight_config_start_odl | changed
or opendaylight_config_custom_props | changed
or opendaylight_config_jetty | changed
or opendaylight_config_features | changed
or opendaylight_config_ovsdb | changed
or opendaylight_config_tomcat | changed
or opendaylight_config_logging | changed
or opendaylight_config_netvirt | changed
or opendaylight_config_netvirt_acl | changed
or opendaylight_config_env | changed
or opendaylight_config_akka | changed
or opendaylight_config_modules | changed
or opendaylight_config_module_shards | changed
or opendaylight_config_10_rest_connector | changed
or check_opendaylight_containers | changed
- opendaylight_config_json is changed
or opendaylight_config_start_odl is changed
or opendaylight_config_custom_props is changed
or opendaylight_config_jetty is changed
or opendaylight_config_features is changed
or opendaylight_config_ovsdb is changed
or opendaylight_config_tomcat is changed
or opendaylight_config_logging is changed
or opendaylight_config_netvirt is changed
or opendaylight_config_netvirt_acl is changed
or opendaylight_config_env is changed
or opendaylight_config_akka is changed
or opendaylight_config_modules is changed
or opendaylight_config_module_shards is changed
or opendaylight_config_10_rest_connector is changed
or check_opendaylight_containers is changed

View File

@ -17,9 +17,9 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or openvswitch_db_container | changed
or openvswitch_start_ovsdb_server | changed
- config_json is changed
or openvswitch_db_container is changed
or openvswitch_start_ovsdb_server is changed
notify:
- Waiting for openvswitch_db service to be ready
@ -50,6 +50,6 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or openvswitch_vswitchd_container | changed
or openvswitch_start_ovs | changed
- config_json is changed
or openvswitch_vswitchd_container is changed
or openvswitch_start_ovs is changed

View File

@ -17,8 +17,8 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or ovsdpdk_db_container | changed
- config_json is changed
or ovsdpdk_db_container is changed
notify:
- Waiting the ovs db service to be ready
- Ensuring ovsdpdk bridges are properly setup indexed
@ -72,8 +72,8 @@
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or ovsdpdk_vswitchd_container | changed
- config_json is changed
or ovsdpdk_vswitchd_container is changed
- name: Ensuring ovsdpdk bridges are properly setup named
vars:

View File

@ -4,10 +4,9 @@
register: result
changed_when: false
when: inventory_hostname in groups['baremetal']
failed_when: result | failed or
result.stdout | version_compare(docker_py_version_min, '<')
failed_when: result is failed or result.stdout is version(docker_py_version_min, '<')
- name: Checking Ansible version
local_action: fail msg="Current Ansible version {{ ansible_version.full }} is less than {{ ansible_version_min }}"
run_once: true
when: ansible_version.full | version_compare(ansible_version_min, '<')
when: ansible_version.full is version(ansible_version_min, '<')

View File

@ -4,8 +4,8 @@
register: result
changed_when: false
when: inventory_hostname in groups['baremetal']
failed_when: result | failed
or result.stdout | regex_replace('.*(\\d+\\.\\d+\\.\\d+).*', '\\1') | version_compare(docker_version_min, '<')
failed_when: result is failed
or result.stdout | regex_replace('.*(\\d+\\.\\d+\\.\\d+).*', '\\1') is version(docker_version_min, '<')
# NOTE(mgoddard): If passwords.yml is encrypted using ansible-vault, this check
# will pass, but only because nothing in the vault file has the format of a
@ -15,7 +15,7 @@
run_once: True
register: result
changed_when: false
failed_when: result.stdout | regex_replace('(.*ssh_key.*)', '') | search(":")
failed_when: result.stdout | regex_replace('(.*ssh_key.*)', '') is search(":")
- name: Check if nscd is running
command: pgrep nscd

View File

@ -15,5 +15,5 @@
shell: "true"
become: yes
register: result
failed_when: result | failed
failed_when: result is failed
changed_when: False

View File

@ -23,4 +23,4 @@
name: "{{ project_name }}_bootstrap"
restart_policy: "never"
volumes: "{{ service.volumes }}"
when: rabbitmq_volume | changed
when: rabbitmq_volume is changed