Use version test instead of version_compare
This filter was changed to 'version' in ansible 2.5 [1]. Some jinja expressions are also converted to use ansible filters. [1] https://docs.ansible.com/ansible/2.8/user_guide/playbooks_tests.html#version-comparison Change-Id: I91c23b1f138adae6951421d0edc3a94680e2c126
This commit is contained in:
parent
2bcd7469a6
commit
907799018a
|
@ -20,7 +20,7 @@
|
|||
[ {{ ansible_kernel }} < {{ openstack_host_required_kernel }} ]
|
||||
Resolve this issue before continuing.
|
||||
when:
|
||||
- ansible_kernel is version_compare(openstack_host_required_kernel, '<')
|
||||
- ansible_kernel is version(openstack_host_required_kernel, '<')
|
||||
|
||||
- name: Install distro packages for bare metal nodes
|
||||
package:
|
||||
|
|
|
@ -40,8 +40,8 @@ openstack_host_kernel_modules:
|
|||
- name: nbd
|
||||
- name: nf_conntrack
|
||||
# NOTE(mnaser): 4.19 kernel merged nf_conntrack_ipv{4,6} into nf_conntrack
|
||||
- name: "{% if hostvars[inventory_hostname]['ansible_kernel'] | version_compare('4.19.0', '<=') %}nf_conntrack_ipv4{% endif %}"
|
||||
- name: "{% if hostvars[inventory_hostname]['ansible_kernel'] | version_compare('4.19.0', '<=') %}nf_conntrack_ipv6{% endif %}"
|
||||
- name: "{{ (hostvars[inventory_hostname]['ansible_kernel'] is version('4.19.0', '<=')) | ternary('nf_conntrack_ipv4', '') }}"
|
||||
- name: "{{ (hostvars[inventory_hostname]['ansible_kernel'] is version('4.19.0', '<=')) | ternary('nf_conntrack_ipv6', '') }}"
|
||||
- name: nf_defrag_ipv4
|
||||
- name: nf_nat
|
||||
- name: nf_nat_ipv4
|
||||
|
|
|
@ -25,7 +25,7 @@ openstack_host_sysstat_cron_mode: '0644'
|
|||
## Kernel modules loaded on hosts
|
||||
openstack_host_kernel_modules:
|
||||
- name: 8021q
|
||||
- name: "{% if hostvars[inventory_hostname]['ansible_kernel'] | version_compare('4.4', '>=') %}br_netfilter{% endif %}"
|
||||
- name: "{{ (hostvars[inventory_hostname]['ansible_kernel'] is version('4.4', '>=')) | ternary('br_netfilter', '') }}"
|
||||
- name: dm_multipath
|
||||
- name: dm_snapshot
|
||||
- name: ebtables
|
||||
|
@ -47,7 +47,7 @@ openstack_host_kernel_modules:
|
|||
- name: nf_nat_ipv4
|
||||
# TODO (odyssey4me): revise the minimum kernel version once this kernel version is commonplace
|
||||
# If we end up with more requirements like this, then we should change the approach.
|
||||
- name: "{% if hostvars[inventory_hostname]['ansible_kernel'] | version_compare('4.4.0-0', '<') %}scsi_dh{% endif %}"
|
||||
- name: "{{ (hostvars[inventory_hostname]['ansible_kernel'] is version('4.4.0-0', '<')) | ternary('scsi_dh', '') }}"
|
||||
- name: vhost_net
|
||||
- name: x_tables
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ openstack_host_sysstat_cron_mode: '0600'
|
|||
## Kernel modules loaded on hosts
|
||||
openstack_host_kernel_modules:
|
||||
- name: 8021q
|
||||
- name: "{% if hostvars[inventory_hostname]['ansible_kernel'] | version_compare('3.10.0-514', '>=') %}br_netfilter{% endif %}"
|
||||
- name: "{{ (hostvars[inventory_hostname]['ansible_kernel'] is version('3.10.0-514', '>=')) | ternary('br_netfilter', '') }}"
|
||||
- name: dm_multipath
|
||||
- name: dm_snapshot
|
||||
- name: ebtables
|
||||
|
@ -40,8 +40,8 @@ openstack_host_kernel_modules:
|
|||
- name: ip_vs
|
||||
- name: iscsi_tcp
|
||||
- name: nf_conntrack
|
||||
- name: "{% if hostvars[inventory_hostname]['ansible_kernel'] | version_compare('4.19', '<=') %}nf_conntrack_ipv4{% endif %}"
|
||||
- name: "{% if hostvars[inventory_hostname]['ansible_kernel'] | version_compare('4.19', '<=') %}nf_conntrack_ipv6{% endif %}"
|
||||
- name: "{{ (hostvars[inventory_hostname]['ansible_kernel'] is version('4.19', '<=')) | ternary('nf_conntrack_ipv4' ,'') }}"
|
||||
- name: "{{ (hostvars[inventory_hostname]['ansible_kernel'] is version('4.19', '<=')) | ternary('nf_conntrack_ipv6' ,'') }}"
|
||||
- name: nf_defrag_ipv4
|
||||
- name: nf_nat
|
||||
- name: nf_nat_ipv4
|
||||
|
|
|
@ -30,7 +30,7 @@ openstack_host_sysstat_cron_mode: '0644'
|
|||
## Kernel modules loaded on hosts
|
||||
openstack_host_kernel_modules:
|
||||
- name: 8021q
|
||||
- name: "{% if hostvars[inventory_hostname]['ansible_kernel'] | version_compare('4.4', '>=') %}br_netfilter{% endif %}"
|
||||
- name: "{{ (hostvars[inventory_hostname]['ansible_kernel'] is version('4.4', '>=')) | ternary('br_netfilter', '') }}"
|
||||
- name: dm_multipath
|
||||
- name: dm_snapshot
|
||||
- name: ebtables
|
||||
|
@ -52,7 +52,7 @@ openstack_host_kernel_modules:
|
|||
- name: nf_nat_ipv4
|
||||
# TODO (odyssey4me): revise the minimum kernel version once this kernel version is commonplace
|
||||
# If we end up with more requirements like this, then we should change the approach.
|
||||
- name: "{% if hostvars[inventory_hostname]['ansible_kernel'] | version_compare('4.4.0-0', '<') %}scsi_dh{% endif %}"
|
||||
- name: "{{ (hostvars[inventory_hostname]['ansible_kernel'] is version('4.4.0-0', '<')) | ternary('scsi_dh', '') }}"
|
||||
- name: vhost_net
|
||||
- name: x_tables
|
||||
|
||||
|
|
Loading…
Reference in New Issue