fix: homelab hosts

This commit is contained in:
Alexander Navarro 2025-07-14 09:10:34 -04:00
parent 5ca07cf48d
commit 82f614eb47
5 changed files with 22 additions and 5 deletions

View file

@ -35,15 +35,15 @@
;become_plugins=/home/aleidk/.ansible/plugins/become:/usr/share/ansible/plugins/become ;become_plugins=/home/aleidk/.ansible/plugins/become:/usr/share/ansible/plugins/become
# (string) Chooses which cache plugin to use, the default 'memory' is ephemeral. # (string) Chooses which cache plugin to use, the default 'memory' is ephemeral.
;fact_caching=memory fact_caching=jsonfile
# (string) Defines connection or path information for the cache plugin # (string) Defines connection or path information for the cache plugin
;fact_caching_connection= fact_caching_connection=~/.cache/ansible/
# (string) Prefix to use for cache plugin files/tables # (string) Prefix to use for cache plugin files/tables
;fact_caching_prefix=ansible_facts ;fact_caching_prefix=ansible_facts
# (integer) Expiration timeout for the cache plugin data # (integer) Expiration timeout for the cache plugin data (24 hours by default)
;fact_caching_timeout=86400 ;fact_caching_timeout=86400
# (list) List of enabled callbacks, not all callbacks need enabling, but many of those shipped with Ansible do as we don't want them activated by default. # (list) List of enabled callbacks, not all callbacks need enabling, but many of those shipped with Ansible do as we don't want them activated by default.
@ -134,7 +134,7 @@
;hash_behaviour=replace ;hash_behaviour=replace
# (pathlist) Comma separated list of Ansible inventory sources # (pathlist) Comma separated list of Ansible inventory sources
inventory=/etc/ansible/hosts,./hosts/inventory.yaml,./hosts/proxmox.yaml inventory=/etc/ansible/hosts,./hosts/inventory.yaml,./hosts/proxmox.yaml,./hosts/homelab.hcloud.yaml
# (pathspec) Colon separated paths in which Ansible will search for HttpApi Plugins. # (pathspec) Colon separated paths in which Ansible will search for HttpApi Plugins.
;httpapi_plugins=/home/aleidk/.ansible/plugins/httpapi:/usr/share/ansible/plugins/httpapi ;httpapi_plugins=/home/aleidk/.ansible/plugins/httpapi:/usr/share/ansible/plugins/httpapi

View file

@ -0,0 +1,4 @@
plugin: hetzner.hcloud.hcloud
api_token: "{{ lookup('rbw', 'Hetzner Ansible Token').data.password }}"
cache: true

View file

@ -22,6 +22,7 @@ keyed_groups:
prefix: distro_ prefix: distro_
compose: compose:
ansible_host: proxmox_lxc_interfaces | selectattr('name','equalto','eth0') | map(attribute='inet') | first | ansible.utils.ipaddr('address')
# ansible_host: proxmox_ipconfig0.ip | default(proxmox_net0.ip) | ansible.utils.ipaddr('address') # ansible_host: proxmox_ipconfig0.ip | default(proxmox_net0.ip) | ansible.utils.ipaddr('address')
ansible_host: proxmox_hostname + ".lan" # ansible_host: proxmox_hostname + ".internal"
ansible_become_method: proxmox_ostyle == "alpine" | ternary("doas", "sudo") ansible_become_method: proxmox_ostyle == "alpine" | ternary("doas", "sudo")

View file

@ -6,6 +6,7 @@ readme = "README.md"
requires-python = ">=3.13" requires-python = ">=3.13"
dependencies = [ dependencies = [
"ansible>=11.1.0", "ansible>=11.1.0",
"netaddr>=1.3.0",
"paramiko>=3.5.0", "paramiko>=3.5.0",
"passlib>=1.7.4", "passlib>=1.7.4",
] ]

11
uv.lock generated
View file

@ -118,6 +118,7 @@ version = "0.1.0"
source = { virtual = "." } source = { virtual = "." }
dependencies = [ dependencies = [
{ name = "ansible" }, { name = "ansible" },
{ name = "netaddr" },
{ name = "paramiko" }, { name = "paramiko" },
{ name = "passlib" }, { name = "passlib" },
] ]
@ -125,6 +126,7 @@ dependencies = [
[package.metadata] [package.metadata]
requires-dist = [ requires-dist = [
{ name = "ansible", specifier = ">=11.1.0" }, { name = "ansible", specifier = ">=11.1.0" },
{ name = "netaddr", specifier = ">=1.3.0" },
{ name = "paramiko", specifier = ">=3.5.0" }, { name = "paramiko", specifier = ">=3.5.0" },
{ name = "passlib", specifier = ">=1.7.4" }, { name = "passlib", specifier = ">=1.7.4" },
] ]
@ -169,6 +171,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/4f/65/6079a46068dfceaeabb5dcad6d674f5f5c61a6fa5673746f42a9f4c233b3/MarkupSafe-3.0.2-cp313-cp313t-win_amd64.whl", hash = "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f", size = 15739 }, { url = "https://files.pythonhosted.org/packages/4f/65/6079a46068dfceaeabb5dcad6d674f5f5c61a6fa5673746f42a9f4c233b3/MarkupSafe-3.0.2-cp313-cp313t-win_amd64.whl", hash = "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f", size = 15739 },
] ]
[[package]]
name = "netaddr"
version = "1.3.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/54/90/188b2a69654f27b221fba92fda7217778208532c962509e959a9cee5229d/netaddr-1.3.0.tar.gz", hash = "sha256:5c3c3d9895b551b763779ba7db7a03487dc1f8e3b385af819af341ae9ef6e48a", size = 2260504 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/12/cc/f4fe2c7ce68b92cbf5b2d379ca366e1edae38cccaad00f69f529b460c3ef/netaddr-1.3.0-py3-none-any.whl", hash = "sha256:c2c6a8ebe5554ce33b7d5b3a306b71bbb373e000bbbf2350dd5213cc56e3dbbe", size = 2262023 },
]
[[package]] [[package]]
name = "packaging" name = "packaging"
version = "24.2" version = "24.2"