-
Notifications
You must be signed in to change notification settings - Fork 34
/
provision.yml
51 lines (44 loc) · 1.75 KB
/
provision.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
- hosts: server
become: yes
tasks:
- name: read config variables
include_vars: vars.yml
# /vagrant path is used because ansible_local playbook runs inside virtual host
- name: include provision_server.yml
include_tasks: provision_server.yml
# In VirtualBox on Windows files in shared /vagrant folder have too wide permissions
# openssh refuses to use private keys with wrong mode
- name: copy template ssh key to local directory and change its mode
shell: cp -f /vagrant/.vagrant/machines/template/virtualbox/private_key /home/vagrant/template_private_key && chown vagrant /home/vagrant/template_private_key && chmod 0600 /home/vagrant/template_private_key
handlers:
- name: systemctl daemon-reload
shell: systemctl daemon-reload
- name: restart dnsmasq
service: name=dnsmasq state=restarted
- name: restart nginx
service: name=nginx state=restarted
- hosts: template
become: yes
tasks:
- name: read config variables
include_vars: vars.yml
tags: always
- name: include provision_template.yml
include_tasks: provision_template.yml
- name: install GUI packages
include_tasks: provision_template_gui.yml
when: install_gui
- name: install FreeRDP packages
include_tasks: provision_template_freerdp.yml
when: install_rdp_client
- name: install GUI packages
include_tasks: provision_template_vmware_horizon.yml
when: install_vmware_horizon_client
handlers:
# update artifacts in build every time we need to regenerate initrd
- name: update initramfs
shell: update-initramfs -u && cd /vagrant && ./build.sh initrd
- name: systemctl daemon-reload
shell: systemctl daemon-reload
- name: reload sshd
service: name=sshd state=reloaded