Simplify your task.  Just create a well know template with your correct 
settings for the system-auth-ac file and then just copy it down.  You don't 
really care what is currently in it if you just copy a good known copy 
down.  Or, you could run an command grep for difok on system-auth-ac and 
only copy if the value is different than 8.

On Monday, October 1, 2018 at 1:26:03 PM UTC-4, Robert Kruck wrote:
>
> All,
>
> I'm fairly new to ansible and have been following the ansible 
> documentation but am having trouble with the pamd module and hope someone 
> can help shed some light.
>
> Here is my current task in my playbook:
>
> - name: "[RHEL-06-000060] - Update difok number in /etc/pam.d/system-auth"
>      pamd:
>        name:  system-auth
>        type: password
>        control: required
>        module_path: pam_cracklib.so
>        module_arguments: 'retry=3 minlen=14 dcredit=-1 ucredit=-1 
> ocredit=-1 lcredit=-1 difok=8 maxrepeat=3'
>        state: updated
>
> What I am trying to do is just update the difok argument as the original 
> setting in the file is difok=3.  If I just change the module_arguments part 
> to just say 'difok=8' and change the state to args_present, then it just 
> appends to the end of the line and I have both a difok=3 and a difok=8.  Is 
> there a way to just use the module_argument section for only the one I want 
> to change without having to list all of the arguments?  I'm trying to avoid 
> my playbook showing changed every time I run it.
>
> Any help is appreciated.
>
> Thanks
> Robert
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/da866383-24fd-4855-b111-7237227203a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to