No description
Find a file
Mark van Huijstee 051d665cd7
Merge pull request #11 from de-it-krachten/dev
Update supported platforms & CI (2026-03-14)
2026-03-15 12:35:46 +01:00
.github/workflows Update supported platforms & CI 2026-03-14 19:17:23 +01:00
defaults feat: Add support for Ubuntu 24.04 2026-02-27 01:54:21 +01:00
meta feat: Add support for Ubuntu 24.04 2026-02-27 01:54:21 +01:00
molecule/default Update supported platforms & CI 2026-03-14 14:33:04 +01:00
tasks feat: Add support for Ubuntu 24.04 2026-02-27 01:54:21 +01:00
templates feat: Add support for Ubuntu 24.04 2026-02-27 01:54:21 +01:00
.ansible-lint feat: Initial release 2024-02-10 12:12:30 +01:00
.cicd Update CI 2026-03-06 21:26:41 +01:00
.cicd.overwrite Update CI 2026-03-06 21:27:34 +01:00
.collections feat: Initial release 2024-02-10 12:12:30 +01:00
.gitignore feat: Update supported platforms & CI 2024-12-29 01:09:18 +01:00
.releaserc.yml feat: Add support for Ubuntu 24.04 2026-02-27 01:54:21 +01:00
.roles feat: Initial release 2024-02-10 12:12:30 +01:00
.yamllint feat: Update supported platforms & CI 2024-12-29 01:09:18 +01:00
CHANGELOG.md chore(release): 1.4.0 [skip ci] 2026-03-06 16:34:04 +00:00
README.md feat: Add support for Ubuntu 24.04 2026-02-27 01:54:21 +01:00

CI

ansible-role-autoinstall

Creates autoinstall file to Ubuntu installation.

Dependencies

Roles

None

Collections

None

Platforms

Supported platforms

  • Ubuntu 22.04 LTS
  • Ubuntu 24.04 LTS

Note: 1 : no automated testing is performed on these platforms

Role Variables

defaults/main.yml


# Hostname
autoinstall_hostname: template-ubuntu2404

# Autoinstall distribution
autoinstall_distro: ubuntu2404

# Autoinstall bios mode (uefi or legacy)
autoinstall_bios_mode: uefi

# possible type: fdd, iso, iso-internal, file
autoinstall_format: iso

# Cloudinit location
autoinstall_path: /tmp/{{ autoinstall_hostname }}.iso

# Autoinstall template
autoinstall_template: "{{ autoinstall_distro }}/user-data-{{ autoinstall_bios_mode }}.yml.j2"

autoinstall_packages:
  RedHat:
    - p7zip
    - p7zip-plugins
    - genisoimage
    - xorriso
    - rsync
    - cloud-utils
  Debian:
    - p7zip
    - p7zip-full
    - genisoimage
    - xorriso
    - rsync
    - cloud-image-utils

autoinstall_network:
  hostname: "{{ autoinstall_hostname }}"
  devices:
    - device: "{{ autoinstall_network_device }}"
      dhcp: true
      optional: false
#    - device: ens192
#      ip: [ '192.168.1.100/24' ]
#      optional: false
#      dhcp: false

# Users
autoinstall_users:
  root_password: root
  ansible_user: ansible
  ansible_password: ansible

# Configure LVM storage
autoinstall_configure_storage: true

