ansible/roles/baseconfig/tasks/main.yml

107 lines
2.4 KiB
YAML
Raw Permalink Normal View History

---
# Should contain only small tools that everyone can't live without
- name: Install basic tools
when: ansible_os_family == "Debian"
apt:
2019-03-11 18:02:29 +01:00
name:
- acl # advanced ACL
2019-08-29 07:02:15 +02:00
- apt # better than apt-get
- aptitude # nice to have for Ansible
- bash-completion # because bash
- curl # better than wget
- emacs-nox # for maman
- fish # to motivate @edpibu
2019-08-29 07:02:15 +02:00
- git # code versioning
- htop # better than top
- iotop # monitor i/o
2019-08-29 07:02:15 +02:00
- less # i like cats
2019-12-05 14:07:48 +01:00
- lsb-release
- molly-guard # prevent reboot
- nano # for vulcain
- net-tools
- ntp # network time sync
- oidentd # postgresql identification
- screen # Vulcain asked for this
- sudo
- tree # create a graphical tree of files
- vim # better than nano
- zsh # to be able to ssh @erdnaxe
2019-03-11 18:02:29 +01:00
update_cache: true
register: apt_result
retries: 3
until: apt_result is succeeded
# Pimp my server
- name: Customize motd
copy:
2019-05-03 15:52:50 +02:00
src: "update-motd.d/{{ item }}"
dest: "/etc/update-motd.d/{{ item }}"
mode: 0755
2019-05-03 15:52:50 +02:00
loop:
- 00-logo
- 10-uname
- name: Remove Debian warranty motd
file:
path: /etc/motd
state: absent
# Configure APT mirrors on Debian Stretch
- name: Configure APT mirrors
when:
- ansible_distribution == 'Debian'
- ansible_distribution_release == 'stretch'
template:
src: apt/sources.list.j2
dest: /etc/apt/sources.list
mode: 0644
# Patriotisme
- name: Ensure French UTF-8 locale exists
locale_gen:
name: fr_FR.UTF-8
state: present
2019-03-03 09:43:14 +01:00
# Fix LC_CTYPE="C"
- name: Select default locale
debconf:
name: locales
question: locales/default_environment_locale
value: fr_FR.UTF-8
vtype: select
notify: Reconfigure locales
2019-03-03 09:43:14 +01:00
# APT-List Changes : send email with changelog
- include_tasks: apt-listchanges.yml
# User skeleton
- name: Configure user skeleton
copy:
src: "skel/dot_{{ item }}"
dest: "/etc/skel/.{{ item }}"
2020-11-04 19:31:50 +01:00
mode: 0644
loop:
- zshrc
- zshrc.local
2020-05-07 12:53:59 +02:00
- name: Configure resolvconf
template:
src: resolv.conf
dest: /etc/resolv.conf
mode: 0644
- name: Remove smartmontols
apt:
pkg: smartmontools
state: absent
2021-01-17 17:06:59 +01:00
autoremove: true
when: ansible_system_vendor == "QEMU"
- name: Remove useless packages from the cache
apt:
2021-01-17 17:06:59 +01:00
autoclean: true
- name: Remove dependencies that are no longer required
apt:
2021-01-17 17:06:59 +01:00
autoremove: true