Change all instances of ansible_distribution_major_version to filter to int for comparisons.

This commit is contained in:
Kevin Fenzi 2015-05-27 22:27:39 +00:00
parent 03633c8f0c
commit 275f4b5203
50 changed files with 74 additions and 74 deletions

View file

@ -85,11 +85,11 @@
action: service name=openvpn@openvpn state=restarted
- name: restart openvpn (RHEL6)
when: ansible_distribution == "RedHat" and ansible_distribution_major_version == "6"
when: ansible_distribution == "RedHat" and ansible_distribution_major_version|int == 6
action: service name=openvpn state=restarted
- name: restart openvpn (RHEL7)
when: ansible_distribution == "RedHat" and ansible_distribution_major_version == "7"
when: ansible_distribution == "RedHat" and ansible_distribution_major_version|int == 7
action: service name=openvpn@openvpn state=restarted
- name: restart postfix

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -17,7 +17,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -27,7 +27,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -27,7 +27,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -29,7 +29,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -45,14 +45,14 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client
- collectd/base
- apache
- download
- { role: mod_limitipconn, when: ansible_distribution_major_version != '7'}
- { role: mod_limitipconn, when: ansible_distribution_major_version|int != '7'}
- rsyncd
- { role: nfs/client, when: datacenter == "phx2", mnt_dir: '/srv/pub', nfs_src_dir: 'fedora_ftp/fedora.redhat.com/pub' }
- { role: nfs/client, when: datacenter == "rdu", mnt_dir: '/srv/pub', nfs_src_dir: 'fedora_ftp/fedora.redhat.com/pub' }

View file

@ -27,7 +27,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -30,7 +30,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- fas_client
- nagios_client
- hosts

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- collectd/base
- hosts

View file

@ -58,7 +58,7 @@
- java-1.8.0-openjdk
tags:
- packages
when: ansible_distribution_major_version != '7'
when: ansible_distribution_major_version|int != 7
- name: add jenkins proxy config file for apache
action: copy src="{{ files }}/jenkins/master/jenkins-apache.conf"
@ -406,7 +406,7 @@
- name: install pkgs for jenkins for fedora systems > F19
action: yum state=present pkg={{ item }}
when: is_fedora is defined and ansible_distribution_major_version > 20
when: is_fedora is defined and ansible_distribution_major_version|int > 20
with_items:
- sbt-extras

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -31,7 +31,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -33,7 +33,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- fas_client
- nagios_client
- hosts

View file

@ -27,7 +27,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- hosts
- fas_client
- nagios_client

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -39,7 +39,7 @@
- rkhunter
- rsyncd
- sudo
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- { role: openvpn/client, when: env != "staging" }
- { role: collectd/fedmsg-service, process: fedmsg-hub }
- apache

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -27,7 +27,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- fas_client
- collectd/base

View file

@ -33,7 +33,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- fas_client
- nagios_client
- hosts

View file

@ -14,7 +14,7 @@
- hosts
- fas_client
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- sudo
- fedmsg/base

View file

@ -29,7 +29,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- collectd/base
- hosts

View file

@ -32,7 +32,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -15,7 +15,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -13,7 +13,7 @@
roles:
- base
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version != '7' }
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
- hosts
- fas_client

View file

@ -56,11 +56,11 @@
tasks:
- name: install cloud-utils (yum)
yum: pkg=cloud-utils state=present
when: ansible_distribution_major_version < '22'
when: ansible_distribution_major_version|int < 22
- name: install cloud-utils (dnf)
command: dnf install -y cloud-utils
when: ansible_distribution_major_version > '21' and ansible_cmdline.ostree is not defined
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
- include: "{{ tasks }}/cloud_setup_basic.yml"

View file

@ -31,7 +31,7 @@
- name: hotfix - copy over new httpd sysconfig (el6)
copy: src="{{ files }}/hotfix/httpd/httpd.sysconfig" dest=/etc/sysconfig/httpd
when: ansible_distribution_major_version == '6'
when: ansible_distribution_major_version|int == 6
notify:
- restart apache
tags:
@ -41,7 +41,7 @@
- name: hotfix - copy over new httpd sysconfig (el7)
copy: src="{{ files }}/hotfix/httpd/httpd.sysconfig" dest=/etc/sysconfig/httpd
when: ansible_distribution_major_version == '7'
when: ansible_distribution_major_version|int == 7
notify:
- restart apache
tags:

