Giter Club home page Giter Club logo

Comments (8)

richm avatar richm commented on July 18, 2024

I would prefer to keep the template based implementation of realmd.conf, rather than moving to use lineinfile or blockinfile.
What if we introduce a parameter like ad_integration_preserve_custom_sssd_profile: true|false

then in the template

{% if ad_integration_preserve_custom_sssd_profile %}
[commands]
sssd-enable-logins = /usr/bin/sh -c "/usr/bin/systemctl enable oddjobd.service && /usr/bin/systemctl start oddjobd.service"
sssd-disable-logins = /bin/true
{% endif %}

@justin-stephenson @jakub-vavra-cz wdyt?

from ad_integration.

jakub-vavra-cz avatar jakub-vavra-cz commented on July 18, 2024

Well realmd.conf is unfortunately a file not owned by realmd package so we can not check if user changed it by rpm -V realmd.
We can stat if it exists and if does not, use the template.
If it exists and does not have our ansible signature we can apply block in file (showing warning that this is not recommended). If it exist and has our ansible signature we can just silently replace it with template.

from ad_integration.

richm avatar richm commented on July 18, 2024

Well realmd.conf is unfortunately a file not owned by realmd package so we can not check if user changed it by rpm -V realmd.

But can it be owned by the ad_integration role? Can we say "if you use the ad_integration role to manage realmd.conf, you cannot be guaranteed to preserve any edits made to realmd.conf outside of the ad_integration role." Note that most other system roles work the same way - you use the system role to manage the resource, and any changes made outside of the system role will be wiped out by the role.

We can stat if it exists and if does not, use the template. If it exists and does not have our ansible signature we can apply block in file (showing warning that this is not recommended). If it exist and has our ansible signature we can just silently replace it with template.

If we have to code it up in such a way that any/every change made to realmd.conf outside of the role must be preserved, then we are going to make the role very complicated . . .

from ad_integration.

justin-stephenson avatar justin-stephenson commented on July 18, 2024

I would prefer to keep the template based implementation of realmd.conf, rather than moving to use lineinfile or blockinfile. What if we introduce a parameter like ad_integration_preserve_custom_sssd_profile: true|false

then in the template

{% if ad_integration_preserve_custom_sssd_profile %}
[commands]
sssd-enable-logins = /usr/bin/sh -c "/usr/bin/systemctl enable oddjobd.service && /usr/bin/systemctl start oddjobd.service"
sssd-disable-logins = /bin/true
{% endif %}

@justin-stephenson @jakub-vavra-cz wdyt?

These realmd changes are just a workaround, it would be cleaner to have a proper solution to this (something similar to the realm join argument --do-not-touch-config). That said I don't know when that feature will be developed so for now I am fine with this proposed approach, ad_integration_preserve_authselect_profile would be more valid.

I would also add a comment in this template

Remove authselect command from `sssd-enable-logins` to avoid overwriting previous PAM/nsswitch changes, until https://issues.redhat.com/browse/RHEL-5101 is addressed.

Or maybe putting this in the README for the role variable is enough.

from ad_integration.

richm avatar richm commented on July 18, 2024

I would prefer to keep the template based implementation of realmd.conf, rather than moving to use lineinfile or blockinfile. What if we introduce a parameter like ad_integration_preserve_custom_sssd_profile: true|false
then in the template

{% if ad_integration_preserve_custom_sssd_profile %}
[commands]
sssd-enable-logins = /usr/bin/sh -c "/usr/bin/systemctl enable oddjobd.service && /usr/bin/systemctl start oddjobd.service"
sssd-disable-logins = /bin/true
{% endif %}

@justin-stephenson @jakub-vavra-cz wdyt?

These realmd changes are just a workaround, it would be cleaner to have a proper solution to this (something similar to the realm join argument --do-not-touch-config). That said I don't know when that feature will be developed so for now I am fine with this proposed approach, ad_integration_preserve_authselect_profile would be more valid.

I would also add a comment in this template

Remove authselect command from `sssd-enable-logins` to avoid overwriting previous PAM/nsswitch changes, until https://issues.redhat.com/browse/RHEL-5101 is addressed.

Or maybe putting this in the README for the role variable is enough.

#79

from ad_integration.

richm avatar richm commented on July 18, 2024

@jaredmarcuccilli can you test #79 ?

from ad_integration.

jaredmarcuccilli avatar jaredmarcuccilli commented on July 18, 2024

@jaredmarcuccilli can you test #79 ?

Worked exactly as expected, my PAM files are intact. Thanks for adding this so quickly.

from ad_integration.

richm avatar richm commented on July 18, 2024

merged #79

from ad_integration.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.