mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-14 05:45:06 +03:00
CI/kubevirt: Configure ignition provisioning
Flatcar does not support cloud-init
This commit is contained in:
committed by
ChengHao Yang
parent
3597b8d7fe
commit
2fbbf2e1e4
@@ -55,13 +55,5 @@ spec:
|
||||
containerDisk:
|
||||
image: quay.io/kubespray/vm-{{ cloud_image }}
|
||||
- name: cloudinitvolume
|
||||
cloudInitConfigDrive:
|
||||
userData: |
|
||||
#cloud-config
|
||||
users:
|
||||
- name: {{ lookup('env', 'ANSIBLE_REMOTE_USER') }}
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
shell: /bin/bash
|
||||
lock_passwd: False
|
||||
ssh_authorized_keys:
|
||||
- {{ ssh_key.public_key }}
|
||||
cloudInit{{ 'ConfigDrive' if cloud_image.startswith('flatcar') else 'NoCloud' }}:
|
||||
userDataBase64: '{{ ((ignition_config | to_json) if cloud_image.startswith('flatcar') else cloudinit_config) | b64encode }}'
|
||||
|
||||
@@ -34,3 +34,25 @@ ci_job_id: "{{ lookup('ansible.builtin.env', 'CI_JOB_ID', default=undefined) }}"
|
||||
pod_name: "{{ lookup('ansible.builtin.env', 'POD_NAME', default=undefined) }}"
|
||||
pod_uid: "{{ lookup('ansible.builtin.env', 'POD_UID', default=undefined) }}"
|
||||
pod_namespace: "{{ lookup('ansible.builtin.env', 'POD_NAMESPACE', default=undefined) }}"
|
||||
|
||||
cloudinit_config: |
|
||||
#cloud-config
|
||||
users:
|
||||
- name: {{ lookup('env', 'ANSIBLE_REMOTE_USER') }}
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
shell: /bin/bash
|
||||
lock_passwd: False
|
||||
ssh_authorized_keys:
|
||||
- {{ ssh_key.public_key }}
|
||||
|
||||
ignition_config:
|
||||
ignition:
|
||||
version: "3.2.0"
|
||||
passwd:
|
||||
users:
|
||||
- name: "{{ lookup('env', 'ANSIBLE_REMOTE_USER') }}"
|
||||
groups:
|
||||
- sudo
|
||||
- wheel
|
||||
sshAuthorizedKeys:
|
||||
- "{{ ssh_key.public_key }}"
|
||||
|
||||
Reference in New Issue
Block a user