View file

@ -27,11 +27,11 @@
- packages
- base
- debug: msg="{{ansible_nodename}} {{inventory_hostname}} {{ansible_distribution_major_version}}"
- debug: msg="{{ansible_nodename}} {{inventory_hostname}} {{ansible_distribution_major_version|int}}"
- name: make sure hostname is set right on rhel7 hosts
command: hostnamectl set-hostname {{ inventory_hostname }}
when: ( ansible_nodename != inventory_hostname ) and ansible_distribution_major_version == '7'
when: ( ansible_nodename != inventory_hostname ) and ansible_distribution_major_version|int == 7
- name: sshd_config
copy: src={{ item }} dest=/etc/ssh/sshd_config mode=600

View file

@ -16,7 +16,7 @@
- virt-install
tags:
- packages
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 7
# install libvirtd.conf
#
@ -45,7 +45,7 @@
- restart bridge
tags:
- config
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 7
- name: generate config for ethernet device
template:

View file

@ -97,7 +97,7 @@
- name: copy over our pstorefs/collectd selinux module (rhel6 has no pstorefs)
copy: src=selinux/fi-pstorefs.pp dest=/usr/share/collectd/fi-pstorefs.pp
when: ansible_distribution_major_version != '6'
when: ansible_distribution_major_version|int != 6
register: ficpstorefs_module
tags:
- collectd
@ -105,7 +105,7 @@
- name: check to see if its even installed yet
shell: semodule -l | grep fi-pstorefs | wc -l
when: ansible_distribution_major_version != '6'
when: ansible_distribution_major_version|int != 6
register: ficpstorefs_grep
always_run: true
changed_when: "'0' in ficpstorefs_grep.stdout"
@ -115,7 +115,7 @@
- name: install our pstorefs/collectd selinux module
command: semodule -i /usr/share/collectd/fi-pstorefs.pp
when: ansible_distribution_major_version != '6' and (ficpstorefs_module|changed or ficpstorefs_grep|changed)
when: ansible_distribution_major_version|int != 6 and (ficpstorefs_module|changed or ficpstorefs_grep|changed)
tags:
- collectd
- selinux

View file

@ -19,7 +19,7 @@
- name: install nss_db on rhel hosts only
yum: state=present name=nss_db
when: is_rhel is defined and ansible_distribution_major_version == '6'
when: is_rhel is defined and ansible_distribution_major_version|int == 6
tags:
- packages
- fas_client

View file

@ -24,7 +24,7 @@
owner=fedmsg
group=fedmsg
state=directory
when: ansible_distribution_major_version == '6'
when: ansible_distribution_major_version|int == 6
tags:
- fedmsg/base

View file

@ -7,25 +7,25 @@
# If NOT using xinetd
- name: delete stock git daemon config
file: path="/usr/lib/systemd/system/git.service" state=absent
when: ansible_distribution_major_version == '7'
when: ansible_distribution_major_version|int == 7
- name: configure git daemon
template: >
src="git@.service.j2"
dest="/usr/lib/systemd/system/git@.service"
mode=0644
when: ansible_distribution_major_version == '7'
when: ansible_distribution_major_version|int == 7
# If using xinetd
- name: install xinetd
yum: pkg=xinetd state=present
when: ansible_distribution_major_version == '6'
when: ansible_distribution_major_version|int == 6
- name: install the xinetd config file
template: >
src="git.j2"
dest="/etc/xinetd.d/git"
mode=0644
when: ansible_distribution_major_version == '6'
when: ansible_distribution_major_version|int == 6
notify:
- restart xinetd

View file

@ -231,7 +231,7 @@
register: max_loop
always_run: yes
changed_when: '1 != 1'
when: ansible_distribution_major_version != '6' and ansible_architecture == 'x86_64'
when: ansible_distribution_major_version|int != 6 and ansible_architecture == 'x86_64'
tags:
- koji_builder
@ -240,7 +240,7 @@
register: max_loop
always_run: yes
changed_when: '1 != 1'
when: ansible_distribution == 'RedHat' and ansible_architecture == 'x86_64' and ansible_distribution_major_version == '6'
when: ansible_distribution == 'RedHat' and ansible_architecture == 'x86_64' and ansible_distribution_major_version|int == 6
tags:
- koji_builder
@ -259,7 +259,7 @@
yum: state=present pkg={{ item }}
with_items:
- kmod-hfsplus
when: is_rhel is defined and ansible_architecture == 'x86_64' and ansible_distribution_major_version == '6'
when: is_rhel is defined and ansible_architecture == 'x86_64' and ansible_distribution_major_version|int == '6'
tags:
- koji_builder

