Fix playbook and CI
Infrastructure / Check and run Ansbile playbooks (pull_request) Successful in 1m23s Details

This commit is contained in:
Gleb Koval 2023-09-04 20:09:33 +01:00
parent 945ba2d83e
commit 985b4b5127
Signed by: cyclane
GPG Key ID: 15E168A8B332382C
2 changed files with 9 additions and 8 deletions

View File

@ -36,7 +36,7 @@ jobs:
- name: Check playbooks
run: |
for file in $(find . -wholename "*/infra/*playbook.yaml" -type f); do
ansible-playbook --inventory ./inventory --check "$file"
ansible-playbook --inventory ./inventory --syntax-check "$file"
done
- name: Get changed playbooks

View File

@ -1,11 +1,12 @@
- name: Provision joplin Proxmox VM
hosts: localhost
gather_facts: false
# gather_facts: false
vars:
api_user: "{{ lookup('env', 'PROXMOX_USER') }}"
api_host: "{{ lookup('env', 'PROXMOX_HOST' ) }}"
api_token_id: "{{ lookup('env', 'PROXMOX_TOKEN_ID') }}"
api_token_secret: "{{ lookup('env', 'PROXMOX_TOKEN_SECRET') }}"
api_user: "{{ lookup('ansible.builtin.env', 'PROXMOX_USER') }}"
api_host: "{{ lookup('ansible.builtin.env', 'PROXMOX_HOST' ) }}"
api_token_id: "{{ lookup('ansible.builtin.env', 'PROXMOX_TOKEN_ID') }}"
api_token_secret: "{{ lookup('ansible.builtin.env', 'PROXMOX_TOKEN_SECRET') }}"
ssh_public: "{{ lookup('ansible.builtin.env', 'SSH_PUBLIC') }}"
vmname: joplin
node: pve
module_defaults:
@ -31,7 +32,7 @@
tasks:
- name: Create VM
community.general.proxmox_kvm:
clone: pve-debian-12
clone: "{{ node }}-debian-12"
storage: nvme
- name: Wait for VM to exist
community.general.proxmox_kvm:
@ -58,7 +59,7 @@
community.general.proxmox_kvm:
update: true
ciuser: debian
sshkeys: "{{ lookup('env', 'SSH_PUBLIC') }}"
sshkeys: "{{ ssh_public }}"
ipconfig:
ipconfig0: ip=dhcp,ip6=auto
agent: enabled=1