diff --git a/ansible_ppa/defaults/main.yml b/ansible_ppa/defaults/main.yml index fef4bdc0..bf7b02d9 100644 --- a/ansible_ppa/defaults/main.yml +++ b/ansible_ppa/defaults/main.yml @@ -5,8 +5,31 @@ ansible_cfg_file: /etc/ansible/ansible.cfg # options: smart, implicit, explicit. ansible_gathering: smart ansible_command_warnings: True -ansible_control_path: '%(directory)s/%%h-%%r' +ansible_control_path: '%(directory)s/ansible-ssh-%%h-%%p-%%r' # # Note: it breaks sudo if there's 'requiretty' inside the sudoers file ansible_pipelining: True -ansible_scp_if_ssh: True + +# Plugins base directory +ansible_plugins_base_dir: /usr/share/ansible/plugins +ansible_plugins_dirs: + - '{{ ansible_plugins_base_dir }}/action' + - '{{ ansible_plugins_base_dir }}/callback' + - '{{ ansible_plugins_base_dir }}/connection' + - '{{ ansible_plugins_base_dir }}/lookup' + - '{{ ansible_plugins_base_dir }}/vars' + - '{{ ansible_plugins_base_dir }}/filter' + - '{{ ansible_plugins_base_dir }}/test' + +ansible_config_options: + - { section: 'defaults', option: 'gathering', value: '{{ ansible_gathering }}', state: 'present' } + - { section: 'defaults', option: 'host_key_checking', value: False, state: 'present' } + - { section: 'defaults', option: 'command_warnings', value: '{{ ansible_command_warnings }}', state: 'present' } + - { section: 'defaults', option: 'control_path', value: '{{ ansible_control_path }}', state: 'present' } + - { section: 'defaults', option: 'ansible_managed', value: 'Ansible managed: {file} on {host}', state: 'present' } + - { section: 'defaults', option: 'bin_ansible_callbacks', value: False, state: 'present' } + - { section: 'defaults', option: 'fact_caching', value: 'memory', state: 'present' } + - { section: 'defaults', option: 'retry_files_enabled', value: True, state: 'present' } + - { section: 'defaults', option: 'retry_files_save_path', value: '~/.ansible_retry', state: 'present' } + - { section: 'ssh_connection', option: 'control_path', value: '{{ ansible_control_path }}', state: 'present' } + - { section: 'ssh_connection', option: 'pipelining', value: '{{ ansible_pipelining }}', state: 'present' } diff --git a/ansible_ppa/tasks/ansible-config.yml b/ansible_ppa/tasks/ansible-config.yml index 146eb334..c62c1ce7 100644 --- a/ansible_ppa/tasks/ansible-config.yml +++ b/ansible_ppa/tasks/ansible-config.yml @@ -1,32 +1,11 @@ --- -- name: Set the gather facts policy - action: configfile path={{ ansible_cfg_file }} key=gathering value='{{ ansible_gathering }}' - tags: - - ansible - - ansible_cfg - -- name: Warn if some shell commands can be avoided using modules - action: configfile path={{ ansible_cfg_file }} key=command_warning value='{{ ansible_command_warnings }}' - tags: - - ansible - - ansible_cfg - -- name: Shorten the ansible control path - action: configfile path={{ ansible_cfg_file }} key=control_path value='{{ ansible_control_path }}' - tags: - - ansible - - ansible_cfg - -- name: Be fast, use pipelining when possible - action: configfile path={{ ansible_cfg_file }} key=pipelining value='{{ ansible_pipelining }}' - tags: - - ansible - - ansible_cfg - -- name: Use scp instead of sftp to transfer files - action: configfile path={{ ansible_cfg_file }} key=scp_if_ssh value='{{ ansible_scp_if_ssh }}' - tags: - - ansible - - ansible_cfg - +- name: Set some ansible configuration parameters + ini_file: dest={{ ansible_cfg_file }} section={{ item.section }} option={{ item.option }} value={{ item.value }} + with_items: '{{ ansible_config_options }}' + tags: [ 'ansible', 'ansible_cfg' ] +- name: Create the ansible plugins directories + file: dest={{ item }} state=directory + with_items: '{{ ansible_plugins_dirs }}' + tags: [ 'ansible', 'ansible_cfg' ] + diff --git a/nagios/tasks/dell-omsa.yml b/nagios/tasks/dell-omsa.yml index 893b0d77..eae49ee9 100644 --- a/nagios/tasks/dell-omsa.yml +++ b/nagios/tasks/dell-omsa.yml @@ -37,7 +37,7 @@ - name: Install the Dell OMSA packages dependencies apt: pkg={{ item }} state=installed force=yes update_cache=yes - with_items: nagios_dell_omsa_deps + with_items: '{{ nagios_dell_omsa_deps }}' tags: [ 'dell', 'nagios' ] - name: Install other Dell OMSA packages dependencies @@ -81,13 +81,13 @@ - name: Install the Dell OMSA packages apt: pkg={{ item }} state={{ nagios_dell_omsa_pkg_state }} force=yes - with_items: nagios_dell_omsa_pkgs + with_items: '{{ nagios_dell_omsa_pkgs }}' notify: Start Dell OMSA tags: [ 'dell', 'nagios' ] - name: Install some standalone plugins copy: src={{ item }} dest={{ nagios_isti_plugdir }}/{{ item }} owner=root group=nagios mode=0750 - with_items: nagios_dell_standalone_checks + with_items: '{{ nagios_dell_standalone_checks }}' tags: [ 'dell', 'nagios' ] - name: Install a cron job that removes the leaked semaphores created by the nagios check of Dell hardware status diff --git a/nagios/tasks/hardware-checks.yml b/nagios/tasks/hardware-checks.yml index 84370f22..b392c2d1 100644 --- a/nagios/tasks/hardware-checks.yml +++ b/nagios/tasks/hardware-checks.yml @@ -3,7 +3,6 @@ - name: Install some plugins that check hardware parts copy: src={{ item }} dest={{ nagios_isti_plugdir }}/{{ item }} owner=root group=nagios mode=0750 with_items: - - check_linux_raid - check_smart tags: - nagios-hw diff --git a/nagios/tasks/nagios.yml b/nagios/tasks/nagios.yml index c47139ad..c805f387 100644 --- a/nagios/tasks/nagios.yml +++ b/nagios/tasks/nagios.yml @@ -1,13 +1,13 @@ --- - name: Install the nagios packages apt: pkg={{ item }} state=installed - with_items: nagios_plugins_base_pkgs + with_items: '{{ nagios_plugins_base_pkgs }}' when: is_not_debian_less_than_6 tags: nagios - name: debian 6 has additional nagios plugins apt: pkg={{ item }} state=installed - with_items: nagios_plugins_contrib + with_items: '{{ nagios_plugins_contrib }}' tags: [ 'nagios', 'nagios_plug_contrib' ] - name: Create the directory where our local plugins are installed