-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeneral.yml
123 lines (102 loc) · 3.37 KB
/
general.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
---
- hosts: localhost
connection: local
pre_tasks:
- debug:
msg: "{{ ansible_facts }}"
- name: update apt repositories
apt: update_cache=yes
become: True
changed_when: False
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
ignore_errors: True
# # different required roles:
# - terminal / server / base
# - nvim (config)
# - fish (config)
# - graphical
# - programs:
# - configs:
# - kitty
# - todo
# - i3status-rs
# - i3
# - broot
# - scripts
#
#
# # file: foo_desktop.config.j2
# add network widget
# {% if client_role == 'laptop' %}
# add battery widget
# {% endif %}
#
# # and then:
# - ansible-pull -e client_role=desktop playbook.yaml
#
# # others
# - include: tasks/sth.yml
# - debug: var=ansible_facts
# - name: install cron job (ansible-pull)
# cron:
# user: ansible
# name: ansible provision
# minute: */10
# job: "/usr/bin/ansible-pull -o -U https://github.com/<github_user>/ansible.git > /dev/null"
handlers:
- name: Import handlers
import_tasks: handlers/main.yml
tasks:
- name: Load global variables
include_vars:
file: defaults/main.yml
- name: Load hp440g5 variables
include_vars:
file: vars/hp440g5.yml
when: client_role is defined and client_role == 'hp440g5'
- name: Load novo variables
include_vars:
file: vars/novo.yml
when: client_role is defined and client_role == 'novo'
- name: Load tux variables
include_vars:
file: vars/tux.yml
when: client_role is defined and client_role == 'tux'
- name: Load artus variables
include_vars:
file: vars/artus.yml
when: client_role is defined and client_role == 'artus'
- name: Load SNB variables
include_vars:
file: vars/snb.yml
when: client_role is defined and client_role == 'SNB'
- name: Load margo variables
include_vars:
file: vars/margo.yml
when: client_role is defined and client_role == 'margo'
- name: Load desktop variables
include_vars:
file: vars/desktop.yml
when: client_role is defined and client_role == 'desktop'
- name: Load terminal variables
include_vars:
file: vars/terminal.yml
when: client_role is defined and client_role == 'terminal'
- name: Load serf variables
include_vars:
file: vars/serf.yml
when: client_role is defined and client_role == 'serf'
- name: Fail if client role not defined
fail:
when: "client_role is not defined or (client_role != 'tux' and client_role != 'desktop' and client_role != 'terminal' and client_role != 'serf' and client_role != 'artus' and client_role != 'novo' and client_role != 'margo' and client_role != 'SNB')"
# - import_tasks: tasks/testing.yml
# when: client_role is defined
- import_tasks: tasks/terminal.yml
when: client_role is defined
- import_tasks: tasks/nixos.yml
when: link_nixos
- import_tasks: tasks/terminal_extended.yml
when: "client_role is defined and client_role != 'terminal'"
- import_tasks: tasks/configs_graphical.yml
when: "client_role is defined and client_role != 'terminal'"
- meta: flush_handlers