diff --git a/libvirt-ansible-python/__main__.py b/libvirt-ansible-python/__main__.py index 88c4078..9799474 100644 --- a/libvirt-ansible-python/__main__.py +++ b/libvirt-ansible-python/__main__.py @@ -6,7 +6,7 @@ import pulumi_command as command import yaml from dotmap import DotMap from jinja2 import Template -from passlib import sha512_crypt +from passlib.hash import sha512_crypt conf = DotMap(yaml.safe_load(open("./input.yaml", "r").read())) diff --git a/libvirt-ansible-python/cloud-init/meta-data.jinja b/libvirt-ansible-python/cloud-init/meta-data.jinja index 3ac6292..30f5b90 100644 --- a/libvirt-ansible-python/cloud-init/meta-data.jinja +++ b/libvirt-ansible-python/cloud-init/meta-data.jinja @@ -1,2 +1,2 @@ -instance-id: {{ conf.name }} -local-hostname: {{ conf.name }} +instance-id: {{ name }} +local-hostname: {{ name }} diff --git a/libvirt-ansible-python/cloud-init/user-data.jinja b/libvirt-ansible-python/cloud-init/user-data.jinja index 75d3a1b..68ccfcf 100644 --- a/libvirt-ansible-python/cloud-init/user-data.jinja +++ b/libvirt-ansible-python/cloud-init/user-data.jinja @@ -1,22 +1,22 @@ #cloud-config resize_rootfs: true users: - - name: {{ conf.username }} + - name: {{ username }} sudo: ALL=(ALL) NOPASSWD:ALL groups: users, admin shell: /bin/bash ssh_authorized_keys: - {% for key in conf.sshkeys %} - - {{ item }} + {% for key in sshkeys %} + - "{{ key }}" {% endfor %} - hashed_passwd: {{ conf.password }} + hashed_passwd: {{ password }} ssh_pwauth: true disable_root: false chpasswd: expire: false list: | - root:{{ conf.password }} - syntaxerrormmm:{{ conf.password }} + root:{{ password }} + syntaxerrormmm:{{ password }} #packages: # - qemu-guest-agent #power_state: diff --git a/libvirt-ansible-python/requirements.txt b/libvirt-ansible-python/requirements.txt index b83b294..0d3f63c 100644 --- a/libvirt-ansible-python/requirements.txt +++ b/libvirt-ansible-python/requirements.txt @@ -1,6 +1,7 @@ pulumi>=3.0.0,<4.0.0 pulumi_libvirt>=0.3.0 pulumi-command>=0.4.1 +pyyaml>=6.0 Jinja2>=3.1.2 dotmap>=1.3.30 passlib>=1.7.4