ansible-playbooks/roles/core/tasks/main.yml

181 lines
3.6 KiB
YAML

---
#- name: Update /etc/hosts
# template: src=hosts
# dest=/etc/hosts
- name: Disable resolvconf
service: name={{ item }} state=stopped enabled=no
with_items:
- resolvconf
- systemd-resolved
ignore_errors: yes
#
- name: Remove resolvconf
package:
name: resolvconf
state: absent
#
- name: Remove immutable on resolv.conf
command: chattr -i /etc/resolv.conf
ignore_errors: yes
#
- name: Copy resolv.conf
copy:
src: resolv.conf
dest: /etc/resolv.conf
#attributes: 'ie'
#
- name: Set immutable on resolv.conf
command: chattr +i /etc/resolv.conf
#
- name: Install root dotfiles
copy: src={{ item.src }} dest={{ item.dest }} backup=no
with_items:
- { src: 'root-dotfiles/bashrc', dest: '/root/.bashrc' }
- { src: 'root-dotfiles/bash-preexec', dest: '/root/.bash-preexec' }
- { src: 'root-dotfiles/vimrc', dest: '/root/.vimrc' }
- name: Install Shells
apt: name={{ item }} state=latest
with_items:
- bash
- zsh
- zsh-doc
- dash
- ksh
- tcsh
- csh
- rc
- bash-doc
- bash-completion
- name: Install Editors
apt: name={{ item }} state=latest
with_items:
- vim-nox
- ed
- nano
- name: Install words
apt: name={{ item }} state=latest
with_items:
- wamerican-insane
- name: Install utils
apt: name={{ item }} state=latest
with_items:
- acl
- tmux
- screen
- less
- lsof
- bc
- dc
- psmisc
- procps
- htop
- schedtool
- pciutils
- rsync
- iotop
- attr
- tree
- parted
- mosh
- name: Install compression
apt: name={{ item }} state=latest
with_items:
- bzip2
- gzip
- pax
- lzma
- xz-utils
- cpio
- name: Install ncurses
apt: name={{ item }} state=latest
with_items:
- ncurses-bin
- ncurses-term
- name: Install network
apt: name={{ item }} state=latest
with_items:
- iputils-ping
- iputils-arping
- traceroute
- telnet
- iproute2
- ethtool
- dnsutils
- whois
- wget
- curl
- netcat-traditional
- netcat-openbsd
- vlan
- bridge-utils
- tcpdump
- tshark
- ftp
- tftp
- name: Install ntp
apt: name=ntp state=latest
- name: Copy NTP configuration
copy:
src: ntp.conf
dest: /etc/ntp.conf
backup: no
- name: Restart NTP
service:
name: ntp
state: restarted
- name: Install debian package management
apt: name={{ item }} state=latest
with_items:
- aptitude
- dselect
- name: Install gpg
apt: name=gnupg state=latest
- name: Install rsyslog
apt: name={{ item }} state=latest
with_items:
- rsyslog
- rsyslog-gnutls
# TODO: Configure logging
- name: Restart rsyslog
service:
name: rsyslog
state: restarted
- name: Install fail2ban
apt: name=fail2ban state=latest
- name: Install man pages
apt: name={{ item }} state=latest
with_items:
- manpages
- info
- name: Install molly-guard
apt: name=molly-guard state=latest
- name: Install ssmtp
apt: name=ssmtp state=latest
- name: Configure ssmtp
lineinfile: dest=/etc/ssmtp/ssmtp.conf
state=present
backrefs=yes
regexp='^(FromLineOverride=YES)$'
line='\\1'