2.5 KiB
2.5 KiB
Role Name
role-service-generic_machine
Description
Settings and configs for most virtual machines.
Requirements
Your target machines must be Linux.
Role Variables
Per defaults/main.yml this role comes with a whole host of default variables almost all of which are relevant only to Arch Linux machines as that's what we run ourselves. Feel free to override these with host or group vars.
genma_git_repos_base_dir: The base directory where we canonically store checked out Git repos. This defaults to/opt/git. We use this var to construct subdirectory paths underneath that location.genma_pacman_hook_git_base_dir: On Arch Linux we Git clone quico.space/quico-os-setup/zfs-pacman-hook into this location. The repo contains package manager hooks that automatically snapshot the root-on-ZFS filesystem that all of our Arch Linux machines are using.genma_pacman_hook_git_branch: In above repo we're interested in this branch. Can bemainfor example.genma_pacman_hook_auto_snapshot_datasets: Name ZFS datasets that we want to automatically snapshot whenever package manager actions happen. This is a list with one entry by default,zpool/root/archlinux.
The following four plus four vars deal with Git cloning firstly, a repo with a script that detects the need to a system reboot on Arch Linux and secondly, a repo that automatically does unattended package upgrades. They follow the same pattern.
Arch Linux reboot detection
genma_os_needs_restart_git_repo: Git clone from this locationgenma_os_needs_restart_git_base_dir: Git clone into this base dirgenma_os_needs_restart_git_branch: Check out this branchgenma_os_needs_restart_git_clone_dir: Git clone into this exact dir (constructed from bothgenma_os_needs_restart_git_base_dirand the branch we want).
Arch Linux unattended package upgrades
genma_os_auto_upgrades_git_repo: Git clone from this locationgenma_os_auto_upgrades_git_base_dir: Git clone into this base dirgenma_os_auto_upgrades_git_branch: Check out this branchgenma_os_auto_upgrades_git_clone_dir: Git clone into this exact dir (constructed from bothgenma_os_auto_upgrades_git_base_dirand the branch we want).
Dependencies
None.
Example Playbook
In your playbook.yml call it like so:
- name: 'Awesome playbook'
hosts: all
roles:
- 'role-service-generic_machine'
License
MIT