main.yml 2.69 KB
Newer Older
1
2
---

3
4
5
6
7
- name: install additional buildserver support packages
  pacman: name={{item}} state=present
  with_items:
    - appstream-generator

8
- name: install archbuild
9
  pacman: name=systemd-swap,devtools,zsh,git,subversion,mercurial,bzr,xdelta3,ruby,tig,colordiff state=present
10
11
12
13
14
15
16
17

- name: install archbuild scripts
  copy: src={{ item }} dest=/usr/local/bin/{{ item }} owner=root group=root mode=0755
  with_items:
    - mkpkg
    - diffrepo
    - clean-chroots
    - clean-dests
18
    - gitpkg
19
20
21
22
23
24
25
26
27
28
29
30
31

- name: install archbuild units
  copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
  with_items:
    - clean-chroots.timer
    - clean-chroots.service
    - clean-dests.timer
    - clean-dests.service
    - var-lib-archbuilddest.mount
    - strictatime@.service
  notify:
    - daemon reload

32
33
34
35
36
37
38
39
- name: install archbuild unit
  copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
  with_items:
    - var-lib-archbuild.mount
  notify:
    - daemon reload
  when: archbuild_fs == 'tmpfs'

40
41
42
43
44
45
- name: install archbuild user units
  copy: src={{ item }} dest=/etc/systemd/user/{{ item }} owner=root group=root mode=0644
  with_items:
    - mkpkg@.timer
    - mkpkg@.service

46
- name: install systemd-swap config
47
  copy: src=swap.conf dest=/etc/systemd/swap.conf owner=root group=root mode=0644
48
  when: archbuild_fs == 'tmpfs'
49

50
- name: start and enable archbuild mounts
51
52
  service: name={{ item }} enabled=yes state=started
  with_items:
53
    - systemd-swap.service
54
    - var-lib-archbuild.mount
55
56
57
58
59
  when: archbuild_fs == 'tmpfs'

- name: start and enable archbuilddest mount
  service: name={{ item }} enabled=yes state=started
  with_items:
60
61
62
63
64
65
66
67
    - var-lib-archbuilddest.mount

- name: create archbuilddest
  file:
    state: directory
    path: '/var/lib/{{ "/".join(item) }}'
    owner: root
    group: root
68
    mode: 01777
69
70
  with_nested:
    - [archbuilddest]
71
    - [srcdest]
72
73
74
75
76

- name: set acl on archbuilddest
  acl:
    name: '/var/lib/archbuilddest/{{ item[0] }}'
    state: present
77
    entry: 'default:{{ item[1] }}'
78
  with_nested:
79
    - [srcdest]
80
81
    - ['user::rwx',
       'group::r-x',
82
83
       'group:dev:rwx',
       'group:tu:rwx',
84
85
       'other::r-x',
       'mask::rwx']
86

87
88
89
90
91
92
- name: start and enable archbuild units
  service: name={{ item }} enabled=yes state=started
  with_items:
    - clean-chroots.timer
    - clean-dests.timer

93
94
95
96
- name: set makepkg.conf vars
  lineinfile:
    dest: /etc/makepkg.conf
    insertafter: '^#?{{ item.key }}='
97
    line: '{{ item.key }}="{{ item.value }}"'
98
99
100
  with_dict:
    MAKEFLAGS: '-j{{ ansible_processor_vcpus + 1 }}'
    SRCDEST: /var/lib/archbuilddest/srcdest
101
102
103

- name: install archbuild sudoers config
  copy: src=sudoers dest=/etc/sudoers.d/archbuild