-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy pathiiab-stages.yml
More file actions
100 lines (84 loc) · 2.54 KB
/
iiab-stages.yml
File metadata and controls
100 lines (84 loc) · 2.54 KB
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
---
- hosts: all
become: yes
gather_facts: false
vars_files:
- roles/0-init/defaults/main.yml
- vars/default_vars.yml
# ansible-core 2.19 disallows (thankfully no longer needed!)
#- vars/{{ ansible_local.local_facts.os_ver }}.yml
- /etc/iiab/local_vars.yml
- /etc/iiab/iiab_state.yml
pre_tasks:
- name: Gather facts -- when not is_proot (not Android)
setup:
when: not is_proot
- name: Gather minimal facts -- when is_proot (Android)
setup:
gather_subset:
- 'all'
- '!hardware'
- '!network'
when: is_proot
- name: Compute memory and swap facts when hardware subset is missing
when: is_proot
block:
- name: Read memtotal and swaptotal from /proc/meminfo
shell: |
awk '
/MemTotal:/ {mem=int($2/1024)}
/SwapTotal:/ {swap=int($2/1024)}
END {
if (swap == "") swap = 0
print mem, swap
}
' /proc/meminfo
register: memswap
changed_when: false
- name: Set fallback memtotal and swaptotal facts
set_fact:
iiab_memtotal_mb: "{{ memswap.stdout.split()[0] | int }}"
iiab_swaptotal_mb: "{{ memswap.stdout.split()[1] | int }}"
tasks:
- name: 0-init
include_role:
name: 0-init
- name: 1-prep
include_role:
name: 1-prep
when: ansible_local.local_facts.stage | int < 1
- name: 2-common
include_role:
name: 2-common
when: ansible_local.local_facts.stage | int < 2
- name: 3-base-server
include_role:
name: 3-base-server
when: ansible_local.local_facts.stage | int < 3
- name: 4-server-options
include_role:
name: 4-server-options
when: ansible_local.local_facts.stage | int < 4
- name: 5-xo-services
include_role:
name: 5-xo-services
when: ansible_local.local_facts.stage | int < 5
- name: 6-generic-apps
include_role:
name: 6-generic-apps
when: ansible_local.local_facts.stage | int < 6
- name: 7-edu-apps
include_role:
name: 7-edu-apps
when: ansible_local.local_facts.stage | int < 7
- name: 8-mgmt-tools
include_role:
name: 8-mgmt-tools
when: ansible_local.local_facts.stage | int < 8
- name: 9-local-addons
include_role:
name: 9-local-addons
when: ansible_local.local_facts.stage | int < 9
- name: Network
include_role:
name: network