This repository has been archived on 2024-02-16. You can view files and clone it, but cannot push or open issues or pull requests.
sysconfig/setup.yml

75 lines
2.1 KiB
YAML
Raw Normal View History

2022-01-14 19:46:59 +01:00
---
- name: Setup the system
hosts: all
gather_facts: true
# vars:
# # Determine the fstype of root filesystem
# # PERF: a shorter version but requires `py3-jmespath`: '{{ ansible_mounts | json_query("[?mount == `/`].fstype") | first }}'
# rootfs: '{{ ansible_mounts | selectattr("mount", "equalto", "/") | map(attribute="fstype") | first }}'
pre_tasks:
# FIXME: ansible_mounts doesn't recognise ZFS dataset (yet???)
# Ref: https://github.com/ansible/ansible/issues/24644
- name: Guess fstype of the root filesystem
shell:
cmd: /bin/findmnt -M / -o FSTYPE -f | tail -n 1
register: findmnt_result
- name: Set rootfs variable
set_fact:
rootfs: findmnt_result.stdout
- name: Sanity checks
tags: always
block:
- name: Check user ID
fail:
msg: This playbook should be run as 'root'
when: ansible_real_user_id != 0
- name: Import list of accepted values for custom variables
include_vars:
name: accepted_values
file: ./requirements/accepted_variables.yml
- name: Check defined values of top-level variables
fail:
msg: 'Variable `{{ item }}` needs to be 1 of {{ accepted_values[item] }}'
when: not vars[item] in accepted_values[item]
loop: '{{ accepted_values | flatten }}'
2022-01-14 19:46:59 +01:00
roles:
- role: essential
tags: essential
- role: devd
tags: devd
- role: acpi
tags: acpi
- role: seat
tags: seat
- role: fstab
tags: fstab
2022-01-14 19:46:59 +01:00
- role: nftables
tags: nftables
- role: apparmor
tags: apparmor
- role: auditd
tags: auditd
- role: ntpd
tags: ntpd
2022-01-14 19:46:59 +01:00
- role: cron
tags: cron
- role: networking
tags: networking
2022-01-14 19:46:59 +01:00
- role: libvirt
tags: libvirt
- role: tlp
tags: [laptop, tlp]
- role: dns
tags: dns
- role: usbguard
tags: usbguard
2022-01-14 19:46:59 +01:00
- role: zram
tags: zram
- role: snapshot
tags: snapshot
when: snapshot_tool != 'none'
2022-07-23 13:43:38 +02:00
- role: earlyoom
tags: earlyoom
2022-01-14 19:46:59 +01:00
- role: user
tags: user