diff --git a/tasks/populate_webfinger_from_ldap.yml b/tasks/populate_webfinger_from_ldap.yml index 87122bc..be4c765 100644 --- a/tasks/populate_webfinger_from_ldap.yml +++ b/tasks/populate_webfinger_from_ldap.yml @@ -20,7 +20,7 @@ - debug: var: ldap_users.results -- name: creation entree webfinger depuis template +- 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_local_domain }}/{{ item.uid }}.json" @@ -28,3 +28,16 @@ - "{{ 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_local_domain }}/{{ item.uid | replace('.', '') }}.json" + with_items: + - "{{ ldap_users.results }}" + vars: + user: "{{ item }}" + acct: "{{ item.uid | replace('.', '') }}@{{ item.mail | split('@') | last }}" + + diff --git a/templates/user-template.json b/templates/user-template.json index 6e41c6c..6fdf68d 100644 --- a/templates/user-template.json +++ b/templates/user-template.json @@ -1,5 +1,5 @@ { - "subject" : "acct:{{ user.mail }}", + "subject" : "acct:{{ acct }}", "properties" : { "http://packetizer.com/ns/name" : "{{ user.displayName }}" @@ -7,19 +7,19 @@ "aliases" : [ - "https://mastodon.libretic.fr/users/{{ user.uid }}" + "https://mastodon.libretic.fr/users/{{ user.uid | replace('.', '') }}" ], "links" : [ { "rel" : "http://webfinger.net/rel/profile-page", "type": "text/html", - "href": "https://mastodon.libretic.fr/@{{ user.uid }}" + "href": "https://mastodon.libretic.fr/@{{ user.uid | replace('.', '') }}" }, { "rel": "self", "type": "application/activity+json", - "href": "https://mastodon.libretic.fr/users/{{ user.uid }}" + "href": "https://mastodon.libretic.fr/users/{{ user.uid | replace('.', '') }}" }, { "rel": "http://ostatus.org/schema/1.0/subscribe",