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
type: kubernetes
name: k3s_cluster
name: 'Provision K3s cluster'
volumes:
- name: scratch
claim:
name: flexvolsmb-drone-scratch
steps:
- name: Apply playbook
- name: Run Ansible playbook
image: bv11-cr01.bessems.eu/library/packer-extended
pull: always
commands:
@ -27,3 +32,20 @@ steps:
from_secret: root_password
# private_key:
# 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
- cluster.k3s.yml
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
# community.vmware.vmware_guest:
community.vmware.vmware_deploy_ovf:
hostname: "{{ hv.hostname }}"
username: "{{ hv.username }}"
@ -20,7 +23,7 @@
networks:
"LAN": "{{ hv.network }}"
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 }}"
properties:
guestinfo.hostname: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum)[-5:] | upper }}"

View File

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