Ansible >= 2.2 supported

This commit is contained in:
Jérémy Lecour 2017-03-24 14:15:09 +01:00 committed by Jérémy Lecour
parent af2351486d
commit 5b2ab0d8d3
75 changed files with 134 additions and 134 deletions

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -5,8 +5,8 @@
register: uidisbusy
failed_when: False
changed_when: False
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
- name: Add Unix account with classical uid for '{{ user.name }}'
user:
@ -39,8 +39,8 @@
stat:
path: "/usr/share/scripts/evomaintenance.sh"
register: evomaintenance_script
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
- name: Add evomaintenance trap for '{{ user.name }}'
lineinfile:
@ -69,8 +69,8 @@
changed_when: False
failed_when: False
register: grep_allowusers_ssh
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
- name: Add AllowUsers sshd directive for '{{ user.name }}'
lineinfile:
@ -95,8 +95,8 @@
changed_when: False
failed_when: False
register: grep_matchuser_ssh
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
- name: Add Match User sshd directive for '{{ user.name }}'
lineinfile:

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -123,8 +123,8 @@
failed_when: False
changed_when: False
register: envvar_grep_umask
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
tags:
- apache

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -4,8 +4,8 @@
stat:
path: /etc/munin/plugins/
register: munin_plugins_dir
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
# https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/drbd/drbd
- name: Get Munin plugin

View File

@ -4,8 +4,8 @@
stat:
path: /usr/local/lib/nagios/plugins/
register: nagios_plugins_dir
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
- name: Check if /usr is a partition
shell: "mount | grep 'on /usr type'"
@ -14,8 +14,8 @@
changed_when: False
failed_when: False
register: usr_partition
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
- name: Mount /usr in rw
command: mount -o remount,rw /usr

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -7,7 +7,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -5,15 +5,15 @@
stat:
path: "{{ elasticsearch_custom_datadir }}"
register: elasticsearch_custom_datadir_test
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
- name: "read the real datadir"
command: readlink -f /var/lib/elasticsearch
changed_when: false
register: elasticsearch_current_real_datadir_test
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
tags:
- elasticsearch
when: elasticsearch_custom_datadir

View File

@ -5,8 +5,8 @@
register: fstab_tmp_noexec
failed_when: False
changed_when: False
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
- block:
- name: "Create {{ elasticsearch_custom_tmpdir or elasticsearch_default_tmpdir | mandatory }}"

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -47,8 +47,8 @@
changed_when: False
failed_when: False
register: git_log
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
- name: initial commit is present?
shell: "git add -A . && git commit -m \"Initial commit via Ansible\""

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -27,8 +27,8 @@
warn: no
changed_when: False
failed_when: False
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: usr_partition
- name: Mount /usr in rw

View File

@ -2,13 +2,13 @@
- name: Determine Nginx presence
stat:
path: /etc/nginx/nginx.conf
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: stn
- name: Determine Apache presence
stat:
path: /etc/apache2/apache2.conf
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: sta

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -53,8 +53,8 @@
- name: is Nginx installed?
stat:
path: /etc/nginx/sites-available
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: nginx_sites_available
- block:
@ -86,8 +86,8 @@
- name: is Apache installed?
stat:
path: /etc/apache2/sites-available
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: apache_sites_available
- block:

View File

@ -4,8 +4,8 @@
- name: Fetch fstab content
command: "grep -v '^#' /etc/fstab"
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: fstab_content
failed_when: False
changed_when: False

View File

@ -8,8 +8,8 @@
- name: Check if Broadcom NetXtreme II device is present
shell: "lspci | grep -q 'NetXtreme II'"
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: broadcom
failed_when: False
changed_when: False
@ -27,8 +27,8 @@
- name: Detect if RAID is installed
shell: lspci | grep "RAID bus controller" | grep -v Intel
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: raidmodel
changed_when: "'FAILED' in raidmodel.stdout"
failed_when: "'FAILED' in raidmodel.stdout"

View File

@ -62,8 +62,8 @@
- name: is an MTA installed?
command: "dpkg -S /usr/sbin/sendmail"
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: mta_installed
failed_when: False
changed_when: False

View File

@ -14,8 +14,8 @@
- name: fetch users list
shell: getent passwd | cut -d":" -f 1 | grep -v root
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: non_root_users_list
changed_when: False
tags:

View File

@ -44,8 +44,8 @@
- name: Is .bash_history append-only
shell: lsattr /root/.bash_history | grep -E "^.*a.* "
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: bash_history_append_only
failed_when: False
changed_when: False

View File

@ -3,8 +3,8 @@
command: "grep 'Match Address' /etc/ssh/sshd_config"
changed_when: False
failed_when: False
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: grep_matchaddress_ssh
- name: Add Match Address sshd directive

View File

