main.yml 1.73 KB
Newer Older
1
2
3
---

- name: install arch-boxes dependencies
Christian Rebischke's avatar
Christian Rebischke committed
4
  pacman: name=git,packer,virtualbox,qemu-headless,virtualbox-host-modules-arch,python,python-urllib3 state=present
5
6

- name: create arch-boxes user
7
  user: name={{ archboxes_user }} shell=/bin/bash home="{{ archboxes_home }}" createhome=yes
8
9

- name: clone arch-boxes repository
Christian Rebischke's avatar
Christian Rebischke committed
10
  git: repo='https://github.com/archlinux/arch-boxes.git' dest="{{ archboxes_git_dir }}" force=yes version="{{ archboxes_version }}"
11

12
- name: load virtualbox kernel modules
Christian Rebischke's avatar
Christian Rebischke committed
13
  modprobe: name="{{ item }}" state=present
14
  with_items: ['vboxdrv', 'vboxnetadp', 'vboxnetflt']
15

16
17
18
- name: add modules-load config for virtualbox
  copy: src=virtualbox.conf dest=/etc/modules-load.d/virtualbox.conf owner=root group=root mode=0644

19
- name: adjust permissions of git checkout
20
  file: path="{{ archboxes_git_dir }}" state=directory recurse=yes owner="{{ archboxes_user }}" group="{{ archboxes_user }}"
21

22
23
24
- name: ensure controller.py of arch-boxes is executable
  file: path="{{ archboxes_git_dir }}/controller.py" mode='0744'

25
- name: replace placeholder to vagrantcloud API Key
26
  no_log: true
27
  replace: path="{{ archboxes_git_dir }}/vagrant.json" regexp='PLACEHOLDER' replace="{{ vault_archboxes_apikey }}"
28

29
30
31
- name: install sudoers file
  template: src=sudoers.d.j2 dest=/etc/sudoers.d/archboxes

32
33
34
35
36
37
38
39
40
41
42
43
- name: install arch-boxes service
  template: src='arch-boxes.service.j2' dest='/etc/systemd/system/arch-boxes.service' owner=root group=root mode=0644
  notify:
    - daemon reload

- name: install arch-boxes timer
  template: src='arch-boxes.timer.j2' dest='/etc/systemd/system/arch-boxes.timer' owner=root group=root mode=0644
  notify:
    - daemon reload

- name: start and enable arch-boxes timer
  service: name='arch-boxes.timer' enabled=yes state=started