Update .gitignore and refactor Ubuntu template playbook to use role for Proxmox template management
This commit is contained in:
33
ansible/playbooks/hello_world_provision.yml
Normal file
33
ansible/playbooks/hello_world_provision.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
- name: Hello World Provisioning
|
||||
hosts: localhost # Run API calls from control node
|
||||
gather_facts: no
|
||||
vars_files:
|
||||
- "../inventory/hosts.ini" # Load connection details if needed manually, OR rely on inventory
|
||||
|
||||
vars:
|
||||
# Target Proxmox Details (override from inventory/extra vars)
|
||||
proxmox_api_host: "192.168.50.100"
|
||||
proxmox_api_user: "root@pam"
|
||||
proxmox_api_password: "Hemroid8" # Consider moving to Vault!
|
||||
proxmox_node: "mercury"
|
||||
|
||||
# VM Spec
|
||||
vmid: 101
|
||||
vm_name: "hello-world-vm"
|
||||
template_name: "ubuntu-2204-cloud"
|
||||
ci_user: "ubuntu"
|
||||
# Replace with your actual public key or pass via -e "ssh_key=..."
|
||||
ssh_keys:
|
||||
- "{{ ssh_key | default('ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI...') }}"
|
||||
|
||||
tasks:
|
||||
- name: Run Proxmox Provision Role
|
||||
include_role:
|
||||
name: proxmox_provision
|
||||
vars:
|
||||
vmid: "{{ vmid }}"
|
||||
vm_name: "{{ vm_name }}"
|
||||
template_name: "{{ template_name }}"
|
||||
ci_user: "{{ ci_user }}"
|
||||
ssh_keys: "{{ ssh_keys }}"
|
||||
Reference in New Issue
Block a user