@ -13,8 +13,8 @@
- name: list users with a shell
shell: "cat /etc/passwd | grep -vE \"^root:\" | grep -E \":/[^:]+sh$\" | cut -d: -f6"
changed_when: False
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: home_of_shell_users
- include: trap.yml home={{ item }}

View File

@ -1,8 +1,8 @@
- name: is {{ home }}/.bash_profile present?
stat:
path: "{{ home }}/.bash_profile"
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: bash_profile
- name: install shell trap in {{ home }}/.bash_profile
@ -16,8 +16,8 @@
- name: is {{ home }}/.profile present?
stat:
path: "{{ home }}/.profile"
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: profile
when: not bash_profile.stat.exists

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -20,14 +20,14 @@
- name: is logstash-plugin available?
stat:
path: /usr/share/logstash/bin/logstash-plugin
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: logstash_plugin
- name: is logstash-input-beats installed?
shell: grep logstash-input-beats /usr/share/logstash/Gemfile
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: logstash_plugin_installed
failed_when: false
changed_when: false
@ -40,8 +40,8 @@
warn: no
changed_when: False
failed_when: False
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: usr_partition
- name: Mount /usr in rw

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -7,8 +7,8 @@
warn: no
changed_when: False
failed_when: False
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: usr_partition
- name: Mount /usr in rw

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -4,8 +4,8 @@
shell: /sbin/iptables -L -n | grep -E "^(DROP\s+udp|ACCEPT\s+icmp)\s+--\s+0\.0\.0\.0\/0\s+0\.0\.0\.0\/0\s*$"
changed_when: False
failed_when: False
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: minifirewall_is_running
- debug:

View File

@ -12,8 +12,8 @@
- name: is init script present?
stat:
path: /etc/init.d/minifirewall
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: init_minifirewall
- name: init script is copied
@ -24,8 +24,8 @@
- name: is configuration present?
stat:
path: /etc/default/minifirewall
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: default_minifirewall
- name: configuration is copied

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -4,15 +4,15 @@
- name: "Is {{ mysql_custom_datadir }} present ?"
stat:
path: "{{ mysql_custom_datadir }}"
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: mysql_custom_datadir_test
- name: "read the real datadir"
command: readlink -f /var/lib/mysql
changed_when: False
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: mysql_current_real_datadir_test
tags:
- mysql

View File

@ -3,8 +3,8 @@
- name: Is log2mail present ?
stat:
path: /etc/log2mail/config
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: log2mail_config_dir
tags:
- mysql

View File

@ -3,8 +3,8 @@
- name: is Munin present ?
stat:
path: /etc/munin/plugin-conf.d/munin-node
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: munin_node_plugins_config
tags:
- mysql

View File

@ -3,8 +3,8 @@
- name: is NRPE present ?
stat:
path: /etc/nagios/nrpe.d/evolix.cfg
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: nrpe_evolix_config
tags:
- mysql

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -120,8 +120,8 @@
- name: Check if Munin is installed
stat:
path: /etc/munin/plugin-conf.d/munin-node
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: stat_munin_node
tags:
- nginx

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -9,8 +9,8 @@
- name: check if main.cf is default
shell: egrep -v "^(myhostname|mydestination|mailbox_command)" /etc/postfix/main.cf | md5sum -
changed_when: False
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: default_main_cf
- name: create minimal main.cf

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -80,7 +80,7 @@
become_user: "{{ username }}"
failed_when: False
changed_when: False
always_run: yes
register: ruby_installed
tags:
- rbenv
@ -95,7 +95,7 @@
- name: is Ruby {{ rbenv_ruby_version }} selected for {{ username }} ?
shell: /bin/bash -lc "rbenv version | cut -d ' ' -f 1 | grep -Fx '{{ rbenv_ruby_version }}'"
become_user: "{{ username }}"
always_run: yes
register: ruby_selected
changed_when: False
tags:

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -3,8 +3,8 @@
- name: is log2mail installed?
stat:
path: /etc/log2mail/config/
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: log2mail_config
- block:

View File

@ -2,8 +2,8 @@
- name: Check if Minifirewall is present
stat:
path: /etc/default/minifirewall
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: minifirewall_test
- block:

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -7,7 +7,7 @@
shell: id -ng "{{ tomcat_instance_port }}"
register: check_port_gid
changed_when: false
always_run: yes
failed_when:
- check_port_gid|success
- check_port_gid.stdout != "{{ tomcat_instance_name }}"
@ -15,7 +15,7 @@
- name: Check use of uid
shell: id -nu "{{ tomcat_instance_port }}"
register: check_port_uid
always_run: yes
changed_when: false
failed_when:
- check_port_uid|success

View File

@ -10,8 +10,8 @@
warn: no
changed_when: False
failed_when: False
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
check_mode: no
register: usr_partition
- name: Mount /usr in rw

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian

View File

@ -6,7 +6,7 @@ galaxy_info:
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.2
platforms:
- name: Debian