initial checkin

This commit is contained in:
Radar231 2023-12-22 23:24:08 -05:00
commit b78e5f4ab3
2 changed files with 82 additions and 0 deletions

13
README.md Normal file
View File

@ -0,0 +1,13 @@
# incus playbook
## Introduction
This role will install incus to the target host.
This playbook can be run using the following command line;
ansible-playbook -i <inventory file | IP,> incus.yml
ie,
ansible-playbook -i 192.168.1.123, incus.yml

69
incus.yml Normal file
View File

@ -0,0 +1,69 @@
---
###########################################################################
#
# This playbook will install incus to the target host.
#
# - installation instructions from https://github.com/zabbly/incus#installation
#
###########################################################################
- hosts: all
gather_facts: true
user: root
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"
# EOF