ref(base): Rename guest playbook to void_base
Sets up the void basics while other playbooks handle other things
This commit is contained in:
parent
a3df7eeb27
commit
f77a5c4e33
2 changed files with 3 additions and 3 deletions
107
void_base.yaml
Normal file
107
void_base.yaml
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
- name: Install void base system
|
||||
hosts: guest
|
||||
become: true
|
||||
vars:
|
||||
ansible_chroot_exe: arch-chroot
|
||||
tasks:
|
||||
# Prefer booster to dracut so make sure to never install it
|
||||
- name: Ignore dracut
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/xbps.d/ignore-dracut.conf
|
||||
line: ignorepkg=dracut
|
||||
state: present
|
||||
create: true # create file if absent
|
||||
|
||||
- name: Update xbps and system
|
||||
community.general.xbps:
|
||||
name:
|
||||
- xbps
|
||||
state: latest
|
||||
update_cache: true
|
||||
upgrade: true
|
||||
|
||||
- name: Install Base system
|
||||
community.general.xbps:
|
||||
name:
|
||||
- base-system
|
||||
state: present
|
||||
|
||||
- name: Get rid of temporary container metapackage
|
||||
community.general.xbps:
|
||||
name:
|
||||
- base-container-full
|
||||
state: absent
|
||||
|
||||
- name: Install booster
|
||||
community.general.xbps:
|
||||
name: booster
|
||||
state: present
|
||||
notify: installed-booster
|
||||
|
||||
handlers:
|
||||
- name: List kernel module dirs
|
||||
ansible.builtin.find:
|
||||
paths: "/usr/lib/modules"
|
||||
file_type: directory
|
||||
register: found_kernels
|
||||
listen: installed-booster
|
||||
|
||||
- name: Find kernels
|
||||
ansible.builtin.set_fact:
|
||||
kernel_list: "{{ found_kernels['files'] | map(attribute='path') | map('regex_replace', '^.*/(.*)$', '\\1') | list }}"
|
||||
listen: installed-booster
|
||||
|
||||
- name: Create booster initramfs
|
||||
vars:
|
||||
fname: /boot/booster-void
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- booster
|
||||
- --verbose
|
||||
- build
|
||||
- --kernel-version={{ item }}
|
||||
- "{{ fname }}-{{ item }}.img"
|
||||
creates: "{{ fname }}-{{ item }}.img"
|
||||
loop: "{{ kernel_list }}"
|
||||
listen: installed-booster
|
||||
|
||||
- name: Configure void base system
|
||||
hosts: guest
|
||||
become: true
|
||||
vars:
|
||||
host_name: voider
|
||||
timezone: Europe/Berlin
|
||||
locales_enabled:
|
||||
- en_US.UTF-8 UTF-8
|
||||
|
||||
tasks:
|
||||
- name: Set hostname
|
||||
ansible.builtin.template:
|
||||
src: hostname.tpl
|
||||
dest: /etc/hostname
|
||||
|
||||
- name: Set timezone
|
||||
ansible.builtin.file:
|
||||
path: /etc/localtime
|
||||
src: /usr/share/zoneinfo/{{ timezone }}
|
||||
state: link
|
||||
|
||||
- name: Set glibc locales
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/default/libc-locales
|
||||
regexp: "^{{ item }}"
|
||||
line: "{{ item }}"
|
||||
state: present
|
||||
create: true
|
||||
loop: "{{ locales_enabled }}"
|
||||
notify: glibc-locales-changed
|
||||
|
||||
handlers:
|
||||
- name: Regenerate locales
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- xbps-reconfigure
|
||||
- --force
|
||||
- libc-locales
|
||||
listen: glibc-locales-changed
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue