-
Notifications
You must be signed in to change notification settings - Fork 28
/
setup-01-arch-prerequirements.yml
50 lines (45 loc) · 1.57 KB
/
setup-01-arch-prerequirements.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
---
- name: Installing prerequirements
hosts: "{{ custom_hosts | default('127.0.0.1') }}"
connection: "{{ custom_connection | default('local') }}"
strategy: linear
tasks:
- name: Arch Tasks
when: ansible_distribution == 'Archlinux'
block:
- name: Arch | Creating directories...
ansible.builtin.file:
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: "0750"
path: "{{ item }}"
state: directory
with_items:
- "{{ ansible_user_dir }}/.ansible/plugins/modules/aur"
- name: Arch | Installing required software
community.general.pacman:
name:
- git
- xdg-user-dirs
state: present
become: true
- name: Arch | Installing ansible module for aur
ansible.builtin.git:
repo: https://github.com/kewlfft/ansible-aur.git
dest: "{{ ansible_user_dir }}/.ansible/plugins/modules/aur"
version: v0.10.0
- name: Common | Creating user for aur builds
ansible.builtin.user:
name: aur_builder
become: true
- name: Common | Allow user aur_builder to use pacman
ansible.builtin.lineinfile:
path: /etc/sudoers.d/aur_builder
state: present
line: "aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman"
validate: /usr/sbin/visudo -cf %s
create: true
owner: root
group: root
mode: 0600
become: true