Complete refractoring

This commit is contained in:
Tobias Maier
2022-06-13 22:18:13 +02:00
parent 2a9bfe3a86
commit 73921527e3
6 changed files with 105 additions and 177 deletions

26
modules/base.yml Normal file
View File

@@ -0,0 +1,26 @@
- name: Update and Upgrade all exisiting packages
community.general.pacman:
update_cache: yes
upgrade: yes
- name: Install archlinux-keyring
community.general.pacman:
name: archlinux-keyring
state: latest
- name: Install basic packages
community.general.pacman:
name: sudo,zsh,base-devel,ttf-font-awesome,openssh
state: present
- name: Create User etc.
import_tasks: modules/userstuff.yml
- name: Install Paru
import_tasks: modules/paru.yml
- name: Install zsh stuff
import_tasks: modules/zsh.yml
- name: Install base packages
import_tasks: modules/base_packages.yml

View File

@@ -0,0 +1,7 @@
- name: Install Gnome
kewlfft.aur.aur:
use: paru
name: bat,zoxide,exa,fzf,vim,fd
state: latest
become: yes
become_user: aur_builder

20
modules/paru.yml Normal file
View File

@@ -0,0 +1,20 @@
- name: Create the `aur_builder` user
ansible.builtin.user:
name: aur_builder
create_home: yes
- name: Allow the `aur_builder` user to run `sudo pacman` without a password
ansible.builtin.lineinfile:
path: /etc/sudoers.d/11-install-aur_builder
line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman'
create: yes
validate: 'visudo -cf %s'
- name: Install paru using makepkg if it isn't installed already
kewlfft.aur.aur:
name: paru
use: makepkg
state: present
become: yes
become_method: su
become_user: aur_builder

36
modules/userstuff.yml Normal file
View File

@@ -0,0 +1,36 @@
- name: Make sure we have a 'wheel' group
group:
name: wheel
state: present
- name: Make sure we have a 'docker' group
group:
name: docker
state: present
- name: Allow 'wheel' to be sudo
lineinfile:
dest: /etc/sudoers
state: present
regexp: '^%wheel'
line: '%wheel ALL=(ALL) ALL'
- name: Add the user tobi
ansible.builtin.user:
name: tobi
password: $6$9OnvBMN6Sxc.muW1$afASAJdoPZL/WxTp6.lh/SurRRiClaru2Pl19fEo6j1aDEQw99kdkfls6.DB8OBacBDnT3bpsLYD3JqrvXlE9/
comment: Tobias Maier
groups: wheel,docker
shell: /bin/zsh
- name: Add name to git config
community.general.git_config:
name: user.name
scope: system
value: Tobias Maier
- name: Add email to git config
community.general.git_config:
name: user.email
scope: system
value: admin@maiertobi.de