Compare commits
9 Commits
main
...
7b7f9f5999
Author | SHA1 | Date | |
---|---|---|---|
7b7f9f5999
|
|||
d143ffc123
|
|||
f9b321367b
|
|||
47c06b02f9
|
|||
6a83fdf379
|
|||
fe43f55a48
|
|||
eb68d6529f
|
|||
6e29e43ac0
|
|||
c918e5761c
|
44
.github/workflows/infra.yaml
vendored
Normal file
44
.github/workflows/infra.yaml
vendored
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
name: Infrastructure
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- infra/**
|
||||||
|
paths:
|
||||||
|
- infra/**-playbook.yaml
|
||||||
|
- .github/workflows/infra.yaml
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
name: Check infrastructure definitions
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
ansible-galaxy collection install community.general
|
||||||
|
|
||||||
|
- name: Get changed playbooks
|
||||||
|
id: changed-playbooks
|
||||||
|
uses: tj-actions/changed-files@v38
|
||||||
|
with:
|
||||||
|
since_last_remote_commit: "true"
|
||||||
|
files: infra/**-playbook.yaml
|
||||||
|
|
||||||
|
- name: Check modified playbooks
|
||||||
|
run: |
|
||||||
|
for file in ${{ steps.changed-playbooks.outputs.all_changed_files }}; do
|
||||||
|
ansible --inventory ./inventory --check "$file"
|
||||||
|
done
|
24
infra/test-vm/proxmox-playbook.yaml
Normal file
24
infra/test-vm/proxmox-playbook.yaml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
- name: Proxmox test-vm
|
||||||
|
hosts: localhost
|
||||||
|
module_defaults:
|
||||||
|
community.general.proxmox_kvm:
|
||||||
|
api_user: "{{ lookup('ansible.builtin.env', 'PROXMOX_TOKEN_ID') | regex_replace('!.*') }}"
|
||||||
|
api_host: "{{ lookup('ansible.builtin.env', 'PROXMOX_HOST' ) }}"
|
||||||
|
api_token_id: "{{ lookup('ansible.builtin.env', 'PROXMOX_TOKEN_ID') | regex_replace('.*!') }}"
|
||||||
|
api_token_secret: "{{ lookup('ansible.builtin.env', 'PROXMOX_TOKEN_SECRET') }}"
|
||||||
|
name: test-vm
|
||||||
|
node: pve
|
||||||
|
tasks:
|
||||||
|
- name: Create test-vm
|
||||||
|
community.general.proxmox_kvm:
|
||||||
|
name: test-vm
|
||||||
|
node: pve
|
||||||
|
- name: Update test-vm
|
||||||
|
community.general.proxmox_kvm:
|
||||||
|
cpu: x86-64-v3
|
||||||
|
memory: 2048
|
||||||
|
cores: 3
|
||||||
|
update: true
|
||||||
|
- name: Start test-vm
|
||||||
|
community.general.proxmox_kvm:
|
||||||
|
state: started
|
12
inventory/proxmox.yaml
Normal file
12
inventory/proxmox.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
proxmox:
|
||||||
|
children:
|
||||||
|
kovalhome:
|
||||||
|
children:
|
||||||
|
nodes:
|
||||||
|
hosts:
|
||||||
|
pve.mgmt.home.local.koval.net:
|
||||||
|
pve2.mgmt.home.local.koval.net:
|
||||||
|
managed:
|
||||||
|
hosts:
|
||||||
|
unmanaged:
|
||||||
|
hosts:
|
Reference in New Issue
Block a user