forked from LearnLinuxTV/personal_ansible_desktop_configs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.yml
66 lines (58 loc) · 1.42 KB
/
local.yml
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
# tasks to complete before running roles
- hosts: all
tags: always
become: true
pre_tasks:
- name: pre-run | update package cache (arch)
tags: always
pacman: update_cache=yes
changed_when: False
when: ansible_distribution == "Archlinux"
- name: pre-run | update package cache (debian, etc)
tags: always
apt: update_cache=yes
changed_when: False
when: ansible_distribution in ["Debian", "Ubuntu"]
# run roles
- hosts: all
tags: base
become: true
roles:
- base
- hosts: workstation
tags: workstation
become: true
roles:
- workstation
- hosts: server
tags: server
become: true
roles:
- server
# end of run cleanup and reporting
- hosts: all
become: true
tasks:
- name: cleanup package cache (debian and ubuntu)
tags: always
apt:
autoclean: yes
changed_when: false
when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"]
- name: autoremove orphan packages (debian and ubuntu)
tags: always
apt:
autoremove: yes
purge: yes
when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu"]
- name: send completion alert
include_tasks: playbooks/send_completion_alert.yml
tags: always
when:
- task_failed is not defined
- name: send failure alert
include_tasks: playbooks/send_failure_alert.yml
tags: always
when:
- task_failed is defined
- task_failed == true