-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.yml
108 lines (89 loc) · 3.24 KB
/
main.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
- hosts: localhost
connection: local
pre_tasks:
- name: Include common variables
include_vars: vars/common.yml
tags: ["arch", "debian", "macos"]
- name: Include Debian-related variables
include_vars: vars/debian.yml
when: ansible_os_family == "Debian"
tags: ["debian"]
- name: include Arch-related variables
include_vars: vars/arch.yml
when: ansible_os_family == "Archlinux"
tags: ["arch"]
- name: include Gnome-related variables
include_vars: vars/gnome.yml
when: ansible_os_family == "Archlinux" or ansible_os_family == "Debian"
tags: ["arch", "debian"]
- name: include Macos-related variables
include_vars: vars/macos.yml
when: ansible_os_family == "Darwin"
tags: ["macos"]
- name: include secret variables
include_vars: vars/secrets.yml
tags: ["arch", "debian", "macos"]
- name: Include playbook customizations
include_vars: "{{ item }}"
with_fileglob:
- "{{ playbook_dir }}/config.yml"
roles:
- role: luizgavalda.aur
when: ansible_os_family == "Archlinux"
tags: ["arch"]
- role: geerlingguy.mac.homebrew
when: ansible_os_family == "Darwin"
tags: ["macos"]
- role: geerlingguy.mac.mas
when: ansible_os_family == "Darwin"
tags: ["macos"]
- role: geerlingguy.mac.dock
when: ansible_os_family == "Darwin"
tags: ["macos"]
- role: geerlingguy.dotfiles
tags: ["arch", "debian", "macos"]
tasks:
- name: Setup gitconfig
include_tasks: tasks/core/setup-gitconfig.yml
tags: ["arch", "debian", "macos"]
- name: Make sure ansible is set for execution
include_tasks: tasks/core/setup-ansible.yml
tags: ["arch", "debian", "macos"]
- name: Install debian packages
include_tasks: tasks/core/setup-debian-pkgs.yml
when: ansible_os_family == "Debian"
tags: ["debian"]
- name: Install arch packages
include_tasks: tasks/core/setup-arch-pkgs.yml
when: ansible_os_family == "Archlinux"
tags: ["arch"]
- name: Install extra packages
include_tasks: tasks/core/setup-extra-pkgs.yml
tags: ["arch", "debian", "macos"]
- name: Setup asdf
include_tasks: tasks/core/setup-asdf.yml
tags: ["arch", "debian", "macos"]
- name: Setup asdf packages
include_tasks: tasks/core/setup-asdf-pkgs.yml
tags: ["arch", "debian", "macos"]
- name: Setup direnv
include_tasks: tasks/core/setup-direnv.yml
tags: ["arch", "debian", "macos"]
- name: Patch Gnome extensions
include_tasks: tasks/core/patch-gnome-extensions.yml
when: ansible_os_family == "Archlinux" or ansible_os_family == "Debian"
tags: ["arch", "debian"]
- name: Run configured post-provision ansible task files.
include_tasks: "{{ outer_item }}"
loop_control:
loop_var: outer_item
with_fileglob: "{{ post_provision_tasks|default(omit) }}"
# TODO: Add lockfile to prevent multiple runs
- name: Run configured post-provision commands
command:
cmd: "{{ item.cmd }}"
chdir: "{{ item.dir }}"
become: "{{ item.become | default('no') }}"
with_items: "{{ post_provision_cmds }}"
tags: ["arch", "debian", "macos"]