Add extra parameters;Refactor to different module
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Danny Bessems 2022-04-18 22:49:50 +02:00
parent 0ce6f8f876
commit 4a09b34c26
2 changed files with 29 additions and 22 deletions

View File

@ -14,9 +14,13 @@ steps:
- ansible-galaxy collection install -r requirements.yml
- |
ansible-playbook \
--extra-vars "hv_password=$${hv_password}" \
--extra-vars "repo_username=$${repo_username} repo_password=$${repo_password} hv_password=$${hv_password}" \
playbook.yml
environment:
repo_username:
from_secret: repo_username
repo_password:
from_secret: repo_password
hv_password:
from_secret: hv_password
# private_key:

View File

@ -4,8 +4,9 @@
- hypervisor.vcenter.yml
- cluster.k3s.yml
tasks:
- name: Clone multiple VMs from template
community.vmware.vmware_guest:
- name: Deploy VMs from OVF-template
# community.vmware.vmware_guest:
community.vmware.vmware_deploy_ovf:
hostname: "{{ hv.hostname }}"
username: "{{ hv.username }}"
password: "{{ hv_password }}"
@ -13,25 +14,27 @@
datacenter: "{{ hv.datacenter }}"
folder: "{{ hv.folder }}"
cluster: "{{ hv.cluster }}"
name: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum | regex_replace('[0-9]', ''))[-5:] | upper }}"
guest_id: "{{ item.guest_id }}"
hardware:
memory_mb: 8192
num_cpus: 4
disk:
- size_gb: 50
type: thin
ovf: "https://{{ repo_username }}:{{ repo_password }}@sn.itch.fyi/Repository/rel/Ubuntu-Server-20.04.ova"
name: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum)[-5:] | upper }}"
# guest_id: "{{ item.guest_id }}"
# hardware:
# memory_mb: 8192
# num_cpus: 4
# disk:
# - size_gb: 50
# type: thin
datastore: "{{ hv.datastore }}"
networks:
- name: "{{ hv.network }}"
ip: "{{ item.ip | ansible.utils.ipaddr('address') }}"
netmask: "{{ item.ip | ansible.utils.ipaddr('netmask') }}"
cdrom:
- type: iso
iso_path: "[{{ hv.isodatastore }}] {{ item.iso_path }}"
controller_number: 0
unit_number: 0
state: poweredon
# networks:
# - name: "{{ hv.network }}"
# ip: "{{ item.ip | ansible.utils.ipaddr('address') }}"
# netmask: "{{ item.ip | ansible.utils.ipaddr('netmask') }}"
# cdrom:
# - type: iso
# iso_path: "[{{ hv.isodatastore }}] {{ item.iso_path }}"
# controller_number: 0
# unit_number: 0
# state: poweredon
power_on: yes
# customization_spec: "{{ customization_spec }}"
delegate_to: localhost
with_items: "{{ servers }}"