incus

Incus Server Ansible Role

test & release

This Ansible role installs Incus from the OS package manager and configures it using a preseed object.

Requirements

None.

Role Variables

NameRequiredType / ChoicesDescription
incus_config yes object

Incus preseed configuration object. See the Incus documentation for details. If you want idempotency checks to work correctly, you have to make sure not to ommit any values which are output by incus admin init --dump, as the role uses the difference between that and this variable to detect changes.

Example:

config: {}
networks:
  - config:
      ipv4.address: none
      ipv4.nat: "true"
      ipv6.address: none
      ipv6.nat: "true"
    description: ""
    name: incusbr0
    type: bridge
    project: default
storage_pools:
  - config:
      source: /var/lib/incus/storage-pools/default
    description: ""
    name: default
    driver: dir
profiles:
  - config:
      security.idmap.isolated: "true"
    description: Default Incus profile
    devices:
      eth0:
        name: eth0
        network: incusbr0
        type: nic
      root:
        path: /
        pool: default
        type: disk
    name: default
projects:
  - config:
      features.images: "true"
      features.networks: "true"
      features.networks.zones: "true"
      features.profiles: "true"
      features.storage.buckets: "true"
      features.storage.volumes: "true"
    description: Default Incus project
    name: default
incus_extra_users no list(string)

This role will always add the ansible user to the incus group, so that it can communicate with the incus unix socket to perform some of the tasks in this role. You can optionally use this variable to specify additional user names to add to the group.

Default: []

incus_subid_offset no integer

Offset configured for the subordinate user IDs and subordinate group IDs in /etc/subuid and /etc/subgid respectively.

Default: 1000000

incus_subid_range no integer

Range configured for the subordinate user IDs and subordinate group IDs in /etc/subuid and /etc/subgid respectively.

Default: 6553600

Dependencies

None.

Example Playbook

- hosts: container_host
  tasks:
    - ansible.builtin.import_role:
        name: gliech.incus
      vars:
        incus_config:
          config: {}
          networks: []
          storage_pools:
            - config:
                source: /var/lib/incus/storage-pools/default
              description: ""
              name: default
              driver: dir
          profiles:
            - config:
                security.privileged: "true"
              description: Default Incus profile
              devices:
                root:
                  path: /
                  pool: default
                  type: disk
              name: default
          projects:
            - config:
                features.images: "true"
                features.networks: "true"
                features.networks.zones: "true"
                features.profiles: "true"
                features.storage.buckets: "true"
                features.storage.volumes: "true"
              description: Default Incus project
              name: default

License

This project is licensed under the terms of the GNU General Public License v3.0

About

Install incus from the os package manager and configure it using a preseed object.

Install
ansible-galaxy install gliech/incus-ansible-role
GitHub repository
License
gpl-3.0
Downloads
284
Owner