Hi,

Can some one help me with my playbook for adding new user and adding that 
user to existing groups...

Playbook....
- hosts: "{{ target }}"
  become: yes
  become_user: root
  become_method: sudo
  gather_facts: no

  tasks:
    - name: User add "{{ user }}"
      user: name="{{ user }}" comment="{{ comment }}" uid="{{ uid }}" 
groups="{{  groups }}"
      notify:
        - Chage added user

  handlers:
    - name: Chage added user
      shell: chage -M 99999 "{{ user }}"


My command...
ansible-playbook user_add_and_to_group.yaml -K -e 
"target=egcp-tst-rde.mbu.local user=test1 comment=testuser uid=9990 
groups=sysadm"

I am getting this error...
 "msg": "argument groups is of type <type 'dict'> and we were unable to 
convert to list: <type 'dict'> cannot be converted to a list"

If I use the play book without groups parameter playbook is successful if I 
manually define groups directly in the playbook its successful but it fails 
if I use it with variables and I do not understand why 


Regards 

-- 
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/05c5f71c-d6e6-4913-b25d-3bbeb3cbfccb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to