ansible-role-docker_webfing.../tasks/populate_webfinger_from_ldap.yml

43 lines
1.4 KiB
YAML

- name: Recherche des utilisateurs
delegate_to: localhost
community.general.ldap_search:
server_uri: "{{ docker_webfingerserver_ldap_server_uri }}"
bind_dn: "{{ docker_webfingerserver_ldap_bind_dn }}"
bind_pw: "{{ docker_webfingerserver_ldap_bind_pw }}"
dn: "{{ docker_webfingerserver_ldap_usersdn }}"
filter: "{{ docker_webfingerserver_ldap_users_filter }}"
scope: onelevel
attrs:
- uid
- mail
- memberOf
- displayName
- givenName
- sn
register: ldap_users
- debug:
var: ldap_users.results
- name: creation entree webfinger depuis template - id normal
template:
src: user-template.json
dest: "{{ docker_webfingerserver_data_dir }}/{{ docker_webfingerserver_service_id }}/webfinger/.well-known/webfinger/store/{{ docker_webfingerserver_fqdn }}/{{ item.uid }}.json"
with_items:
- "{{ ldap_users.results }}"
vars:
user: "{{ item }}"
acct: "{{ item.mail }}"
- name: creation entree webfinger depuis template - id sans point
template:
src: user-template.json
dest: "{{ docker_webfingerserver_data_dir }}/{{ docker_webfingerserver_service_id }}/webfinger/.well-known/webfinger/store/{{ docker_webfingerserver_fqdn }}/{{ item.uid | replace('.', '') }}.json"
with_items:
- "{{ ldap_users.results }}"
vars:
user: "{{ item }}"
acct: "{{ item.uid | replace('.', '') }}@{{ item.mail | split('@') | last }}"