dhcpd: Add support for reading host data from LDAP
This commit is contained in:
parent
0530194ac0
commit
45557e0bc1
1 changed files with 18 additions and 0 deletions
|
@ -7,6 +7,24 @@
|
||||||
name: "{{ dhcpd_package }}"
|
name: "{{ dhcpd_package }}"
|
||||||
state: installed
|
state: installed
|
||||||
|
|
||||||
|
- name: Get host data from LDAP
|
||||||
|
community.general.ldap_search:
|
||||||
|
attrs:
|
||||||
|
- cn
|
||||||
|
- ipHostNumber
|
||||||
|
- macAddress
|
||||||
|
client_cert: >-
|
||||||
|
{{ hostvars[ansible_server]['tls_certs'] + '/' + ansible_server }}.crt
|
||||||
|
client_key: >-
|
||||||
|
{{ hostvars[ansible_server]['tls_private'] + '/' + ansible_server }}.key
|
||||||
|
dn: "{{ dhcpd_ldap_basedn | default(ldap_basedn) }}"
|
||||||
|
filter: "{{ dhcpd_ldap_filter }}"
|
||||||
|
scope: subordinate
|
||||||
|
server_uri: "ldaps://{{ ldap_server[0] }}"
|
||||||
|
delegate_to: localhost
|
||||||
|
register: ldap_hosts
|
||||||
|
when: dhcpd_ldap_filter is defined
|
||||||
|
|
||||||
- name: Create config
|
- name: Create config
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
dest: "{{ dhcpd_config }}"
|
dest: "{{ dhcpd_config }}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue