Separate handlers into its own file.

This commit is contained in:
staticsafe 2014-05-07 14:32:38 +00:00
parent 3dae812515
commit 2c0a9857bc
2 changed files with 31 additions and 31 deletions

6
debian/roles/common/handlers/main.yml vendored Normal file
View File

@ -0,0 +1,6 @@
---
- name: restart rsyslog
service: name=rsyslog state=restarted
- name: restart cron
service: name=cron state=restarted

View File

@ -1,32 +1,26 @@
---
- user: root
hosts: unsetup
tasks:
- name: Install python-apt, aptitude, and debconf-utils
shell: apt-get update && apt-get -y install python-apt aptitude debconf-utils
- name: Do any package upgrades
apt: upgrade=dist
- name: Set default locale to en_US.UTF-8
debconf: name=locales question='locales/default_environment_locale' value=en_US.UTF-8 vtype='select'
- name: Generate locales
debconf: name=locales question='locales/locales_to_be_generated' value='en_US.UTF-8 UTF-8' vtype='multiselect'
- name: Choose timezone area
debconf: name=tzdata question='tzdata/Areas' value='Etc' vtype='select'
debconf: name=tzdata question='tzdata/Zones/Etc' value='UTC' vtype='select'
notify:
- restart rsyslog
- restart cron
- name: Install required packages
apt: pkg=most,zsh,vim,vim-scripts,git,subversion,tmux,multitail,mtr-tiny,curl,dnsutils,sudo,gnupg,traceroute,htop,haveged,python-pip,unbound state=present
- name: Remove exim4
apt: pkg=exim4-daemon-light state=absent
- name: Ensure haveged and unbound are started on boot
service: name=haveged enabled=yes
service: name=unbound enabled=yes
- name: use local unbound instance for DNS
shell: echo "nameserver ::1" > /etc/resolv.conf
handlers:
- name: restart rsyslog
service: name=rsyslog state=restarted
- name: restart cron
service: name=cron state=restarted
# This playbook contains common plays that will be run all nodes.
- name: Install python-apt, aptitude, and debconf-utils
shell: apt-get update && apt-get -y install python-apt aptitude debconf-utils
- name: Do any package upgrades
apt: upgrade=dist
- name: Set default locale to en_US.UTF-8
debconf: name=locales question='locales/default_environment_locale' value=en_US.UTF-8 vtype='select'
- name: Generate locales
debconf: name=locales question='locales/locales_to_be_generated' value='en_US.UTF-8 UTF-8' vtype='multiselect'
- name: Choose timezone area
debconf: name=tzdata question='tzdata/Areas' value='Etc' vtype='select'
debconf: name=tzdata question='tzdata/Zones/Etc' value='UTC' vtype='select'
notify:
- restart rsyslog
- restart cron
- name: Install required packages
apt: pkg=most,zsh,vim,vim-scripts,git,subversion,tmux,multitail,mtr-tiny,curl,dnsutils,sudo,gnupg,traceroute,htop,haveged,python-pip,unbound state=present
- name: Remove exim4
apt: pkg=exim4-daemon-light state=absent
- name: Ensure haveged and unbound are started on boot
service: name=haveged enabled=yes
service: name=unbound enabled=yes
- name: use local unbound instance for DNS
shell: echo "nameserver ::1" > /etc/resolv.conf