Download OVA;Add scratch volume;Reference url as variable
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2022-04-19 09:10:44 +02:00
parent 1250b1461a
commit 73daee6e7b
3 changed files with 30 additions and 4 deletions

View File

@ -1,9 +1,14 @@
kind: pipeline kind: pipeline
type: kubernetes type: kubernetes
name: k3s_cluster name: 'Provision K3s cluster'
volumes:
- name: scratch
claim:
name: flexvolsmb-drone-scratch
steps: steps:
- name: Apply playbook - name: Run Ansible playbook
image: bv11-cr01.bessems.eu/library/packer-extended image: bv11-cr01.bessems.eu/library/packer-extended
pull: always pull: always
commands: commands:
@ -27,3 +32,20 @@ steps:
from_secret: root_password from_secret: root_password
# private_key: # private_key:
# from_secret: ssh_privatekey # from_secret: ssh_privatekey
volumes:
- name: scratch
path: /scratch
- name: Remove temporary resources
image: bv11-cr01.bessems.eu/library/packer-extended
pull: always
commands:
- |
rm /scratch/* -Rf
volumes:
- name: scratch
path: /scratch
when:
status:
- success
- failure

View File

@ -4,8 +4,11 @@
- hypervisor.vcenter.yml - hypervisor.vcenter.yml
- cluster.k3s.yml - cluster.k3s.yml
tasks: tasks:
- name: Download OVF-template
ansible.builtin.get_url:
url: "https://{{ repo_username }}:{{ repo_password }}@{{ image.ova_url }}"
dest: /scratch/image.ova
- name: Deploy VMs from OVF-template - name: Deploy VMs from OVF-template
# community.vmware.vmware_guest:
community.vmware.vmware_deploy_ovf: community.vmware.vmware_deploy_ovf:
hostname: "{{ hv.hostname }}" hostname: "{{ hv.hostname }}"
username: "{{ hv.username }}" username: "{{ hv.username }}"
@ -20,7 +23,7 @@
networks: networks:
"LAN": "{{ hv.network }}" "LAN": "{{ hv.network }}"
power_on: yes power_on: yes
ovf: "https://{{ repo_username }}:{{ repo_password }}@sn.itch.fyi/Repository/rel/Ubuntu-Server-20.04.ova" ovf: /scratch/image.ova
deployment_option: "{{ image.deployment_option }}" deployment_option: "{{ image.deployment_option }}"
properties: properties:
guestinfo.hostname: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum)[-5:] | upper }}" guestinfo.hostname: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum)[-5:] | upper }}"

View File

@ -3,6 +3,7 @@ kubernetes:
clustername: k3s-dev clustername: k3s-dev
image: image:
deployment_option: large deployment_option: large
ova_url: sn.itch.fyi/Repository/rel/Ubuntu-Server-20.04.ova
servers: servers:
- ip: 192.168.11.121/24 - ip: 192.168.11.121/24
guest_id: ubuntu64Guest guest_id: ubuntu64Guest