autoinstall_storage:
  legacy:
    disk:
      - { name: sda, id: disk-sda, lvm: false, grub_device: true }
      # - { name: sdb, id: disk-sdb, lvm: true }
    partition:
      - { name: grub, id: partition-0, device: disk-sda, size: 1M, flag: bios_grub }
      - { name: boot, id: partition-1, device: disk-sda, size: 1G }
      - { name: lvm, id: partition-2, device: disk-sda, size: -1 }
      # - { name: disk2, id: partition-3, device: disk-sdb, size: -1 }
    filesystem:
      - { name: boot, id: format-0, type: ext4, partition: partition-1 }
    lvm:
      vg:
        - { name: rootvg, id: lvm_volgroup-0, devices: [ partition-2 ] }
        # - { name: datavg, id: lvm_volgroup-1, devices: [ partition-3 ] }
      lv:
        - { name: lv_root, id: lvm_partition-0, vg: lvm_volgroup-0, size: 8G }
        - { name: lv_home, id: lvm_partition-1, vg: lvm_volgroup-0, size: 10G }
        - { name: lv_var, id: lvm_partition-2, vg: lvm_volgroup-0, size: 4G }
        - { name: lv_varlog, id: lvm_partition-3, vg: lvm_volgroup-0, size: 5G }
        - { name: lv_usrlocal, id: lvm_partition-4, vg: lvm_volgroup-0, size: 1G }
        - { name: lv_opt, id: lvm_partition-5, vg: lvm_volgroup-0, size: 4G }
        - { name: lv_tmp, id: lvm_partition-6, vg: lvm_volgroup-0, size: 4G }
      fs:
        - { name: lv_root, id: format-3, lv: lvm_partition-0, type: ext4 }
        - { name: lv_home, id: format-4, lv: lvm_partition-1, type: ext4 }
        - { name: lv_var, id: format-5, lv: lvm_partition-2, type: ext4 }
        - { name: lv_varlog, id: format-6, lv: lvm_partition-3, type: ext4 }
        - { name: lv_usrlocal, id: format-7, lv: lvm_partition-4, type: ext4 }
        - { name: lv_opt, id: format-8, lv: lvm_partition-5, type: ext4 }
        - { name: lv_tmp, id: format-9, lv: lvm_partition-6, type: ext4 }
    mount:
      - { path: /, id: mount-3, device: format-3 }
      - { path: /home, id: mount-4, device: format-4 }
      - { path: /var, id: mount-5, device: format-5 }
      - { path: /var/log, id: mount-6, device: format-6 }
      - { path: /usr/local, id: mount-7, device: format-7 }
      - { path: /opt, id: mount-8, device: format-8 }
      - { path: /tmp, id: mount-9, device: format-9 }
      - { path: /boot, id: mount-10, device: format-0 }
  uefi:
    disk:
      - { name: sda, id: disk-sda, lvm: false }
      # - { name: sdb, id: disk-sdb, lvm: true }
    partition:
      - { name: efi, id: partition-0, device: disk-sda, size: 1G, flag: 'boot', grub_device: true }
      - { name: boot, id: partition-1, device: disk-sda, size: 1G }
      - { name: lvm, id: partition-2, device: disk-sda, size: -1 }
    filesystem:
      - { name: boot, id: format-0, type: fat32, partition: partition-0 }
      - { name: boot, id: format-1, type: ext4, partition: partition-1 }
    lvm:
      vg:
        - { name: rootvg, id: lvm_volgroup-0, devices: [ partition-2 ] }
      lv:
        - { name: lv_root, id: lvm_partition-0, vg: lvm_volgroup-0, size: 8G }
        - { name: lv_home, id: lvm_partition-1, vg: lvm_volgroup-0, size: 10G }
        - { name: lv_var, id: lvm_partition-2, vg: lvm_volgroup-0, size: 4G }
        - { name: lv_varlog, id: lvm_partition-3, vg: lvm_volgroup-0, size: 5G }
        - { name: lv_usrlocal, id: lvm_partition-4, vg: lvm_volgroup-0, size: 1G }
        - { name: lv_opt, id: lvm_partition-5, vg: lvm_volgroup-0, size: 4G }
        - { name: lv_tmp, id: lvm_partition-6, vg: lvm_volgroup-0, size: 4G }
      fs:
        - { name: lv_root, id: format-3, lv: lvm_partition-0, type: ext4 }
        - { name: lv_home, id: format-4, lv: lvm_partition-1, type: ext4 }
        - { name: lv_var, id: format-5, lv: lvm_partition-2, type: ext4 }
        - { name: lv_varlog, id: format-6, lv: lvm_partition-3, type: ext4 }
        - { name: lv_usrlocal, id: format-7, lv: lvm_partition-4, type: ext4 }
        - { name: lv_opt, id: format-8, lv: lvm_partition-5, type: ext4 }
        - { name: lv_tmp, id: format-9, lv: lvm_partition-6, type: ext4 }
    mount:
      - { path: /, id: mount-3, device: format-3 }
      - { path: /home, id: mount-4, device: format-4 }
      - { path: /var, id: mount-5, device: format-5 }
      - { path: /var/log, id: mount-6, device: format-6 }
      - { path: /usr/local, id: mount-7, device: format-7 }
      - { path: /opt, id: mount-8, device: format-8 }
      - { path: /tmp, id: mount-9, device: format-9 }
      - { path: /boot, id: mount-10, device: format-1 }
      - { path: /boot/efi, id: mount-11, device: format-0 }


# Create autoinstall enabled vendor ISO
autoinstall_update_vendor_iso: false

# Type of autoinstall vendor iso to create (generic or custom)
autoinstall_iso_type: generic

# Cleanup at exit
autoinstall_cleanup: true

# Temporary path to use
autoinstall_iso_tmpdir: /tmp/toos

# Final command to issue at the end of the installation
autoinstall_final_command: "shutdown -h now"

Example Playbook

molecule/default/converge.yml


