57 lines
2.5 KiB
Markdown
57 lines
2.5 KiB
Markdown
[//]: # (SPDX-License-Identifier: MIT)
|
|
# Role Name
|
|
|
|
role-service-generic_vm
|
|
|
|
# Description
|
|
|
|
Settings and configs for most virtual machines.
|
|
|
|
# Requirements
|
|
|
|
Your target machines must be Linux.
|
|
|
|
# Role Variables
|
|
|
|
Per [defaults/main.yml](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.
|
|
|
|
- `genvm_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.
|
|
- `genvm_pacman_hook_git_base_dir`: On Arch Linux we Git clone [quico.space/quico-os-setup/zfs-pacman-hook](https://quico.space/quico-os-setup/zfs-pacman-hook/src/branch/1-get-base-version-going) 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.
|
|
- `genvm_pacman_hook_git_branch`: In above repo we're interested in _this_ branch. Can be `main` for example.
|
|
- `genvm_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
|
|
|
|
- `genvm_os_needs_restart_git_repo`: Git clone from this location
|
|
- `genvm_os_needs_restart_git_base_dir`: Git clone into this base dir
|
|
- `genvm_os_needs_restart_git_branch`: Check out this branch
|
|
- `genvm_os_needs_restart_git_clone_dir`: Git clone into this exact dir (constructed from both `genvm_os_needs_restart_git_base_dir` and the branch we want).
|
|
|
|
## Arch Linux unattended package upgrades
|
|
|
|
- `genvm_os_auto_upgrades_git_repo`: Git clone from this location
|
|
- `genvm_os_auto_upgrades_git_base_dir`: Git clone into this base dir
|
|
- `genvm_os_auto_upgrades_git_branch`: Check out this branch
|
|
- `genvm_os_auto_upgrades_git_clone_dir`: Git clone into this exact dir (constructed from both `genvm_os_auto_upgrades_git_base_dir` and 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_vm'
|
|
```
|
|
|
|
# License
|
|
|
|
MIT
|