lab:ansible_virtualbox_autoboot_linux:customize_user-data_for_ubuntu_unattended_install
This is an old revision of the document!
Customize user-data for Ubuntu Unattended Install
A custom “user-data” file is required for an unattended installation of Ubuntu. We will create this template file for use in our Ansible playbook to Generate Custom Unattended Ubuntu Install ISO.
The file below is in development
- user-data.j2
#cloud-config autoinstall: version: 1 ssh: install-server: true # option "allow-pw" defaults to `true` if authorized_keys is empty, `false` otherwise. allow-pw: false storage: layout: name: lvm match: size: largest user-data: diable_root: true timezone: America/New_York package_upgrade: true packages: - network-manager - lldpd - git - python3-pip - ansible - arp-scan users: - name: {{ Global.username }} primary_group: users groups: sudo lock_passwd: true # passwd: "$5$IWwNqL9VUSDoc4Jv$DEUGR.cZQcbz/QvdCOmU13fX5ZW0rANg8LqkAtX3nBA" # changeme shell: /bin/bash ssh_authorized_keys: - "{{ Global.ssh_key }}" sudo: ALL=(ALL) NOPASSWD:ALL ansible: install_method: pip package_name: ansible #run_user: ansible galaxy: actions: - ["ansible-galaxy", "collection", "install", "community.general"] late-commands: # randomly generate the hostname & show the IP at boot - echo "{{ Global.system_name_prefix }}-$(openssl rand -hex 3)" > /target/etc/hostname # dump the IP out at login screen - echo "Ubuntu 22.04 LTS \nIP - $(hostname -I)\n" > /target/etc/issue
Next Step
You now ready to generate a customer unattended Ubuntu server install ISO file
Or back to Install Oracle VirtualBox using Ansible
lab/ansible_virtualbox_autoboot_linux/customize_user-data_for_ubuntu_unattended_install.1705619835.txt.gz · Last modified: 2024/01/18 23:17 by user