- name: sample playbook for role 'autoinstall'
  hosts: all
  become: 'yes'
  vars:
    molecule_driver: '{{ lookup(''env'', ''MOLECULE_DRIVER_NAME'') }}'
    management_server_iso_location: /tmp
    autoinstall_hostname: localhost
    autoinstall_network_device: enp0s3
    autoinstall_bios_mode: uefi
    autoinstall_format: file
    autoinstall_path: /tmp/{{ autoinstall_hostname }}.yml
    autoinstall_network:
      hostname: server.example.com
      devices:
        - device: enp0s3
          dhcp: true
    autoinstall_storage:
      legacy:
        disk:
          - name: sda
            id: disk-sda
            lvm: false
            grub_device: true
        partition:
          - name: grub
            id: partition-0
            device: disk-sda
            size: 1M
            flag: bios_grub
          - name: boot
            id: partition-1
            device: disk-sda
            size: 1G
          - name: lvm
            id: partition-2
            device: disk-sda
            size: -1
        filesystem:
          - name: boot
            id: format-0
            type: ext4
            partition: partition-1
        lvm:
          vg:
            - name: rootvg
              id: lvm_volgroup-0
              devices:
                - partition-2
          lv:
            - name: lv_root
              id: lvm_partition-0
              vg: lvm_volgroup-0
              size: 8G
            - name: lv_home
              id: lvm_partition-1
              vg: lvm_volgroup-0
              size: 10G
            - name: lv_var
              id: lvm_partition-2
              vg: lvm_volgroup-0
              size: 4G
            - name: lv_varlog
              id: lvm_partition-3
              vg: lvm_volgroup-0
              size: 5G
            - name: lv_usrlocal
              id: lvm_partition-4
              vg: lvm_volgroup-0
              size: 1G
            - name: lv_opt
              id: lvm_partition-5
              vg: lvm_volgroup-0
              size: 4G
            - name: lv_tmp
              id: lvm_partition-6
              vg: lvm_volgroup-0
              size: 4G
          fs:
            - name: lv_root
              id: format-3
              lv: lvm_partition-0
              type: ext4
            - name: lv_home
              id: format-4
              lv: lvm_partition-1
              type: ext4
            - name: lv_var
              id: format-5
              lv: lvm_partition-2
              type: ext4
            - name: lv_varlog
              id: format-6
              lv: lvm_partition-3
              type: ext4
            - name: lv_usrlocal
              id: format-7
              lv: lvm_partition-4
              type: ext4
            - name: lv_opt
              id: format-8
              lv: lvm_partition-5
              type: ext4
            - name: lv_tmp
              id: format-9
              lv: lvm_partition-6
              type: ext4
        mount:
          - path: /
            id: mount-3
            device: format-3
          - path: /home
            id: mount-4
            device: format-4
          - path: /var
            id: mount-5
            device: format-5
          - path: /var/log
            id: mount-6
            device: format-6
          - path: /usr/local
            id: mount-7
            device: format-7
          - path: /opt
            id: mount-8
            device: format-8
          - path: /tmp
            id: mount-9
            device: format-9
          - path: /boot
            id: mount-10
            device: format-0
      uefi:
        disk:
          - name: sda
            id: disk-sda
            lvm: false
        partition:
          - name: efi
            id: partition-0
            device: disk-sda
            size: 1G
            flag: boot
            grub_device: true
          - name: boot
            id: partition-1
            device: disk-sda
            size: 1G
          - name: lvm
            id: partition-2
            device: disk-sda
            size: -1
        filesystem:
          - name: boot
            id: format-0
            type: fat32
            partition: partition-0
          - name: boot
            id: format-1
            type: ext4
            partition: partition-1
        lvm:
          vg:
            - name: rootvg
              id: lvm_volgroup-0
              devices:
                - partition-2
          lv:
            - name: lv_root
              id: lvm_partition-0
              vg: lvm_volgroup-0
              size: 8G
            - name: lv_home
              id: lvm_partition-1
              vg: lvm_volgroup-0
              size: 10G
            - name: lv_var
              id: lvm_partition-2
              vg: lvm_volgroup-0
              size: 4G
            - name: lv_varlog
              id: lvm_partition-3
              vg: lvm_volgroup-0
              size: 5G
            - name: lv_usrlocal
              id: lvm_partition-4
              vg: lvm_volgroup-0
              size: 1G
            - name: lv_opt
              id: lvm_partition-5
              vg: lvm_volgroup-0
              size: 4G
            - name: lv_tmp
              id: lvm_partition-6
              vg: lvm_volgroup-0
              size: 4G
          fs:
            - name: lv_root
              id: format-3
              lv: lvm_partition-0
              type: ext4
            - name: lv_home
              id: format-4
              lv: lvm_partition-1
              type: ext4
            - name: lv_var
              id: format-5
              lv: lvm_partition-2
              type: ext4
            - name: lv_varlog
              id: format-6
              lv: lvm_partition-3
              type: ext4
            - name: lv_usrlocal
              id: format-7
              lv: lvm_partition-4
              type: ext4
            - name: lv_opt
              id: format-8
              lv: lvm_partition-5
              type: ext4
            - name: lv_tmp
              id: format-9
              lv: lvm_partition-6
              type: ext4
        mount:
          - path: /
            id: mount-3
            device: format-3
          - path: /home
            id: mount-4
            device: format-4
          - path: /var
            id: mount-5
            device: format-5
          - path: /var/log
            id: mount-6
            device: format-6
          - path: /usr/local
            id: mount-7
            device: format-7
          - path: /opt
            id: mount-8
            device: format-8
          - path: /tmp
            id: mount-9
            device: format-9
          - path: /boot
            id: mount-10
            device: format-1
          - path: /boot/efi
            id: mount-11
            device: format-0
  tasks:
    - name: Include role 'autoinstall'
      ansible.builtin.include_role:
        name: autoinstall