tf-libvirt/vms/cloudinit.host-victim.cfg
surtur cb3a7f980c
chore: cloudinit updates
* add sleep times
* add creating a call-sign file for ansible (waitpls waits for a certain
  file)
* use more bootcmd (runs early)
* switch to 'package_upgrade: true' everywhere (again)
2021-05-20 06:15:24 +02:00

79 lines
1.8 KiB
YAML

#cloud-config
# vim: ft=yaml
bootcmd:
- sleep 20
runcmd:
- cat /etc/resolv.conf
- uname -r
- timedatectl set-ntp 1
- timedatectl set-timezone Europe/Bratislava
- dnf config-manager --set-enabled cr powertools
- sed -i "s/xfs * defaults *0 0/xfs noatime 0 0/" /etc/fstab
- touch /.plsgo
write_files:
- content: |
[main]
gpg_check=1
installonly_limit=2
clean_requirements_on_remove=True
fastestmirror=True
max_parallel_downloads=7
path: /etc/dnf/dnf.conf
owner: root:root
permissions: '0644'
ssh_pwauth: true
chpasswd:
list: |
root:1234
expire: false
users:
- name: victim
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBtG6NCgdLHX4ztpfvYNRaslKWZcl6KdTc1DehVH4kAL
sudo: ['ALL=(ALL) NOPASSWD:ALL']
shell: /bin/bash
groups: wheel
- name: root
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBtG6NCgdLHX4ztpfvYNRaslKWZcl6KdTc1DehVH4kAL
- name: ansible
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBtG6NCgdLHX4ztpfvYNRaslKWZcl6KdTc1DehVH4kAL
# the tf-ansible key
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ9JEzfMs+O6I5JYRQ+gHWClvCqaNTdop8ncDeSj+RWs
sudo: ['ALL=(ALL) NOPASSWD:ALL']
shell: /bin/bash
groups: wheel
ssh_publish_hostkeys:
enabled: false
ssh:
emit_keys_to_console: false
# hostname is set based on main.tf variables
preserve_hostname: false
fqdn: ${hostname}.${domainname}
hostname: ${hostname}
# reboot after fqdn is set to update the info in libvirt's dnsmasq
power_state:
delay: "+1"
mode: reboot
condition: true
packages:
# install python3; it's a metapackage that points to the latest available
# version in the distro repositories; currently python 3.7.x for centos8
- python3 # for ansible
- sudo
- vim
package_upgrade: true
package_reboot_if_required: true