ds389_plugin_memberof_config: true
when: ds389_plugin_memberof_config is undefined
-# - name: "Configuring the 389ds memberOf-Plugin."
-# include_tasks: 'memberof.yaml'
-# when: (ds389_plugin_memberof_config | bool) == true
+- name: "Configuring the 389ds memberOf-Plugin."
+ include_tasks: 'memberof.yaml'
+ when: (ds389_plugin_memberof_config | bool) == true
- name: "Set default for ds389_plugin_referint_config."
set_fact:
---
-- name: 'Get the current configuration of the memberOf-Plugin.'
- ansible.builtin.shell: "dsconf {{ slapd_instance | quote }} plugin memberof show | \
- grep -P -i '^(memberof|nsslapd-pluginEnabled)' | \
- sed -e 's/^memberof//i' -e 's/nsslapd-plugin//i' | tr '[:upper:]' '[:lower:]' | \
- sort || true"
- register: plugin_memberof
- changed_when: false
- check_mode: false
-
- name: 'Show raw memberof attribute config.'
debug:
var: plugin_memberof
verbosity: 3
-- name: "Set variable plugin_memberof_config"
- set_fact:
- plugin_memberof_config: "{{ plugin_memberof.stdout_lines | cfg_389ds_to_dict }}"
-
-- name: "Show config hash:"
- debug:
- var: plugin_memberof_config
- verbosity: 0
-
- name: 'Predefine variable exec_set to false'
set_fact:
exec_set: false
- name: 'Check for attr.'
set_fact:
exec_set: true
- when: '"attr" not in plugin_memberof_config or plugin_memberof_config["attr"] != ( ds389_plugin_memberof_attr | lower )'
+ when: '"attr" not in ds389_plugin_config.memberof or ( ds389_plugin_config.memberof["attr"] | lower ) != ( ds389_plugin_memberof_attr | lower )'
- name: 'Check for groupattrs not set.'
set_fact:
exec_set: true
- when: '"groupattr" not in plugin_memberof_config'
+ when: '"groupattr" not in ds389_plugin_config.memberof'
- name: 'Check for groupattrs.'
set_fact:
exec_set: true
- when: '"groupattr" in plugin_memberof_config and (plugin_memberof_config["groupattr"] | compare_lc_list(ds389_plugin_memberof_groupattrs) != true)'
+ when: '"groupattr" in ds389_plugin_config.memberof and (ds389_plugin_config.memberof["groupattr"] | compare_lc_list(ds389_plugin_memberof_groupattrs) != true)'
- name: 'Check for allbackends.'
set_fact:
exec_set: true
- when: '"allbackends" not in plugin_memberof_config or plugin_memberof_config["allbackends"] != ds389_plugin_memberof_allbackends'
+ when: '"allbackends" not in ds389_plugin_config.memberof or ds389_plugin_config.memberof["allbackends"] != ds389_plugin_memberof_allbackends'
- name: 'Check for skipnested.'
set_fact:
exec_set: true
- when: '"skipnested" not in plugin_memberof_config or plugin_memberof_config["skipnested"] != ds389_plugin_memberof_skipnested'
+ when: '"skipnested" not in ds389_plugin_config.memberof or ds389_plugin_config.memberof["skipnested"] != ds389_plugin_memberof_skipnested'
- name: "Has the memberOf-Plugin to be configured:"
debug:
ansible.builtin.shell: "{{ plugin_memberof_cmd }}"
- name: "Enabling memberof plugin."
- when: "plugin_memberof_config['enabled'] == false and ds389_plugin_memberof_enabled == true"
+ when: "ds389_plugin_config.memberof['enabled'] == false and ds389_plugin_memberof_enabled == true"
block:
- name: "Enabling memberof plugin."
restart_389ds: true
- name: "Disabling memberof plugin."
- when: "plugin_memberof_config['enabled'] == true and ds389_plugin_memberof_enabled == false"
+ when: "ds389_plugin_config.memberof['enabled'] == true and ds389_plugin_memberof_enabled == false"
block:
- name: "Disabling memberof plugin."