Add extra parameters;Refactor to different module
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
0ce6f8f876
commit
4a09b34c26
@ -14,9 +14,13 @@ steps:
|
|||||||
- ansible-galaxy collection install -r requirements.yml
|
- ansible-galaxy collection install -r requirements.yml
|
||||||
- |
|
- |
|
||||||
ansible-playbook \
|
ansible-playbook \
|
||||||
--extra-vars "hv_password=$${hv_password}" \
|
--extra-vars "repo_username=$${repo_username} repo_password=$${repo_password} hv_password=$${hv_password}" \
|
||||||
playbook.yml
|
playbook.yml
|
||||||
environment:
|
environment:
|
||||||
|
repo_username:
|
||||||
|
from_secret: repo_username
|
||||||
|
repo_password:
|
||||||
|
from_secret: repo_password
|
||||||
hv_password:
|
hv_password:
|
||||||
from_secret: hv_password
|
from_secret: hv_password
|
||||||
# private_key:
|
# private_key:
|
||||||
|
43
playbook.yml
43
playbook.yml
@ -4,8 +4,9 @@
|
|||||||
- hypervisor.vcenter.yml
|
- hypervisor.vcenter.yml
|
||||||
- cluster.k3s.yml
|
- cluster.k3s.yml
|
||||||
tasks:
|
tasks:
|
||||||
- name: Clone multiple VMs from template
|
- name: Deploy VMs from OVF-template
|
||||||
community.vmware.vmware_guest:
|
# community.vmware.vmware_guest:
|
||||||
|
community.vmware.vmware_deploy_ovf:
|
||||||
hostname: "{{ hv.hostname }}"
|
hostname: "{{ hv.hostname }}"
|
||||||
username: "{{ hv.username }}"
|
username: "{{ hv.username }}"
|
||||||
password: "{{ hv_password }}"
|
password: "{{ hv_password }}"
|
||||||
@ -13,25 +14,27 @@
|
|||||||
datacenter: "{{ hv.datacenter }}"
|
datacenter: "{{ hv.datacenter }}"
|
||||||
folder: "{{ hv.folder }}"
|
folder: "{{ hv.folder }}"
|
||||||
cluster: "{{ hv.cluster }}"
|
cluster: "{{ hv.cluster }}"
|
||||||
name: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum | regex_replace('[0-9]', ''))[-5:] | upper }}"
|
ovf: "https://{{ repo_username }}:{{ repo_password }}@sn.itch.fyi/Repository/rel/Ubuntu-Server-20.04.ova"
|
||||||
guest_id: "{{ item.guest_id }}"
|
name: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum)[-5:] | upper }}"
|
||||||
hardware:
|
# guest_id: "{{ item.guest_id }}"
|
||||||
memory_mb: 8192
|
# hardware:
|
||||||
num_cpus: 4
|
# memory_mb: 8192
|
||||||
disk:
|
# num_cpus: 4
|
||||||
- size_gb: 50
|
# disk:
|
||||||
type: thin
|
# - size_gb: 50
|
||||||
|
# type: thin
|
||||||
datastore: "{{ hv.datastore }}"
|
datastore: "{{ hv.datastore }}"
|
||||||
networks:
|
# networks:
|
||||||
- name: "{{ hv.network }}"
|
# - name: "{{ hv.network }}"
|
||||||
ip: "{{ item.ip | ansible.utils.ipaddr('address') }}"
|
# ip: "{{ item.ip | ansible.utils.ipaddr('address') }}"
|
||||||
netmask: "{{ item.ip | ansible.utils.ipaddr('netmask') }}"
|
# netmask: "{{ item.ip | ansible.utils.ipaddr('netmask') }}"
|
||||||
cdrom:
|
# cdrom:
|
||||||
- type: iso
|
# - type: iso
|
||||||
iso_path: "[{{ hv.isodatastore }}] {{ item.iso_path }}"
|
# iso_path: "[{{ hv.isodatastore }}] {{ item.iso_path }}"
|
||||||
controller_number: 0
|
# controller_number: 0
|
||||||
unit_number: 0
|
# unit_number: 0
|
||||||
state: poweredon
|
# state: poweredon
|
||||||
|
power_on: yes
|
||||||
# customization_spec: "{{ customization_spec }}"
|
# customization_spec: "{{ customization_spec }}"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
with_items: "{{ servers }}"
|
with_items: "{{ servers }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user