forked from infra/ansible
Add common role.
This commit is contained in:
parent
f354af18a8
commit
7ca8e1ad50
2790
roles/common/files/.zshrc
Normal file
2790
roles/common/files/.zshrc
Normal file
File diff suppressed because it is too large
Load Diff
13
roles/common/files/.zshrc.local
Normal file
13
roles/common/files/.zshrc.local
Normal file
@ -0,0 +1,13 @@
|
||||
# completion
|
||||
autoload -U compinit
|
||||
compinit
|
||||
|
||||
|
||||
# cache for the completion
|
||||
zstyle ':completion::complete:*' use-cache 1
|
||||
|
||||
|
||||
# promt
|
||||
autoload -U promptinit
|
||||
promptinit
|
||||
#prompt gentoo
|
4
roles/common/handlers/main.yml
Normal file
4
roles/common/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
- name: restart snmpd
|
||||
service: name=snmpd state=restarted
|
31
roles/common/tasks/Debian.yml
Normal file
31
roles/common/tasks/Debian.yml
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
|
||||
- name: Install snmpd
|
||||
apt: name=snmpd state=present
|
||||
tags: snmp
|
||||
|
||||
- name: Configure snmpd
|
||||
template: src=snmpd.conf.j2 dest=/etc/snmp/snmpd.conf
|
||||
tags: snmp
|
||||
notify: restart snmpd
|
||||
|
||||
- name: Start the snmpd service
|
||||
service: name=snmpd state=started enabled=yes
|
||||
tags: snmp
|
||||
|
||||
- name: Install misc software
|
||||
apt: name={{ item }} state=present
|
||||
with_items:
|
||||
- htop
|
||||
- pydf
|
||||
- vim-nox
|
||||
- zsh
|
||||
|
||||
- name: Configure misc software
|
||||
copy: src={{ item.src }} dest={{ item.dest }}
|
||||
with_items:
|
||||
- { src: '.zshrc', dest: '/root/.zshrc' }
|
||||
- { src: '.zshrc.local', dest: '/root/.zshrc.local' }
|
||||
|
||||
- name: Set shell for root user
|
||||
user: name=root shell=/bin/zsh
|
26
roles/common/tasks/FreeBSD.yml
Normal file
26
roles/common/tasks/FreeBSD.yml
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
|
||||
- name: Install snmpd
|
||||
pkgng: name=net-snmp state=present
|
||||
tags: snmp
|
||||
|
||||
- name: Configure snmpd
|
||||
template: src=snmpd.conf.j2 dest=/usr/local/etc/snmpd.conf
|
||||
tags: snmp
|
||||
notify: restart snmpd
|
||||
|
||||
- name: Start the snmpd service
|
||||
service: name=snmpd state=started enabled=yes
|
||||
tags: snmp
|
||||
|
||||
- name: Install misc software
|
||||
pkgng: name={{ item }} state=present
|
||||
with_items:
|
||||
- vim-lite
|
||||
- zsh
|
||||
|
||||
- name: Configure misc software
|
||||
copy: src={{ item.src }} dest={{ item.dest }}
|
||||
with_items:
|
||||
- { src: '.zshrc', dest: '/root/.zshrc' }
|
||||
- { src: '.zshrc.local', dest: '/root/.zshrc.local' }
|
8
roles/common/tasks/main.yml
Normal file
8
roles/common/tasks/main.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
# This playbook contains common plays that will be run on all nodes.
|
||||
|
||||
- include: Debian.yml
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- include: FreeBSD.yml
|
||||
when: ansible_distribution == 'FreeBSD'
|
29
roles/common/templates/snmpd.conf.j2
Normal file
29
roles/common/templates/snmpd.conf.j2
Normal file
@ -0,0 +1,29 @@
|
||||
###############################################################################
|
||||
#
|
||||
# AGENT BEHAVIOUR
|
||||
#
|
||||
|
||||
# Listen for connections on all interfaces, IPv4 only
|
||||
agentAddress udp:161
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# ACCESS CONTROL
|
||||
#
|
||||
|
||||
|
||||
rocommunity public 127.0.0.1
|
||||
|
||||
{% for srv in snmp_allowed %}
|
||||
rocommunity public {{ srv }}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# SYSTEM INFORMATION
|
||||
#
|
||||
|
||||
sysLocation Binary Kitchen e.V., Regensburg, Germany
|
||||
syscontact Markus Hauschild <moepman@binary-kitchen.de>
|
Loading…
Reference in New Issue
Block a user