Commit 7d13eeb8 authored by Matthew Smith's avatar Matthew Smith
Browse files

Initial commit

parents
# Ansible vault can be used to encrypt the key and recent versions of ansible will auto decrypt them
icinga2_plugins_repos: []
# - key_name: my_icinga_plugins
# key_source: /etc/ansible/files/keys
# key_destination: /root/.ssh
# git_repo: ssh://git@gitlab.example.net/MY/icinga-plugins.git
# git_destination: /usr/lib/nagios/plugins/my
---
- name: "Vars for {{ ansible_os_family }} {{ ansible_distribution }} {{ ansible_distribution_major_version }}"
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- "main.yml"
- name: install packages for icinga2 plugins
package:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- "{{ icinga2_plugin_packages }}"
- "{{ check_pve_packages }}"
tags:
- repo
- name: copy private key
copy:
src: "{{ item.key_source }}/{{ item.key_name }}"
dest: "{{ item.key_destination }}/{{ item.key_name }}"
mode: 0600
loop: "{{ icinga2_plugins_repos }}"
tags:
- repo
- name: copy public key
copy:
src: "{{ item.key_source }}/{{ item.key_name }}.pub"
dest: "{{ item.key_destination }}/{{ item.key_name }}.pub"
mode: 0600
loop: "{{ icinga2_plugins_repos }}"
tags:
- repo
- name: update sol1 git repo
git:
repo: "{{ item.git_repo}}"
dest: "{{ item.git_destination }}/"
accept_hostkey: yes
key_file: "{{ item.key_destination }}/{{ item.key_name }}"
force: no
loop: "{{ icinga2_plugins_repos }}"
tags:
- update
- repo
icinga2_plugin_packages:
- git
- monitoring-plugins-standard
- monitoring-plugins-common
- ca-certificates
check_pve_packages:
- python-enum34
- python-requests
icinga2_plugin_packages:
- git
- nagios-plugins-contrib
- nagios-plugins-common
- ca-certificates
check_pve_packages:
- python-enum34
- python-requests
icinga2_plugin_packages:
- git
- nagios-plugins
- ca-certificates
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment