Several fixes by Gemma, unverified

This commit is contained in:
2026-06-10 17:10:50 +02:00
parent c4483d46d6
commit 51fd19f45a
6 changed files with 18 additions and 46 deletions
@@ -1,12 +1,5 @@
---
- name: Generate Ignition config for CoreOS/Flatcar
- name: Generate Cloud-init config
template:
src: ignition.json.j2
dest: "/tmp/{{ vm_name }}_ignition.json"
when: os_type == "coreos" or os_type == "flatcar"
- name: Generate Cloud-init config for MicroOS
template:
src: user-data.yaml.j2
src: "{{ 'user-data-coreos.yaml.j2' if os_type in ['coreos', 'flatcar'] else 'user-data.yaml.j2' }}"
dest: "/tmp/{{ vm_name }}_user-data"
when: os_type == "microos"
@@ -1,26 +0,0 @@
{
"ignition": {
"version": "0.3.0"
},
"passwd": {
"users": [
{
"name": "{{ vm_user }}",
"password_hash": "{{ vm_password | password_hash('sha512') }}",
"ssh_public_keys": [
"{{ lookup('file', vm_ssh_public_key) }}"
]
}
]
},
"storage": {
"files": [
{
"path": "/etc/ssh/sshd_config.d/permit_root_login.conf",
"contents": {
"source": "data:text/plain;charset=utf-8,PermitRootLogin yes"
}
}
]
}
}
@@ -0,0 +1,11 @@
#cloud-config
users:
- name: {{ vm_user }}
passwd: {{ vm_password | password_hash('sha512') }}
ssh_authorized_keys:
- {{ lookup('file', vm_ssh_public_key | replace('~', lookup('env', 'HOME'))) }}
sudo: ALL=(ALL) NOPASSWD:ALL
write_files:
- path: /etc/ssh/sshd_config.d/permit_root_login.conf
content: |
PermitRootLogin yes
@@ -3,6 +3,6 @@ users:
- name: {{ vm_user }}
passwd: {{ vm_password | password_hash('sha512') }}
ssh_authorized_keys:
- {{ lookup('file', vm_ssh_public_key) }}
- {{ lookup('file', vm_ssh_public_key | replace('~', lookup('env', 'HOME'))) }}
sudo: ALL=(ALL) NOPASSWD:ALL
lock_passwd: false
@@ -54,11 +54,8 @@
--graphics none \
--noautoconsole \
--boot uefi \
{% if os_type == 'coreos' or os_type == 'flatcar' %}
--cloud-init user-data=/tmp/{{ vm_name }}_ignition.json
{% elif os_type == 'microos' %}
--cloud-init user-data=/tmp/{{ vm_name }}_user-data
{% endif %}
args:
args:
creates: "/etc/libvirt/qemu/{{ vm_name }}.xml"