Merge branch 'master' of git.fri.uni-lj.si:rc/servers
This commit is contained in:
commit
d448660bf2
2 changed files with 15 additions and 0 deletions
|
@ -12,6 +12,9 @@ dhcp-proxy
|
||||||
# has 3 s timeout during which no other requests are processed
|
# has 3 s timeout during which no other requests are processed
|
||||||
no-ping
|
no-ping
|
||||||
|
|
||||||
|
# we have more than 1000 clients
|
||||||
|
dhcp-lease-max = 5000
|
||||||
|
|
||||||
bind-interfaces
|
bind-interfaces
|
||||||
interface = {{ interfaces | map(attribute='name') | join(',') }}
|
interface = {{ interfaces | map(attribute='name') | join(',') }}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,18 @@
|
||||||
prefixes: '{{ query("netbox.netbox.nb_lookup", "prefixes", raw_data=true)
|
prefixes: '{{ query("netbox.netbox.nb_lookup", "prefixes", raw_data=true)
|
||||||
| sort(attribute="prefix") | sort(attribute="family.value") }}'
|
| sort(attribute="prefix") | sort(attribute="family.value") }}'
|
||||||
|
|
||||||
|
# can only get NetBox ID for device/VM from (any) interface
|
||||||
|
# probably safe to assume at least one interface
|
||||||
|
- name: Get my ID
|
||||||
|
set_fact:
|
||||||
|
id: '{{ interfaces | map(attribute=("virtual_machine.id" if is_virtual else "device.id")) | first }}'
|
||||||
|
|
||||||
|
- name: Get my services
|
||||||
|
set_fact:
|
||||||
|
services: '{{
|
||||||
|
query("netbox.netbox.nb_lookup", "services", raw_data=true,
|
||||||
|
api_filter=("virtual_machine_id" if is_virtual else "device_id")+"="+id) }}'
|
||||||
|
|
||||||
- when: 'cluster is defined and not is_virtual'
|
- when: 'cluster is defined and not is_virtual'
|
||||||
block:
|
block:
|
||||||
- name: Get my cluster and all nodes in it
|
- name: Get my cluster and all nodes in it
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue