split out into role_incus

This commit is contained in:
Radar231 2024-01-03 06:45:52 -05:00
parent b78e5f4ab3
commit 9a585ff6b3
1 changed files with 4 additions and 51 deletions

View File

@ -5,6 +5,8 @@
#
# - installation instructions from https://github.com/zabbly/incus#installation
#
# - expects variable named "username" be defined, to define administrative user
#
###########################################################################
- hosts: all
@ -14,56 +16,7 @@
vars:
username: "rmorrow"
tasks:
############################################################
- name: Ensure required supporting packages are installed (Debian)
apt:
name:
- ca-certificates
- curl
- wget
- gnupg
- lsb-release
state: present
when: ansible_distribution == "Debian"
############################################################
- name: Retrieve GPG key (Debian)
shell:
cmd: >
curl -fsSL
https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc
############################################################
- name: Add the repository (Debian)
shell: |
cat <<EOF > /etc/apt/sources.list.d/zabbly-incus-stable.sources
Enabled: yes
Types: deb
URIs: https://pkgs.zabbly.com/incus/stable
Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/zabbly.asc
EOF
############################################################
- name: Update package cache (Ubuntu/Debian)
apt:
update-cache: true
############################################################
- name: Install package (Ubuntu/Debian)
apt:
name:
- incus
############################################################
- name: Add user to 'incus-admin' group
user:
name: "{{ username }}"
append: true
groups: "incus-admin"
roles:
- role: incus
# EOF