On 19.03.2018 09:59, Zeljko Dokman wrote:
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"
groups is a reserved variable name in Ansible, groups contain all the
groups in the inventory.
http://docs.ansible.com/ansible/latest/playbooks_variables.html#magic-variables-and-how-to-access-information-about-other-hosts
--
Kai Stian Olstad
--
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/b26c2247753ed028e47717efbf81144d%40olstad.com.
For more options, visit https://groups.google.com/d/optout.