Files
aurbis/playbook.yml
T
2026-07-19 21:14:36 +02:00

140 lines
3.7 KiB
YAML

- name: Preprovisioning
hosts: all
become: true
tasks:
- import_tasks: tasks/preprovision.yml
handlers:
- import_tasks: handlers/main.yml
- name: Provision all hosts
hosts: all
become: true
remote_user: nerevar
tasks:
- name: Set hostname
hostname:
name: "{{ inventory_hostname }}"
# - name: Print distribution
# ansible.builtin.debug:
# var: ansible_distribution_release
- name: Add aurbis group
ansible.builtin.group:
name: aurbis
state: present
- name: Enable passwordless sudo for aurbis
community.general.sudoers:
name: aurbis-sudo
state: present
group: aurbis
commands: ALL
- import_tasks: tasks/create_users.yml
- name: Add IP address of relevant hosts to /etc/hosts
lineinfile:
dest: /etc/hosts
regexp: ".*{{ item }}$"
line: "{{ hostvars[item].ansible_host }} {{item}}"
state: present
when:
- hostvars[item].ansible_host is defined
- (inventory_hostname in groups['home'] and (item in groups['home'] or item in groups['cloud'])) or
(inventory_hostname not in groups['home'] and item in groups['cloud'])
with_items: "{{ groups.all }}"
- import_tasks: tasks/motd.yml
- name: Update Debian hosts
hosts: debian
become: true
remote_user: nerevar
tasks:
- name: Update
include_tasks: tasks/update_debian.yml
# azura werkt niet echt mee met updates op het moment
- name: Update Arch hosts
hosts: arch:!azura
become: true
remote_user: nerevar
tasks:
- name: Update
include_tasks: tasks/update_arch.yml
- name: Docker
hosts: debian
become: true
tasks:
- name: Update
include_tasks: tasks/install_docker_debian.yml
- name: Add utility scripts
hosts: all
become: true
remote_user: nerevar
tasks:
- import_tasks: tasks/scripts.yml
- name: Setup zsh
hosts: debian
become: true
remote_user: nerevar
tasks:
- import_tasks: tasks/zsh.yml
- name: Install tmux
hosts: all
become: true
remote_user: nerevar
tasks:
- import_tasks: tasks/tmux.yml
- name: Talos install
hosts: talos
become: true
remote_user: nerevar
tasks:
- import_tasks: tasks/vcmp_timer.yml
- import_tasks: tasks/stash.yml
- import_tasks: tasks/jellyfin.yml
- import_tasks: tasks/wireguard.yml
handlers:
- import_tasks: handlers/main.yml
tags: leaf
- name: Backup host (pull snapshots from cloud)
hosts: backup
become: true
remote_user: nerevar
tasks:
- import_tasks: tasks/backup_pull.yml
tags:
- leaf
- backup
- name: Akatosh install
hosts: akatosh
become: true
remote_user: nerevar
tasks:
- name: Install base tools (minimal cloud image lacks them)
package:
name: [rsync, curl, sqlite3]
state: present
- name: Normalise /opt app ownership to root:aurbis (top dir only, not recursive)
file:
path: "/opt/{{ item }}"
state: directory
owner: root
group: aurbis
mode: "0775"
loop: [nextcloud, hdwiki, gitea, authentik, drone, "hoekveen.net"]
- import_tasks: tasks/nextcloud.yml
- import_tasks: tasks/hdwiki.yml
- import_tasks: tasks/gitea.yml
- import_tasks: tasks/nightingale.yml
- import_tasks: tasks/cloud_nginx.yml
- name: Ensure the backup user can run the forced-command pull
user:
name: backup
shell: /bin/bash
create_home: false
- import_tasks: tasks/backup_source.yml
handlers:
- import_tasks: handlers/main.yml
tags: leaf
- name: Kynareth install
hosts: kynareth
become: true
remote_user: nerevar
tasks:
- import_tasks: tasks/homeassistant.yml
tags: leaf