Re: [ansible-project] I am trying to disable a user and give no login access to the user.

2018-04-12 Thread POOJA VENKATESH
Thanks. It works :)

On Thu, Apr 12, 2018 at 2:16 PM, Brian Coca  wrote:

> Or you can just expire the user :
>
>
> - user:
>  name: thatguy
>  expires: "{{lookup('pipe', 'date +%s')}}"
>
>
>
>
>
> --
> --
> Brian Coca
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/CACVha7dEG4i3WLrbEY_YkLJbnHvARXBAJNmUHrQw0q1P8uHrx
> Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAAGG3SArJ0ksETMNpwZjszzwmp96A%3DPvgeNJGKVJXJ-gibXyUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] I am trying to disable a user and give no login access to the user.

2018-04-12 Thread POOJA VENKATESH
Thanks :) It works!

On Thu, Apr 12, 2018 at 2:12 PM, Matt Martz  wrote:

> I typically do something like:
>
> - name: Disable the ubuntu user
>   user:
> name: ubuntu
> password: "!"
> shell: /usr/sbin/nologin
>
> - name: Remove the ubuntu users ssh key
>   file:
> path: /home/ubuntu/.ssh/authorized_keys
> force: yes
> state: absent
>
> On Thu, Apr 12, 2018 at 4:11 PM, POOJA VENKATESH <
> poojavenkateshre...@gmail.com> wrote:
>
>>
>> I am trying to disable a user and not remove it completely
>>
>> ---
>> - hosts: target1
>>   tasks:
>> - name: disable the user
>>   become: yes
>>   user:
>> name: random
>> group: sudo
>> state: absent
>>
>>
>> When I run this playbook I see that the user is removed. Is there a way I
>> can disable the user other than using expire parameter? I just want the
>> user to stay but not have any login capabilities.
>>
>> --
>> 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 ansible-project+unsubscr...@googlegroups.com.
>> To post to this group, send email to ansible-project@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/ansible-project/CAAGG3SAX-Anb95ODx10xL21WoyzRN3VwWcogZwv
>> rxweUowd5Qg%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Matt Martz
> @sivel
> sivel.net
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/CAD8N0v8re6zFFnDo5kQcv2zdUXzbS
> C-p%2ByXvTM2Q5CBvjZth9w%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAAGG3SC9Qt6PfL%2BXWCeDor334%2BUTNpFQ%2B8yB8TX%2BWbR62jJgsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] I am trying to disable a user and give no login access to the user.

2018-04-12 Thread Matt Martz
I typically do something like:

- name: Disable the ubuntu user
  user:
name: ubuntu
password: "!"
shell: /usr/sbin/nologin

- name: Remove the ubuntu users ssh key
  file:
path: /home/ubuntu/.ssh/authorized_keys
force: yes
state: absent

On Thu, Apr 12, 2018 at 4:11 PM, POOJA VENKATESH <
poojavenkateshre...@gmail.com> wrote:

>
> I am trying to disable a user and not remove it completely
>
> ---
> - hosts: target1
>   tasks:
> - name: disable the user
>   become: yes
>   user:
> name: random
> group: sudo
> state: absent
>
>
> When I run this playbook I see that the user is removed. Is there a way I
> can disable the user other than using expire parameter? I just want the
> user to stay but not have any login capabilities.
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/CAAGG3SAX-Anb95ODx10xL21WoyzRN3VwWcogZwv
> rxweUowd5Qg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v8re6zFFnDo5kQcv2zdUXzbSC-p%2ByXvTM2Q5CBvjZth9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] I am trying to disable a user and give no login access to the user.

2018-04-12 Thread POOJA VENKATESH
I am trying to disable a user and not remove it completely

---
- hosts: target1
  tasks:
- name: disable the user
  become: yes
  user:
name: random
group: sudo
state: absent


When I run this playbook I see that the user is removed. Is there a way I
can disable the user other than using expire parameter? I just want the
user to stay but not have any login capabilities.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAAGG3SAX-Anb95ODx10xL21WoyzRN3VwWcogZwvrxweUowd5Qg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.