2012-10-17 20:33:38 +00:00
|
|
|
---
|
2013-05-15 20:57:44 +00:00
|
|
|
|
|
|
|
- name: sshd_config
|
2013-05-20 21:58:11 +00:00
|
|
|
action: copy src=$item dest=/etc/ssh/sshd_config mode=600
|
2013-05-20 20:25:00 +00:00
|
|
|
with_first_found:
|
2013-05-15 20:57:44 +00:00
|
|
|
- $sshd_config
|
2013-05-15 21:06:21 +00:00
|
|
|
- ${files}/ssh/sshd_config.${ansible_fqdn}
|
|
|
|
- ${files}/ssh/sshd_config.${host_group}
|
|
|
|
- ${files}/ssh/sshd_config.${dist_tag}
|
|
|
|
- ${files}/ssh/sshd_config.${ansible_distribution}
|
2013-05-15 20:57:44 +00:00
|
|
|
notify:
|
|
|
|
- restart sshd
|
|
|
|
tags:
|
|
|
|
- sshd_config
|
|
|
|
- config
|
|
|
|
- sshd
|
|
|
|
|
|
|
|
- name: set root passwd
|
2013-06-28 21:28:29 +00:00
|
|
|
action: user name=root password={{ rootpw }} state=present
|
2013-05-15 20:57:44 +00:00
|
|
|
tags:
|
|
|
|
- rootpw
|
|
|
|
|
|
|
|
- name: add ansible root key
|
2013-06-17 13:54:17 +00:00
|
|
|
action: authorized_key user=root key="{{ item }}"
|
|
|
|
with_file:
|
|
|
|
- ${files}/common/ansible-pub-key
|
2013-05-15 20:57:44 +00:00
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
|
2013-06-17 19:27:08 +00:00
|
|
|
- name: make sure our resolv.conf is the one being used - set RESOLV_MODS=no in /etc/sysconfig/network
|
|
|
|
lineinfile: dest=/etc/sysconfig/network backup=yes state=present line='RESOLV_MODS=no' regexp=^RESOLV_MODS=
|
|
|
|
tags:
|
|
|
|
- config
|
2013-05-17 19:22:26 +00:00
|
|
|
|
2013-06-06 18:04:01 +00:00
|
|
|
- name: global default packages to install
|
2012-10-17 20:33:38 +00:00
|
|
|
action: yum state=installed name=$item
|
2013-06-06 18:04:01 +00:00
|
|
|
with_items: $global_pkgs_inst
|
2012-10-17 20:33:38 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
2013-06-06 18:04:01 +00:00
|
|
|
- name: dist pkgs to remove
|
2013-05-24 14:42:39 +00:00
|
|
|
action: yum state=removed name=$item
|
2013-06-06 17:53:54 +00:00
|
|
|
with_items: $base_pkgs_erase
|
2013-05-24 14:42:39 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
2013-06-06 18:04:01 +00:00
|
|
|
- name: dist pkgs to install
|
2013-05-24 14:52:32 +00:00
|
|
|
action: yum state=installed name=$item
|
2013-06-06 17:53:54 +00:00
|
|
|
with_items: $base_pkgs_inst
|
2013-05-24 14:42:39 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
2013-06-06 18:04:01 +00:00
|
|
|
- name: dist disabled services
|
2012-10-17 20:33:38 +00:00
|
|
|
action: service state=stopped enabled=false name=$item
|
2013-06-06 17:53:54 +00:00
|
|
|
with_items: $service_disabled
|
2012-10-17 20:33:38 +00:00
|
|
|
tags:
|
2013-05-21 20:15:34 +00:00
|
|
|
- service
|
2012-10-17 20:33:38 +00:00
|
|
|
- config
|
|
|
|
|
2013-06-06 18:04:01 +00:00
|
|
|
- name: dist enabled services
|
|
|
|
action: service state=running enabled=true name=$item
|
|
|
|
with_items: $service_enabled
|
|
|
|
tags:
|
|
|
|
- service
|
|
|
|
- config
|
2013-05-24 14:52:32 +00:00
|
|
|
|
|
|
|
|
2012-10-17 20:33:38 +00:00
|
|
|
- name: iptables
|
2013-07-03 18:58:53 +00:00
|
|
|
action: template src=$item dest=/etc/sysconfig/iptables mode=600 backup=yes
|
2013-05-20 20:25:00 +00:00
|
|
|
with_first_found:
|
2012-10-18 15:57:06 +00:00
|
|
|
- $iptables
|
|
|
|
- $files/iptables/iptables.${ansible_fqdn}
|
|
|
|
- $files/iptables/iptables.${host_group}
|
2013-07-03 18:44:47 +00:00
|
|
|
- $files/iptables/iptables.${env}
|
2012-10-18 15:57:06 +00:00
|
|
|
- $files/iptables/iptables
|
2012-10-17 20:33:38 +00:00
|
|
|
notify:
|
|
|
|
- restart iptables
|
|
|
|
tags:
|
|
|
|
- iptables
|
|
|
|
- config
|
|
|
|
|
2012-10-18 15:57:06 +00:00
|
|
|
# XXX fixme # a datacenter 'fact' from setup
|
2012-10-17 20:33:38 +00:00
|
|
|
- name: /etc/resolv.conf
|
2013-05-29 22:15:50 +00:00
|
|
|
action: copy src=$item dest=/etc/resolv.conf
|
2013-05-20 20:25:00 +00:00
|
|
|
with_first_found:
|
2013-05-29 22:15:50 +00:00
|
|
|
- ${resolvconf}
|
|
|
|
- $files/resolv.conf/${ansible_fqdn}
|
|
|
|
- $files/resolv.conf/${host_group}
|
|
|
|
- $files/resolv.conf/${datacenter}
|
|
|
|
- $files/resolv.conf/resolv.conf
|
2012-10-17 20:33:38 +00:00
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
- resolvconf
|
|
|
|
|
|
|
|
- name: rsyslog.conf
|
2013-05-29 22:15:50 +00:00
|
|
|
action: copy src=$item dest=/etc/rsyslog.conf mode=644
|
2013-05-20 20:25:00 +00:00
|
|
|
with_first_found:
|
2012-10-18 15:57:06 +00:00
|
|
|
- $rsyslogconf
|
|
|
|
- $files/rsyslog/rsyslog.conf.${ansible_fqdn}
|
|
|
|
- $files/rsyslog/rsyslog.conf.${host_group}
|
|
|
|
- $files/rsyslog/rsyslog.conf.${datacenter}
|
|
|
|
- $files/rsyslog/rsyslog.conf
|
|
|
|
|
2012-10-17 20:33:38 +00:00
|
|
|
notify:
|
|
|
|
- restart rsyslog
|
|
|
|
tags:
|
|
|
|
- rsyslogd
|
|
|
|
- config
|
|
|
|
|
|
|
|
- name: /etc/postfix/main.cf
|
2012-10-18 15:57:06 +00:00
|
|
|
action: copy src=$item dest=/etc/postfix/main.cf
|
2013-05-20 20:25:00 +00:00
|
|
|
with_first_found:
|
2012-10-17 20:33:38 +00:00
|
|
|
- $postfix_maincf
|
2012-10-18 15:57:06 +00:00
|
|
|
- $files/postfix/main.cf.${ansible_fqdn}
|
|
|
|
- $files/postfix/main.cf.${host_group}
|
|
|
|
- $files/postfix/main.cf.${postfix_group}
|
|
|
|
- $files/postfix/main.cf
|
2012-10-17 20:33:38 +00:00
|
|
|
notify:
|
2012-11-19 22:06:46 +00:00
|
|
|
- restart postfix
|
2012-10-17 20:33:38 +00:00
|
|
|
tags:
|
|
|
|
- postfix
|
|
|
|
- config
|
|
|
|
|
2013-05-31 15:24:28 +00:00
|
|
|
#
|
|
|
|
# This task installs some common scripts to /usr/local/bin
|
|
|
|
# scripts are under $files/common-scripts
|
|
|
|
#
|
|
|
|
|
|
|
|
- name: Install common scripts
|
|
|
|
action: copy src=$item dest=/usr/local/bin/ owner=root group=root mode=0755
|
|
|
|
with_fileglob: $files/common-scripts/*
|
|
|
|
tags:
|
|
|
|
- config
|