Change back to cloud init
This commit is contained in:
@@ -41,17 +41,6 @@
|
||||
args:
|
||||
creates: "{{ vm_images_dir }}/{{ vm_name }}.qcow2"
|
||||
|
||||
- name: Customize VM image (Inject User/SSH/Sudo)
|
||||
shell: |
|
||||
virt-customize -a {{ vm_images_dir }}/{{ vm_name }}.qcow2 \
|
||||
--run-command "useradd -m -G wheel {{ vm_user }}" \
|
||||
--password {{ vm_user }}:password:{{ vm_password }} \
|
||||
--ssh-inject {{ vm_user }}:file:{{ vm_ssh_public_key | replace('~', lookup('env', 'HOME')) }} && \
|
||||
touch {{ vm_images_dir }}/{{ vm_name }}.customized
|
||||
become: yes
|
||||
args:
|
||||
creates: "{{ vm_images_dir }}/{{ vm_name }}.customized"
|
||||
|
||||
- name: Provision VM using virt-install
|
||||
shell: |
|
||||
virt-install \
|
||||
@@ -64,7 +53,8 @@
|
||||
--network network=default \
|
||||
--graphics none \
|
||||
--noautoconsole \
|
||||
--boot uefi
|
||||
--boot uefi \
|
||||
--cloud-init user-data=/tmp/{{ vm_name }}_user-data
|
||||
args:
|
||||
creates: "/etc/libvirt/qemu/{{ vm_name }}.xml"
|
||||
become: yes
|
||||
|
||||
Reference in New Issue
Block a user