View file

@ -235,14 +235,14 @@
tags:
- selinux
- koji_hub
when: ansible_distribution == "RedHat" and ansible_distribution_major_version == "6"
when: ansible_distribution == "RedHat" and ansible_distribution_major_version|int == 6
- name: set sebooleans so koji can anon write
seboolean: name=httpd_anon_write state=true persistent=true
tags:
- selinux
- koji_hub
when: ansible_distribution == "RedHat" and ansible_distribution_major_version == "7"
when: ansible_distribution == "RedHat" and ansible_distribution_major_version|int == 7
- name: Set httpd to run on boot
service: name=httpd enabled=yes

View file

@ -24,7 +24,7 @@
file: state=directory path=/etc/systemd/system/memcached.service.d mode=0755 owner=root group=root
tags:
- memcached
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 7
- name: make systemd override config
copy: src=memcached-systemdoverride.conf dest=/etc/systemd/system/memcached.service.d/
@ -32,4 +32,4 @@
- memcached
notify:
- reload systemd
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 7

View file

@ -58,7 +58,7 @@
- name: install our custom selinux module
command: semodule -i /usr/share/nrpe/fi-nrpe.pp
when: ansible_distribution_major_version == '7' and selinux_module|changed
when: ansible_distribution_major_version|int == 7 and selinux_module|changed
# Set up our base config.

View file

@ -30,14 +30,14 @@
with_items:
- rpcbind
- nfs-lock
when: ansible_distribution == 'Fedora' and ansible_distribution_major_version == '20'
when: ansible_distribution == 'Fedora' and ansible_distribution_major_version|int == 20
- name: enable nfs-related services and run them (rhel7)
service: name={{ item }} enabled=true state=started
with_items:
- rpcbind
- nfs-lock
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 7
- name: enable nfs-related services and run them (rhel6)
action: service name={{ item }} enabled=true state=started
@ -46,7 +46,7 @@
- rpcbind
- nfs
- nfslock
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '6'
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 6
- name: nfs mount points (phx2)
mount: >

View file

@ -33,14 +33,14 @@
- name: enable openvpn service for rhel 6
service: name=openvpn state=running enabled=true
when: ansible_distribution_major_version == '6'
when: ansible_distribution_major_version|int == 6
tags:
- service
- openvpn
- name: Make sure openvpn is running in rhel 7.1
service: name=openvpn@openvpn state=running enabled=true
when: ansible_distribution_major_version == '7'
when: ansible_distribution_major_version|int == 7
tags:
- service
- openvpn

View file

@ -7,7 +7,7 @@
- ntp
- libsemanage-python
- libselinux-python
when: ansible_distribution_major_version < '22'
when: ansible_distribution_major_version|int < 22
tags:
- packages
@ -56,14 +56,14 @@
- name: update all
command: yum -y update creates=/etc/sysconfig/global-update-applied
register: updated
when: ansible_distribution_major_version < '22'
when: ansible_distribution_major_version|int < 22
tags:
- packages
- name: update all
command: dnf -y update creates=/etc/sysconfig/global-update-applied
register: updated
when: ansible_distribution_major_version > '21' and ansible_cmdline.ostree is not defined
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
tags:
- packages

View file

@ -12,7 +12,7 @@
- python-virtinst
tags:
- packages
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '6'
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 6
- name: install libvirt packages on rhel7 virthosts
yum: pkg={{ item }} state=present
@ -22,7 +22,7 @@
- virt-install
tags:
- packages
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 7
# install libvirtd.conf
#
@ -50,4 +50,4 @@
- restart bridge
tags:
- config
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 7

View file

@ -4,7 +4,7 @@
with_items:
- epel6.repo
- rhel6.repo
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '6'
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 6
tags:
- config
- packages
@ -15,7 +15,7 @@
with_items:
- epel7.repo
- rhel7.repo
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 7
tags:
- config
- packages