--- /dev/null
+---
+
+- name: "Adding attr-uniq entry."
+ debug:
+ var: entry_name
+ verbosity: 0
+
+- name: "Start defining command for adding an attr-uniq entry."
+ set_fact:
+ entry_add_cmd: "dsconf {{ slapd_instance | quote }} plugin attr-uniq add"
+
+- name: "Add enabled to entry_add_cmd."
+ set_fact:
+ entry_add_cmd: "{{ entry_add_cmd }} --enabled {{ entry_data['enabled'] | bool | default(true) | bool_to_on_off }}"
+
+- name: "Adding attribute name to entry_add_cmd."
+ set_fact:
+ entry_add_cmd: "{{ entry_add_cmd }} --attr-name {{ attr_name | quote }}"
+
+- name: "Adding subtrees to entry_add_cmd."
+ set_fact:
+ entry_add_cmd: "{{ entry_add_cmd }} --subtree {{ entry_data['subtrees'] | map('quote') | join(' ') }}"
+ when: "'subtrees' in entry_data and entry_data['subtrees'] | length > 0"
+
+- name: "Adding across_all_subtrees to entry_add_cmd."
+ set_fact:
+ entry_add_cmd: "{{ entry_add_cmd }} --across-all-subtrees {{ entry_data['across_all_subtrees'] | default(true) | bool_to_on_off }}"
+
+- name: "Adding top_entry_oc to entry_add_cmd."
+ set_fact:
+ entry_add_cmd: "{{ entry_add_cmd }} --top-entry-oc {{ entry_data['top_entry_oc'] | quote }}"
+ when: "'top_entry_oc' in entry_data and entry_data['top_entry_oc'] is defined and entry_data['top_entry_oc'] != None and entry_data['top_entry_oc'] | length > 0"
+
+- name: "Adding subtree_entries_oc to entry_add_cmd."
+ set_fact:
+ entry_add_cmd: "{{ entry_add_cmd }} --subtree-entries-oc {{ entry_data['subtree_entries_oc'] | quote }}"
+ when: "'subtree_entries_oc' in entry_data and entry_data['subtree_entries_oc'] is defined and entry_data['subtree_entries_oc'] != None and entry_data['subtree_entries_oc'] | length > 0"
+
+- name: "Adding entry name to entry_add_cmd."
+ set_fact:
+ entry_add_cmd: "{{ entry_add_cmd }} {{ entry_name | quote }}."
+
+- name: "Show command for adding an attr-uniq entry."
+ debug:
+ var: entry_add_cmd
+ verbosity: 0
+
+- name: "Finally adding attr-uniq entry."
+ ansible.builtin.shell: "{{ entry_add_cmd }}"
+
+# vim: filetype=yaml
block:
- name: 'Add attr-uniq entry.'
- debug:
- msg: "Adding attr-uniq entry {{ entry_name | quote }}."
+ include_tasks: "attr-uniq-entry-add.yaml"
+ # vars:
+ # attr_name: "{{ attr_name }}"
when: entry_name_lc not in cur_attr_uniq_entries_lc
- name: 'Set attr-uniq entry.'