From Baby Crocodile, 2 Months ago, written in Plain Text.
  1. ---
  2.  - hosts: "{{ variable_host }}"
  3.    gather_facts: no
  4.    tasks:
  5.      - name: Adding new user to specific group.
  6.        become: yes
  7.        become_method: sudo
  8.  
  9.        vars:
  10.          ClientID: "{{ variable_clientid }}"
  11.          ClientGroup: "{{ variable_clientgroup }}"
  12.  
  13.        user: name="{{ ClientID }}" groups="{{ ClientGroup }}" append=yes state=present
captcha