diff --git a/ansible.cfg b/ansible.cfg index 6f1c6a8..cd92a60 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -134,7 +134,7 @@ ;hash_behaviour=replace # (pathlist) Comma separated list of Ansible inventory sources -inventory=/etc/ansible/hosts,./hosts/inventory.yaml +inventory=/etc/ansible/hosts,./hosts/inventory.yaml,./hosts/proxmox.yaml # (pathspec) Colon separated paths in which Ansible will search for HttpApi Plugins. ;httpapi_plugins=/home/aleidk/.ansible/plugins/httpapi:/usr/share/ansible/plugins/httpapi diff --git a/hosts/proxmox.yaml b/hosts/proxmox.yaml new file mode 100644 index 0000000..8190d46 --- /dev/null +++ b/hosts/proxmox.yaml @@ -0,0 +1,27 @@ +plugin: community.general.proxmox + +user: "{{ lookup('rbw', 'Proxmox Ansible Token').data.username }}" +token_id: "{{ lookup('rbw', 'Proxmox Ansible Token').fields[0].value }}" +token_secret: "{{ lookup('rbw', 'Proxmox Ansible Token').data.password }}" +url: "https://10.0.0.10:8006" +validate_certs: false +cache: true + +exclude_nodes: true +group_prefix: proxmox_ +want_facts: true +groups: + proxmox_all: true +keyed_groups: + - key: proxmox_tags_parsed + separator: "" + prefix: group_ + + - key: proxmox_ostype + separator: "" + prefix: distro_ + +compose: +# ansible_host: proxmox_ipconfig0.ip | default(proxmox_net0.ip) | ansible.utils.ipaddr('address') + ansible_host: proxmox_hostname + ".lan" + ansible_become_method: proxmox_ostyle == "alpine" | ternary("doas", "sudo")