777926487b
initial QEMU slice, backed by imported contracts for majors 6–9. - Implement durable handlers for access/auth, cluster, LXC, storage, HA, firewall, Ceph, SDN, ACME, notifications, pools, mapping, and node ops - Serve an interactive Web UI with catalog browsing, demo seed controls, and OpenAPI/help surfaces - Bundle PVE 6.4-15, 7.4-16, and 8.4.5 contract revisions alongside 9.2.3 - Support in-memory runtime contract Apply (POST /ui/api/contract/apply) so /version and /api2 routes follow the selected major until restart - Expand seed profiles (including demo-cluster), migrations 007–008, TLS gateway config, Compose/Makefile tooling, and compatibility evidence - Tighten .gitignore for macOS, hidden directories (.*/), and local secrets
113 lines
3.3 KiB
YAML
113 lines
3.3 KiB
YAML
---
|
|
# Lab cookbook against proxmox-api-simulator (HTTP :8006).
|
|
# ansible-playbook -i inventory.ini playbook.yml
|
|
|
|
- name: Proxmox API simulator cookbook
|
|
hosts: simulator
|
|
gather_facts: false
|
|
vars:
|
|
pve_base: "http://localhost:8006/api2/json"
|
|
pve_node: pve01
|
|
pve_vmid: 116
|
|
pve_token: "root@pam!automation=automation-secret"
|
|
auth_header: "PVEAPIToken={{ pve_token }}"
|
|
|
|
tasks:
|
|
- name: Read version
|
|
ansible.builtin.uri:
|
|
url: "{{ pve_base }}/version"
|
|
headers:
|
|
Authorization: "{{ auth_header }}"
|
|
return_content: true
|
|
register: version
|
|
|
|
- name: Show version
|
|
ansible.builtin.debug:
|
|
var: version.json
|
|
|
|
- name: Create QEMU guest
|
|
ansible.builtin.uri:
|
|
url: "{{ pve_base }}/nodes/{{ pve_node }}/qemu"
|
|
method: POST
|
|
headers:
|
|
Authorization: "{{ auth_header }}"
|
|
body_format: form-urlencoded
|
|
body:
|
|
vmid: "{{ pve_vmid }}"
|
|
name: "ansible-{{ pve_vmid }}"
|
|
cores: "1"
|
|
memory: "512"
|
|
return_content: true
|
|
register: create
|
|
|
|
- name: Wait for create task
|
|
ansible.builtin.uri:
|
|
url: "{{ pve_base }}/nodes/{{ pve_node }}/tasks/{{ create.json.data | urlencode }}/status"
|
|
headers:
|
|
Authorization: "{{ auth_header }}"
|
|
return_content: true
|
|
register: create_status
|
|
until: create_status.json.data.status == 'stopped'
|
|
retries: 60
|
|
delay: 1
|
|
|
|
- name: Start guest
|
|
ansible.builtin.uri:
|
|
url: "{{ pve_base }}/nodes/{{ pve_node }}/qemu/{{ pve_vmid }}/status/start"
|
|
method: POST
|
|
headers:
|
|
Authorization: "{{ auth_header }}"
|
|
return_content: true
|
|
register: start
|
|
|
|
- name: Wait for start task
|
|
ansible.builtin.uri:
|
|
url: "{{ pve_base }}/nodes/{{ pve_node }}/tasks/{{ start.json.data | urlencode }}/status"
|
|
headers:
|
|
Authorization: "{{ auth_header }}"
|
|
return_content: true
|
|
register: start_status
|
|
until: start_status.json.data.status == 'stopped'
|
|
retries: 60
|
|
delay: 1
|
|
|
|
- name: Stop guest
|
|
ansible.builtin.uri:
|
|
url: "{{ pve_base }}/nodes/{{ pve_node }}/qemu/{{ pve_vmid }}/status/stop"
|
|
method: POST
|
|
headers:
|
|
Authorization: "{{ auth_header }}"
|
|
return_content: true
|
|
register: stop
|
|
|
|
- name: Wait for stop task
|
|
ansible.builtin.uri:
|
|
url: "{{ pve_base }}/nodes/{{ pve_node }}/tasks/{{ stop.json.data | urlencode }}/status"
|
|
headers:
|
|
Authorization: "{{ auth_header }}"
|
|
return_content: true
|
|
register: stop_status
|
|
until: stop_status.json.data.status == 'stopped'
|
|
retries: 60
|
|
delay: 1
|
|
|
|
- name: Delete guest
|
|
ansible.builtin.uri:
|
|
url: "{{ pve_base }}/nodes/{{ pve_node }}/qemu/{{ pve_vmid }}"
|
|
method: DELETE
|
|
headers:
|
|
Authorization: "{{ auth_header }}"
|
|
return_content: true
|
|
register: delete
|
|
|
|
- name: Wait for delete task
|
|
ansible.builtin.uri:
|
|
url: "{{ pve_base }}/nodes/{{ pve_node }}/tasks/{{ delete.json.data | urlencode }}/status"
|
|
headers:
|
|
Authorization: "{{ auth_header }}"
|
|
return_content: true
|
|
register: delete_status
|
|
until: delete_status.json.data.status == 'stopped'
|
|
retries: 60
|
|
delay: 1
|