-
Notifications
You must be signed in to change notification settings - Fork 2
/
playbook.yml
110 lines (92 loc) · 2.28 KB
/
playbook.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
- hosts: all
become: true
vars:
gpumem: 160
hostname: mono
timezone: Europe/Budapest
username: ijanos
vars_prompt:
- name: "password"
prompt: "Enter password for the new user"
private: yes
tasks:
- name: Set hostname
hostname:
name={{ hostname }}
- name: Setup locale.gen
template:
src: locale.gen.j2
dest: /etc/locale.gen
notify: locale-regen
- name: Setup locale.conf
template:
src: locale.conf.j2
dest: /etc/locale.conf
- name: Setup boot config
template:
src: config.txt.j2
dest: /boot/config.txt
- name: Set the timezone
file:
src: /usr/share/zoneinfo/{{ timezone }}
dest: /etc/localtime
state: link
- name: Set up memory-only journal logging
template:
src: journald.conf.j2
dest: /etc/systemd/journald.conf
- name: Upgrade the system
pacman:
update_cache: yes
upgrade: yes
- name: Install packages
pacman: name={{ item }}
with_items:
- vim
- mc
- bash-completion
- htop
- tmux
- base-devel
- avahi
- nss-mdns
- wget
- name: enable mDNS
template:
src: nsswitch.conf.j2
dest: /etc/nsswitch.conf
- name: Enable avahi service
service:
name: avahi-daemon
enabled: yes
state: started
- name: Add normal user
user:
name: "{{ username }}"
group: users
groups: wheel
append: yes
createhome: yes
- name: Set the password for the new user
shell: echo -e "{{ password }}\n{{ password }}" | passwd {{ username }}
- name: Allow wheel group to have sudo rights
lineinfile:
dest: /etc/sudoers
state: present
regexp: '^%wheel'
line: '%wheel ALL=(ALL) ALL'
validate: visudo -cf %s
- name: Enable colorful pacman output
lineinfile:
dest: /etc/pacman.conf
state: present
regexp: '^Color'
line: 'Color'
- name: add a basic .bashrc for the normal user
template:
src: bashrc.j2
dest: /home/{{ username }}/.bashrc
handlers:
- name: locale-regen
command: locale-gen