-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.yaml
More file actions
executable file
·70 lines (62 loc) · 2.06 KB
/
Copy pathbootstrap.yaml
File metadata and controls
executable file
·70 lines (62 loc) · 2.06 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
#!/usr/bin/env ansible-playbook
---
- name: "Bootstrap Ansible dependencies"
hosts: localhost
tasks:
- name: "Allow the invoking user to run sudo without a password"
ansible.builtin.lineinfile:
path: "/etc/sudoers.d/10-nopasswd-{{ bootstrap_user }}"
line: "{{ bootstrap_user }} ALL=(ALL:ALL) NOPASSWD: ALL"
create: true
mode: "0440"
validate: "visudo -cf %s"
become: true
vars:
bootstrap_user: "{{ ansible_facts['env']['SUDO_USER'] | default(ansible_facts['user_id']) }}"
- name: "Create the AUR builder group"
ansible.builtin.group:
name: "{{ aur_builder_user }}"
become: true
- name: "Create the AUR builder user"
ansible.builtin.user:
name: "{{ aur_builder_user }}"
create_home: true
group: "{{ aur_builder_user }}"
become: true
- name: "Allow the AUR builder user to run pacman without a password"
ansible.builtin.lineinfile:
path: "/etc/sudoers.d/11-install-{{ aur_builder_user }}"
line: "{{ aur_builder_user }} ALL=(ALL) NOPASSWD: /usr/bin/pacman"
create: true
mode: "0440"
validate: "visudo -cf %s"
become: true
- name: "Disable debug packages in makepkg builds"
ansible.builtin.copy:
dest: /etc/makepkg.conf.d/nodebug.conf
content: |
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug lto)
owner: root
group: root
mode: "0644"
become: true
- name: "Install AUR build prerequisites"
community.general.pacman:
name:
- base-devel # Basic tools to build Arch Linux packages
- git # The fast distributed version control system
state: present
become: true
- name: "Install Yay"
kewlfft.aur.aur:
name: yay # Yet another yogurt. Pacman wrapper and AUR helper written in go
use: makepkg
state: present
become: true
become_user: "{{ aur_builder_user }}"
- name: "Install Paru"
kewlfft.aur.aur:
name: paru-git # Feature packed AUR helper
state: present
become: true
become_user: "{{ aur_builder_user }}"