-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
buildmoodlebox.yml
64 lines (56 loc) · 1.56 KB
/
buildmoodlebox.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
---
- name: Playbook to provision most of the MoodleBox
hosts: all
vars:
ansible_user: 'root'
become: true
vars_files:
- default.config.yml
pre_tasks:
- name: Print out begin of build date and time
ansible.builtin.debug:
msg: 'Beginning of build: {{ lookup("pipe", "date +%Y-%m-%dT%H:%M:%S%z") }}'
- name: Set fact with build start timestamp
ansible.builtin.set_fact:
build_start: '{{ lookup("pipe", "date +%s") }}'
- name: Include customised variables
ansible.builtin.include_vars: '{{ item }}'
with_fileglob:
- config.yml
- name: Create temporary directory
ansible.builtin.file:
state: directory
path: '/tmp/ansible'
mode: '0775'
post_tasks:
- name: Print out end of build date and time and build duration
ansible.builtin.debug:
msg:
- 'End of build: {{ lookup("pipe", "date +%Y-%m-%dT%H:%M:%S%z") }}'
- 'Build duration: {{ lookup("pipe", "date +%s") | int - build_start | int }} s'
roles:
- handlers # This special 'role' defines all generic handlers.
- rpisettings
- apt
- { role: firmware, when: moodlebox_update_firmware | bool }
- hostname
- useraccount
- timezone
- locales
- wifi
- zeroconf
- database
- packages
- packageconfig
- partitionresize
- webserver
- moodleuninstall
- moodledatabase
- moodleinstall
- cron
- adminer
- cert
- rpiclone
- branding
- { role: sshkey, when: moodlebox_build_type == 'development' }
- cleanup