mirror of
https://github.com/JockeTF/fimfarchive.git
synced 2024-11-22 05:17:59 +01:00
Add common Ansible role
This commit is contained in:
parent
47a85ddd70
commit
c3dd45ed82
5 changed files with 99 additions and 0 deletions
36
operations/common/tasks/apt.yml
Normal file
36
operations/common/tasks/apt.yml
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
---
|
||||||
|
#
|
||||||
|
# Installs upgrades and configures package manager.
|
||||||
|
#
|
||||||
|
|
||||||
|
- name: Upgrade packages
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
upgrade: dist
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: Update GRUB
|
||||||
|
command: update-grub
|
||||||
|
environment:
|
||||||
|
UCF_FORCE_CONFFNEW: YES
|
||||||
|
when: result | changed
|
||||||
|
|
||||||
|
- name: Install Debian utilities
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
with_items:
|
||||||
|
- debconf-utils
|
||||||
|
- unattended-upgrades
|
||||||
|
|
||||||
|
- name: Enable unattended upgrades
|
||||||
|
debconf:
|
||||||
|
name: unattended-upgrades
|
||||||
|
question: unattended-upgrades/enable_auto_updates
|
||||||
|
vtype: boolean
|
||||||
|
value: "true"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: Reconfigure unattended upgrades
|
||||||
|
command: dpkg-reconfigure -f noninteractive unattended-upgrades
|
||||||
|
when: result | changed
|
13
operations/common/tasks/main.yml
Normal file
13
operations/common/tasks/main.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
#
|
||||||
|
# Common tasks.
|
||||||
|
#
|
||||||
|
|
||||||
|
- name: Configure packages
|
||||||
|
include: apt.yml
|
||||||
|
|
||||||
|
- name: Configure time
|
||||||
|
include: time.yml
|
||||||
|
|
||||||
|
- name: Configure utilities
|
||||||
|
include: util.yml
|
26
operations/common/tasks/time.yml
Normal file
26
operations/common/tasks/time.yml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
#
|
||||||
|
# Configures time and synchronization.
|
||||||
|
#
|
||||||
|
|
||||||
|
- name: Set timezone to Etc/UTC
|
||||||
|
file:
|
||||||
|
src: /usr/share/zoneinfo/Etc/UTC
|
||||||
|
dest: /etc/timezone
|
||||||
|
force: yes
|
||||||
|
state: link
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: Reconfigure tzdata
|
||||||
|
command: dpkg-reconfigure -f noninterractive tzdata
|
||||||
|
when: result | changed
|
||||||
|
|
||||||
|
- name: Install NTP daemon
|
||||||
|
apt:
|
||||||
|
name: ntp
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Start NTP daemon
|
||||||
|
service:
|
||||||
|
name: ntp
|
||||||
|
state: started
|
15
operations/common/tasks/util.yml
Normal file
15
operations/common/tasks/util.yml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
#
|
||||||
|
# Installs common utilities.
|
||||||
|
#
|
||||||
|
|
||||||
|
- name: Install utilities
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
with_items:
|
||||||
|
- bmon
|
||||||
|
- htop
|
||||||
|
- iotop
|
||||||
|
- screen
|
||||||
|
- vim
|
9
operations/tracker.yml
Normal file
9
operations/tracker.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
#
|
||||||
|
# Configures trackers.
|
||||||
|
#
|
||||||
|
|
||||||
|
- name: Tracker
|
||||||
|
hosts: trackers
|
||||||
|
roles:
|
||||||
|
- common
|
Loading…
Reference in a new issue