4 apt install ansible ansible-mitogen
10 ansible-galaxy install -r roles/requirements.yml
15 Privileged data is stored in Bitwarden. To use roles that fetch privileged data,
16 the following utilities must be available:
18 * [bw](https://bitwarden.com/help/cli/)
20 Once installed, login and unlock the vault:
23 bw login # or, `bw unlock`
24 export BW_SESSION=xxxx
31 ansible-playbook -i hosts [-l SUBSET] site.yaml
38 1. Configure either SSH or WinRM connection: see https://docs.ansible.com/ansible/latest/os_guide/windows_setup.html
40 * Install the necessary optional features (eg. OpenSSH, Hyper-V) since Windows RSAT isn't available on Arm64 yet
44 1. Add an entry to the `vms` variable in the host vars for a libvirt host
45 * See the defaults and details in `roles/libvirt/vars/main.yml` and `roles/libvirt/tasks/main.yml`
46 * Make sure to set the `cdrom` key to the path of ISO for the installer
47 2. Run the playbook, eg. `ansible-playbook -i hosts -l cloud07.internal.efficios.com site.yml`
48 * The VM should be created and started
49 3. Once the VM is installed take a snapshot so that Jenkins may revert to the original state
51 ### Ubuntu auto-installer
53 1. Note your IP address
54 2. Switch to the directory with the user-data files: `cd roles/libvirt/files`
55 3. Write out the instance-specific metadata, eg.
60 hostname: XXX.internal.efficios.com
63 * The instance-id is used to determine if re-installation is necessary.
64 4. Start a python web server: `python3 -m http.server 3003`
65 5. Connect to the VM using a remote viewer on the address given by `virsh --connect qemu+ssh://root@host/system domdisplay`
66 6. Edit the grub boot options for the installer and append the following as arguments for the kernel: `autoinstall 'ds=nocloud-net;s=http://IPADDRESS:3003/'` and boot the installer
67 * Note that the trailing `/` and quoting are important
68 * The will load the `user-data`, `meta-data`, and `vendor-data` files in the directory served by the python web server
69 7. After the installation is complete, the system will reboot and run cloud-init for the final portion of the initial setup. Once completed, ansible can be run against it using the ubuntu user and becoming root, eg. `ansible-playbook -i hosts -u ubuntu -b ...`