aboutsummaryrefslogtreecommitdiffstats
path: root/inventory-example/30-constructed.yml
blob: 5a776a155e4e4e54f420402c16e5365088112c9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
plugin: constructed
strict: yes
use_vars_plugins: yes
compose:
  vlan: vlans.values() | selectattr('cidr', 'contains_ip', ip) | first
  ansible_host: ansible_ip | default(ip) | default(ansible_host)
  fqdn: inventory_hostname ~ '.' ~ domain
  cnames: ([] if cname is not defined else (((cname | split(',')) if cname is string else cname) | map('regex_replace', '$', '.'~domain)))
  proxmox_disk: (disk | default('32g') | human_to_bytes / 1073741824) | int
  proxmox_memory: (ram | default('4g') | human_to_bytes / 1048576) | int
  proxmox_cores: cores | default(2)
groups:
  freeipa_replicas: "'freeipa_servers' in group_names and 'freeipa_master' not in group_names"
  el:                             (group_names | intersect(['unmanaged','opnsense_firewalls','proxmox_hypervisors']) | length) == 0
  nagios_ansible_managed_clients: (group_names | intersect(['unmanaged','opnsense_firewalls','linux_laptops']) | length) == 0
  nagios_el_clients:              (group_names | intersect(['unmanaged','opnsense_firewalls','linux_laptops','proxmox_hypervisors']) | length) == 0