ansible/tasks/base.yml

124 lines
2.6 KiB
YAML
Raw Normal View History

2012-10-17 20:33:38 +00:00
---
- name: sshd_config
2013-05-20 21:58:11 +00:00
action: copy src=$item dest=/etc/ssh/sshd_config mode=600
with_first_found:
- $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}
notify:
- restart sshd
tags:
- sshd_config
- config
- sshd
- name: set root passwd
action: user name=root password=$rootpw state=present
tags:
- rootpw
- name: add ansible root key
action: authorized_key user=root key='$FILE(${files}/common/ansible-pub-key)'
tags:
- config
2013-05-17 19:22:26 +00:00
2012-10-17 20:33:38 +00:00
- name: default packages to install
action: yum state=installed name=$item
with_items:
- joe
- vim-enhanced
- strace
- telnet
- nc
- bind-utils
- traceroute
- openssh-clients
- patch
2013-05-15 22:00:21 +00:00
- postfix
2012-10-17 20:33:38 +00:00
- xz
- zsh
tags:
- packages
- name: default pkgs to remove
action: yum state=removed name=$item
with_items:
- logwatch
- firstboot-tui
- bluez-utils
- sendmail
only_if: '$is_rhel'
2012-10-17 20:33:38 +00:00
tags:
- packages
2013-05-15 20:45:03 +00:00
- name: disabled services
2012-10-17 20:33:38 +00:00
action: service state=stopped enabled=false name=$item
with_items:
- yum-updatesd
- gpm
- rhnsd
only_if: '$is_rhel'
2012-10-17 20:33:38 +00:00
tags:
- services
- config
- name: iptables
action: template src=$item dest=/etc/sysconfig/iptables mode=600
with_first_found:
- $iptables
- $files/iptables/iptables.${ansible_fqdn}
- $files/iptables/iptables.${host_group}
- $files/iptables/iptables
2012-10-17 20:33:38 +00:00
notify:
- restart iptables
tags:
- iptables
- config
# XXX fixme # a datacenter 'fact' from setup
2012-10-17 20:33:38 +00:00
- name: /etc/resolv.conf
action: copy src=$resolvconf dest=/etc/resolv.conf
with_first_found:
- $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
action: copy src=$rsyslogconf dest=/etc/rsyslog.conf mode=644
with_first_found:
- $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
action: copy src=$item dest=/etc/postfix/main.cf
with_first_found:
2012-10-17 20:33:38 +00:00
- $postfix_maincf
- $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