diff --git a/salt/libvirt/init.sls b/salt/libvirt/init.sls index 7d1d19240..f4c9e1d5b 100644 --- a/salt/libvirt/init.sls +++ b/salt/libvirt/init.sls @@ -7,6 +7,7 @@ include: - libvirt.packages + - libvirt.ssh.users install_libvirt: pkg.installed: @@ -65,6 +66,8 @@ disable_default_bridge: - name: virsh net-destroy default && virsh net-autostart default --disable - require: - pkg: install_libvirt-client + - onlyif: + - virsh net-info | grep default # this should only run during the first highstate after setup. it will transfer connection from mgmt to br0 down_original_mgmt_interface: diff --git a/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja b/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja index 1a5243666..6bc914fd1 100644 --- a/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja +++ b/salt/salt/cloud/cloud.profiles.d/socloud.conf.jinja @@ -49,15 +49,14 @@ sensor: sls_list: - setHostname -{%- for node_type, hosts in HYPERVISORS.items() %} -{%- for host in hosts %} +{%- for host in HYPERVISORS %} core-{{host}}: provider: kvm-ssh-{{host}} base_domain: jppol9vm ip_source: qemu-agent - ssh_username: onionuser - private_key: /home/onionuser/.ssh/id_ed25519 + ssh_username: soqemussh + private_key: /home/soqemussh/.ssh/id_ed25519 sudo: True deploy_command: sh /tmp/.saltcloud-*/deploy.sh script_args: -F -x python3 stable 3006.1 @@ -68,5 +67,4 @@ core-{{host}}: sls_list: - setHostname -{%- endfor %} {%- endfor %} diff --git a/salt/salt/cloud/cloud.providers.d/libvirt.conf.jinja b/salt/salt/cloud/cloud.providers.d/libvirt.conf.jinja index 3f18a9124..a8b72faf2 100644 --- a/salt/salt/cloud/cloud.providers.d/libvirt.conf.jinja +++ b/salt/salt/cloud/cloud.providers.d/libvirt.conf.jinja @@ -1,16 +1,10 @@ # Set up a provider with qemu+ssh protocol -#kvm-ssh-jpphype1: -# driver: libvirt -# url: qemu+ssh://soqemussh@jpphype1/system?socket=/var/run/libvirt/libvirt-sock - -{%- for node_type, hosts in HYPERVISORS.items() %} -{%- for host in hosts %} +{%- for host in HYPERVISORS %} kvm-ssh-{{host}}: driver: libvirt url: qemu+ssh://soqemussh@{{host}}/system?socket=/var/run/libvirt/libvirt-sock -{%- endfor %} {%- endfor %} # Or connect to a local libvirt instance diff --git a/salt/salt/cloud/init.sls b/salt/salt/cloud/init.sls index 63c624bdb..3cbb2d991 100644 --- a/salt/salt/cloud/init.sls +++ b/salt/salt/cloud/init.sls @@ -20,7 +20,7 @@ cloud_providers: - name: /etc/salt/cloud.providers.d/libvirt.conf - source: salt://salt/cloud/cloud.providers.d/libvirt.conf.jinja - defaults: - HYPERVISORS: {{pillar.hypervisor.nodes}} + HYPERVISORS: {{pillar.hypervisor.nodes.hypervisor}} - template: jinja cloud_profiles: