Hello All.
I am trying to solve the following issue.
I have a SSSD role which configures my target machine via a .j2 template which contains a bunch of stuff, including the ldap_access_filter parameter.
I also have playbooks organized hierarchically:
00-base.yml calls only playbooks (01-xxxx, 02-yyy, 03-zzz, etc.)
01-xxxx is called first, and sets up common stuff for all my machines (like basic firewall rules, subscription to satellite, etc.), including the configuration of sssd with the LDAP group that we use to administer our servers.
03-zzzz is a specialized playbook, that only applies to one or few instances. This playbook also needs to push additional LDAP groups so that people in those groups will be able to SSH into the target.
My problem is: if I call the SSSD role twice (playbook 01 and 03), the second configuration will wipe out the “01” one, effectively removing the LDAP group that was added initially.
I would like the 2 configurations to “merge” together so that the final configuration file will contain the LDAP groups defined in 01 and 03.
Well, you wrote "merge" but you did not specify how you would like it to be "merged".
"Merge" and concatenate share a lot of the same synonyms so concatenation was a valid answer like 10 others would be.
It you would like a more precise answer you should give more precise information about what exactly what you are trying to do.
Playbook 1 does a bunch of stuff, including calling a role that sets the SSSD.conf with default settings, including the ldap_access_filter settings.
Then, playbook one “calls” playbook 2 to add additional “specialized” settings. However, also playbook 2 will need to change the sssd.conf, adding additional groups to the ldap_access_filter parameter.
If I call again the role that sets up sssd, then the settings that were applied by Playbook1 get overwritten by the ones in Playbook2.
I am stuck. I would like to keep the information in both playbooks and have a final sssd.conf that contains all the ldap groups declared.
1) playbook A applies variable LDAP_data_A
2) merge LDAP_data_A and LDAP_data_B into LDAP_data
3) playbook B applies variable LDAP_data
Is this the scenario you're looking for? To proceed with the details post
minimal examples of LDAP_data_A and LDAP_data_B. Post minimal example of the
task (probably ldap_attr ?).