Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
- hosts: "{{ host_list }}"
remote_user: root
tasks:
- name: INCLUDE_VARS | base
ansible.builtin.include_vars: "main.yml"
- name: INCLUDE_VARS | OS
ansible.builtin.include_vars: "{{ ansible_distribution }}.yml"
- name: INCLUDE_VARS | Gnome
when: "'gnome' in group_names"
ansible.builtin.include_vars: "Gnome.yml"
- name: INCLUDE_VARS | Mate
when: "'mate' in group_names"
ansible.builtin.include_vars: "Mate.yml"
- name: Remove snap packages
when: snap_uninstall_pkg is defined
community.general.snap:
name: "{{ snap_uninstall_pkg }}"
state: absent
- name: APT | install base & os packages
ansible.builtin.apt:
cache_valid_time: 3600
force_apt_get: yes
pkg: "{{ lookup('flattened', base_pkg, os_pkg) }}"
state: present
update_cache: true
- name: SIGNAL | add key to keyring
when: inventory_hostname in groups.station
ansible.builtin.apt_key:
url: https://updates.signal.org/desktop/apt/keys.asc
keyring: /usr/share/keyrings/signal-desktop-keyring.gpg
state: present
- name: SIGNAL | add apt repository
when: inventory_hostname in groups.station
ansible.builtin.apt_repository:
filename: signal-desktop
repo: deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main
state: present
- name: APT | install workstation packages
when: inventory_hostname in groups.station
ansible.builtin.apt:
cache_valid_time: 3600
force_apt_get: yes
pkg: "{{ lookup('flattened', station_pkg, station_os_pkg, station_wm_pkg) }}"
state: present
update_cache: true
- name: APT | uninstall packages
ansible.builtin.apt:
pkg: "{{ lookup('flattened', base_uninstall_pkg, os_uninstall_pkg) }}"
state: absent
- name: APT | upgrade all packages to the latest version
ansible.builtin.apt:
force_apt_get: yes
upgrade: safe
when: inventory_hostname in groups.station
ansible.builtin.apt:
- name: APT | remove useless packages from the cache
ansible.builtin.apt:
force_apt_get: yes
autoclean: yes
autoremove: yes
- name: APT | check for restarts
ansible.builtin.stat: path={{ item }}
register: restart_required
loop:
- /var/run/firefox-restart-required
- /var/run/reboot-required
no_log: yes
- name: APT | restart message
ansible.builtin.debug:
msg: "{{ item.stat.path | basename }} on {{ ansible_hostname }}"
when: item.stat.exists
loop: "{{ restart_required.results }}"
loop_control:
label: "{{ item.item | basename }}"