How to best NOT run a command
Michael Dahlberg <[email protected]> Thu, 8 Feb 2024 14:02:08 -0800 (PST)
| Newsgroups | gmane.comp.sysutils.cfengine.general |
|---|---|
| Message-ID | <[email protected]> |
I have a bundle that I need to troubleshoot and I'm hoping there is a
better way of writing this.
What I have:
classes:
"has_sssd_authselect" expression => returrnszero("/usr/bin/authselect
current -r | grep sssd > /dev/null 2>&1","useshell");
commands:
has_sssd_authselect::
"/usr/bin/authselect select sssd --force"
Basically, I want to run authselect current -r every time the agent runs
but only run authselect select sssd --force when SSSD is *NOT* present.
First, I know, the logic of the class statement is wrong. As it is
written, the agent will only run the authselect select command when SSSD
is already present.
However, it seems as if there might be a better way to write this, I'm just
not sure what it might be. Any suggestions are welcome.
Thanks,
Mike
Michael Dahlberg
--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/bb8da7e8-3729-42f1-8724-e247582e3fd9n%40googlegroups.com.