WIP #1
This commit is contained in:
commit
01c3e079d8
25
.drone.yml
Normal file
25
.drone.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: kubernetes
|
||||||
|
name: k3s_cluster
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Apply playbook
|
||||||
|
image: bv11-cr01.bessems.eu/library/packer-extended
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
mkdir ~/.ssh && \
|
||||||
|
echo "$${private_key}" > ~/.ssh/id_rsa && \
|
||||||
|
chmod 0600 ~/.ssh/id_rsa
|
||||||
|
- ansible-galaxy collection install -r requirements.yml
|
||||||
|
- |
|
||||||
|
ansible-playbook \
|
||||||
|
# --inventory inventory.yml \
|
||||||
|
--extra-vars "cifs_username=$${cifs_username} cifs_password=$${cifs_password}" \
|
||||||
|
playbook.yml
|
||||||
|
environment:
|
||||||
|
cifs_username:
|
||||||
|
from_secret: cifs_username
|
||||||
|
cifs_password:
|
||||||
|
from_secret: cifs_password
|
||||||
|
private_key:
|
||||||
|
from_secret: ssh_privatekey
|
20
playbook.yml
Normal file
20
playbook.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
gather_facts: false
|
||||||
|
vars_files:
|
||||||
|
multiple_vms.yml
|
||||||
|
tasks:
|
||||||
|
- name: Clone multiple VMs from template
|
||||||
|
local_action:
|
||||||
|
module: vmware_guest
|
||||||
|
hostname: "{{ vcenter_hostname }}"
|
||||||
|
username: "{{ username }}"
|
||||||
|
password: "{{ password }}"
|
||||||
|
validate_certs: no
|
||||||
|
folder: "{{ folder }}"
|
||||||
|
template: "{{ vmtemplate }}"
|
||||||
|
name: "{{ item.ip }}"
|
||||||
|
cluster: "{{ vmcluster }}"
|
||||||
|
datacenter: CloudLocal
|
||||||
|
state: poweredon
|
||||||
|
customization_spec: "{{ customization_spec }}"
|
||||||
|
with_items: "{{ servers }}"
|
Loading…
Reference in New Issue
Block a user