diff --git a/group_vars/git.yml b/group_vars/git.yml index a4bc832..1c7de95 100644 --- a/group_vars/git.yml +++ b/group_vars/git.yml @@ -1,6 +1,6 @@ --- -datadisk_size: +datadisks: - 10 firewall_in: diff --git a/group_vars/mirror.yml b/group_vars/mirror.yml index c365158..3784714 100644 --- a/group_vars/mirror.yml +++ b/group_vars/mirror.yml @@ -1,6 +1,6 @@ --- -datadisk_size: +datadisks: - 1000 firewall_in: diff --git a/host_vars/ldap01.home.foo.sh.yml b/host_vars/ldap01.home.foo.sh.yml index 16d7271..a36e55f 100644 --- a/host_vars/ldap01.home.foo.sh.yml +++ b/host_vars/ldap01.home.foo.sh.yml @@ -1,7 +1,8 @@ --- interfaces: [[20, "52:54:00:ac:dc:1f"]] vmhost: vmhost01.home.foo.sh -datadisk_size: [10] +datadisks: + - 10 ldap_datadir: /export/ldap ldap_master: true diff --git a/playbooks/include/vm-create.yml b/playbooks/include/vm-create.yml index 47daee2..5a9c9c8 100644 --- a/playbooks/include/vm-create.yml +++ b/playbooks/include/vm-create.yml @@ -12,20 +12,20 @@ os_disk_image: "/srv/libvirt/ssd/{{ inventory_hostname }}.a.img" disk_opts: bus=virtio,cache=none,device=disk,format=raw - extra_disks: >- - {% if datadisk_size is defined %} - {% for num in range(datadisk_size|count) %} - --disk /srv/libvirt/hdd/{{ inventory_hostname }}.{{ letters[num] }}.img,{{ disk_opts }},size={{ datadisk_size[num] }} - {% endfor %} + virt_install_disks: >- + {% if datadisks is defined %} + {% for num in range(datadisks|count) %} + --disk /srv/libvirt/hdd/{{ inventory_hostname }}.{{ letters[num] }}.img,{{ disk_opts }},size={{ datadisks[num] }} + {% endfor %} {% endif %} virt_install_network: >- {% for item in interfaces %} - {% if item[1] is defined %} + {% if item[1] is defined %} --network bridge=br{{ item[0] }},mac={{ item[1] }},model=virtio - {% else %} + {% else %} --network bridge=br{{ item[0] }},model=virtio - {% endif %} + {% endif %} {% endfor %} tasks: @@ -67,8 +67,8 @@ --controller usb,model=none --sound none \ --vcpus "sockets=1,cores={{ num_cpus }},threads=1,placement=auto" \ --memory {{ mem_size }} --cpu host-passthrough \ - --disk {{ os_disk_image }},{{ disk-opts }},size={{ dsk_size }} \ - {{ extra_disks }} --initrd-inject {{ tmpdir.path }}/include.ks \ + --disk {{ os_disk_image }},{{ disk_opts }},size={{ dsk_size }} \ + {{ virt_install_disks }} --initrd-inject {{ tmpdir.path }}/include.ks \ {{ virt_install_network }} \ {{ virt_install_os_args }} delegate_to: localhost