Skip to content

Commit

Permalink
loop through ldap servers and update line entry
Browse files Browse the repository at this point in the history
  • Loading branch information
ajanis committed Dec 20, 2023
1 parent 99303bc commit 7612692
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
lineinfile:
dest: /etc/hosts
state: present
line: "{{ openldap_server_hosts_entry }}"
line: "{{ hostvars[item].ansible_default_ipv4.address }} {{ openldap_server_domain_name }} {{ openldap_server_domain_name.split('.')[0] }}"
loop: "{{ groups['ldap'] | default([]) | unique }}"
when:
- openldap_client_enable
- groups['ldap'] is defined
- groups['ldap'] | length > 0
tags:
- always

Expand Down

0 comments on commit 7612692

Please sign in to comment.