Skip to content

Instantly share code, notes, and snippets.

@Tokugero
Created April 16, 2019 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tokugero/f5ee0d90b542b06840cf1dcb314e97eb to your computer and use it in GitHub Desktop.
Save Tokugero/f5ee0d90b542b06840cf1dcb314e97eb to your computer and use it in GitHub Desktop.
---
- hosts: virtuals
become: yes
become_user: root
become_method: su
tasks:
- name: Install sudo
apt:
name: sudo
state: present
- name: Add group wheel
group:
name: wheel
state: present
- name: Add tokugero to wheel
user:
name: tokugero
groups: wheel
append: yes
- name: Check sudo perms
lineinfile:
path: /etc/sudoers
state: present
regexp: '^%wheel\s'
line: '%wheel ALL=(ALL) NOPASSWD: ALL'
- name: apt-get udpate
apt:
update_cache: yes
- name: apt-get upgrade
apt:
upgrade: yes
- name: Install apt-transport-https
apt:
name: apt-transport-https
state: present
- name: Install screen
apt:
name: screen
state: present
- name: Install vim
apt:
name: vim
state: present
- name: Install nagios-nrpe-server
apt:
name: nagios-nrpe-server
state: present
- name: Install nagios-nrpe-plugin
apt:
name: nagios-nrpe-plugin
state: present
- name: Install ntp
apt:
name: ntp
state: present
- name: Install net-tools
apt:
name: net-tools
state: present
- name: Install pip
apt:
name: python-pip
state: present
- name: Install git
apt:
name: git
state: present
- name: Install curl
apt:
name: curl
state: present
- name: Update NRPE.cfg
copy:
src: /etc/ansible/group_vars/virtuals/nrpe.cfg
dest: /etc/nagios/nrpe.cfg
owner: nagios
group: nagios
mode: 0644
- name: Restart nrpe
systemd:
name: nagios-nrpe-server
state: restarted
- name: Add telegraf source
copy:
src: /etc/ansible/roles/all/files/telegraf/telegraf.source
dest: /etc/apt/sources.list.d/influxdata.list
owner: root
group: root
mode: 0644
- name: Update telegraf secure key
shell: curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
- name: Telegraf apt-get update_cache
apt:
update_cache: yes
- name: Telegraf apt-get install telegraf
apt:
name: telegraf
state: present
- name: Update telegraf config
copy:
src: /etc/ansible/roles/all/files/telegraf/telegraf.conf
dest: /etc/telegraf/telegraf.conf
owner: root
group: root
mode: 0644
- name: Enable telegraf start
systemd:
name: telegraf
enabled: yes
masked: no
- name: Restart telegraf
systemd:
name: telegraf
state: restarted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment