cancel
Showing results for 
Search instead for 
Did you mean: 
Post a Question

Does anybody developed an Ansible playbook for creating users on GAIA ?


I mean with the GAIA specifics and not "only" the Linux standards like the following example.

---
- name: Create user
  user
: name=user shell=/bin/bash home=/srv/user groups=admin,sudo generate_ssh_key=yes ssh_key_bits=2048
- name: Set password to user
  shell
: echo user:plain_text_password | sudo chpasswd
  no_log
: True

Tags (1)
4 Replies
Employee+
Employee+

Re: Does anybody developed an Ansible playbook for creating users on GAIA ?

You can use:

- name: "Add scp user"
   command: "{{ item }}"
   with_items:
     - clish -c 'add user scpuser uid 2600 homedir /home/scpuser' -s
     - clish -c 'add rba role scpRole domain-type System readwrite-features expert' -s
     - clish -c 'add rba user scpuser roles scpRole' -s
     - clish -c 'set user scpuser gid 100 shell /usr/bin/scponly' -s
     - clish -c 'set user scpuser password-hash <HASH>' -s

Thanks for Danny Jung‌ for HowTo - Creating an scpuser account on Gaia Clish 

Thanks for @Ryan Darst for CheckMates_Aug15_Demos.zip 

Re: Does anybody developed an Ansible playbook for creating users on GAIA ?

Thx a lot....beside global script repository this is an good Option.

0 Kudos
Employee+
Employee+

Re: Does anybody developed an Ansible playbook for creating users on GAIA ?

My playbook (I'm using playbook and not role)

Please fix the format Smiley Happy (scpuser/vpn123)

- name: "Add scp user"
command: "{{ item }}"
with_items:
- clish -c 'lock database override' -si
- clish -c 'add user scpuser uid 2600 homedir /home/scpuser' -si
- clish -c 'add rba role scpRole domain-type System all-features' -si
- clish -c 'add rba user scpuser roles scpRole' -si
- clish -c 'set user scpuser gid 100 shell /usr/bin/scponly' -si
- clish -c 'set user scpuser password-hash $1$O8IbUP0w$asylKUt4DUVDoemt95ubh.' -si
- clish -c 'unlock database' -si

0 Kudos

Re: Does anybody developed an Ansible playbook for creating users on GAIA ?

Yes, you should able to do this using the asnible role "gaia_fw1" 

Ansible Role

This blog post explains how to use the role.