fix al container. ora va per davvero e ci sono le password in un .env.yml

This commit is contained in:
Freek Kettone 2025-09-07 12:53:47 +02:00
parent 75dfd49a53
commit 5941ed27b2
9 changed files with 35 additions and 20 deletions

View file

@ -1,9 +1,13 @@
- name: Configura container LXC
hosts: lxc_containers
gather_facts: false
become: true
vars_files:
- ../.env.yml
vars:
ssh_public_key: "{{ lookup('file', '~/.ssh/ansible.pub') }}"
gather_facts: false
become: yes
tasks:
- name: Wait until SSH is fully ready (Ansible login confirms availability)

View file

@ -1,4 +1,6 @@
- name: Configura Prosody (xmpp) sul container
hosts: lxc_containers
vars_files:
- ../.env.yml
roles:
- prosody

View file

@ -1,8 +1,12 @@
- name: Crea container lxc per prosody (xmpp)
hosts: proxmox_nodes
gather_facts: false
vars_files:
- ../.env.yml
vars:
root_password: "{{ lookup('env', 'XMPP_PASSWORD') }}"
# root_password: "{{ lookup('env', 'XMPP_PASSWORD') }}" #dovrebbe essere nel file .env
ssh_public_key: "{{ lookup('file', '~/.ssh/ansible.pub') }}"
vmid: 121
@ -11,7 +15,7 @@
community.general.proxmox:
api_host: "{{ proxmox_url }}"
api_user: "{{ proxmox_user }}"
api_password: "{{ proxmox_password }}"
api_password: "{{ PROXMOX_PASSWORD }}"
vmid: "{{ vmid }}"
node: milan
hostname: xmpp
@ -22,7 +26,7 @@
netif:
net0: "name=eth0,bridge=vmbr1,ip=10.10.0.21/16,gw=10.10.0.1"
pubkey: "{{ ssh_public_key }}"
password: "{{ root_password }}"
password: "{{ XMPP_PASSWORD }}"
features: "nesting=1"
state: present
delegate_to: localhost
@ -32,7 +36,7 @@
community.general.proxmox:
api_host: "{{ proxmox_url }}"
api_user: "{{ proxmox_user }}"
api_password: "{{ proxmox_password }}"
api_password: "{{ PROXMOX_PASSWORD }}"
vmid: "{{ vmid }}"
node: milan
state: started # Tutto questo blocco è riassumibile in questa riga