2019-09-14 11:49:23 -05:00
|
|
|
#!/usr/bin/ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
2020-06-16 09:34:55 -05:00
|
|
|
- name: Configure basic system settings
|
2020-03-26 10:00:22 -05:00
|
|
|
block:
|
2020-06-16 09:34:55 -05:00
|
|
|
- name: Update and upgrade apt packages
|
|
|
|
apt:
|
|
|
|
upgrade: "yes"
|
|
|
|
update_cache: yes
|
|
|
|
# One day
|
|
|
|
cache_valid_time: 86400
|
|
|
|
- name: Install basic packages
|
|
|
|
apt:
|
2020-06-28 09:06:23 -05:00
|
|
|
name:
|
2020-06-16 09:34:55 -05:00
|
|
|
- acl
|
|
|
|
- aptitude
|
2020-06-16 09:35:47 -05:00
|
|
|
- awscli
|
2020-06-30 14:09:48 -05:00
|
|
|
- htop
|
2020-06-28 07:30:47 -05:00
|
|
|
- ncdu
|
2020-06-16 09:34:55 -05:00
|
|
|
- net-tools
|
2020-06-16 09:35:47 -05:00
|
|
|
- openssh-server
|
2020-06-22 04:08:03 -05:00
|
|
|
- pwgen
|
2020-06-16 09:34:55 -05:00
|
|
|
- python3-apt
|
|
|
|
- vim
|
2020-07-02 01:16:29 -05:00
|
|
|
- whois
|
2020-06-28 09:06:23 -05:00
|
|
|
- name: Install basic packages without recommends
|
|
|
|
apt:
|
|
|
|
install_recommends: no
|
|
|
|
name:
|
|
|
|
- smartmontools
|
2020-06-17 09:16:08 -05:00
|
|
|
- name: Copy system configs
|
|
|
|
template:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
mode: "{{ item.mode }}"
|
|
|
|
loop:
|
|
|
|
- { src: "hosts", dest: "/etc/hosts", mode: "0644" }
|
|
|
|
- name: Set hostname
|
|
|
|
hostname:
|
|
|
|
name: "{{ inventory_hostname }}"
|
2020-06-16 09:34:55 -05:00
|
|
|
- name: Set timezone
|
|
|
|
timezone:
|
|
|
|
name: "America/Chicago"
|
|
|
|
notify: restart cron
|
|
|
|
- name: Configure MOTD
|
|
|
|
block:
|
|
|
|
- name: Disable MOTD news
|
|
|
|
copy:
|
|
|
|
src: "motd-news"
|
|
|
|
dest: "/etc/default/motd-news"
|
|
|
|
- name: Disable default update-motd tasks
|
|
|
|
file:
|
|
|
|
path: "/etc/update-motd.d/{{ item }}"
|
|
|
|
state: absent
|
|
|
|
loop:
|
|
|
|
- "00-header"
|
|
|
|
- "10-help-text"
|
|
|
|
- "50-landscape-sysinfo"
|
|
|
|
- "50-motd-news"
|
|
|
|
- "80-esm"
|
|
|
|
- "80-livepatch"
|
|
|
|
- "90-updates-available"
|
|
|
|
- "91-release-upgrade"
|
|
|
|
- "92-unattended-upgrades"
|
|
|
|
- "95-hwe-eol"
|
|
|
|
- "97-overlayroot"
|
|
|
|
- name: Configure Ansible user
|
|
|
|
include_tasks: ansibleuser.yml
|
2020-06-16 09:36:36 -05:00
|
|
|
become: yes
|