to calll the following playbook
ansible-playbook single-user-creation-eris-farm.yml -e '{"uname":"testuser", "akey":"ssh-dss AAAAB3NzaC1kc3MAAACBALmPgekfYL5fL8PcJ/UExF5TIntjAb14FsNB6sF8xqZkRq+1zal4OBauvGEk73VoTyWceACiyTzaAkVoijzIIqKNMapGtO4IOEEvw5QySkhU1/+/MMCszdHvl51AtrKOZWFHZNdRJvBy7vpCKVmiFCvJTCrH5E+6Kom2ittrIag9AAAAFQCwbf3dzvA1QEDHMEoK+e5HOfoCDwAAAIEAhjF6SRE2O8qmHBul04SN3qpPfwTHaTYXyzSi187LhAoc9yOiAXyjWnGrZ8w/AuRjaTk1nfAjSQ3dNkTCsopm3shnjNV96GxBepY04SseXSAwlnPo1smCK84XbvUFrfzc+JbHwK6BosuH2sXThRWf6jKmnM7ptfSX/ibd7bKRwKAAAACBAK56UDDJD0092YGXQ6z0RG9c9qsXTI0BCiNjP5PNbLGc7YSfnL7JMme1n/R1PST9RXhVSHXjJ6ca2aSzz0kCSFs0pmgY0xFzNWGhU98j6hpl/Os9kJzauvXdXoAKExOhRSGHPY0rAJl8Ni0R1NM+E4PssI9/WqU1Ypz3Rcsn23OgF8 username@hostname"}'
ansible-playbook single-user-creation-eris-farm.yml -e '{"uname":"testuser", "akey":"ssh-dss AAAAB3NzaC1kc3MAAACBALmPgekfYL5fL8PcJ/UExF5TIntjAb14FsNB6sF8xqZkRq+1zal4OBauvGEk73VoTyWceACiyTzaAkVoijzIIqKNMapGtO4IOEEvw5QySkhU1/+/MMCszdHvl51AtrKOZWFHZNdRJvBy7vpCKVmiFCvJTCrH5E+6Kom2ittrIag9AAAAFQCwbf3dzvA1QEDHMEoK+e5HOfoCDwAAAIEAhjF6SRE2O8qmHBul04SN3qpPfwTHaTYXyzSi187LhAoc9yOiAXyjWnGrZ8w/AuRjaTk1nfAjSQ3dNkTCsopm3shnjNV96GxBepY04SseXSAwlnPo1smCK84XbvUFrfzc+JbHwK6BosuH2sXThRWf6jKmnM7ptfSX/ibd7bKRwKAAAACBAK56UDDJD0092YGXQ6z0RG9c9qsXTI0BCiNjP5PNbLGc7YSfnL7JMme1n/R1PST9RXhVSHXjJ6ca2aSzz0kCSFs0pmgY0xFzNWGhU98j6hpl/Os9kJzauvXdXoAKExOhRSGHPY0rAJl8Ni0R1NM+E4PssI9/WqU1Ypz3Rcsn23OgF8 username@hostname"}'
{noformat}
---
#MAC systems
- hosts: mac
sudo: yes
# vars:
# ausers: [ uname ]
# akeys: [ key ]
tasks:
- name: Create user {{uname}}
user: name={{uname}} password="$6$3dqCf97I8iF$tcxY2fLNS/C41yixh8Bm7P.AAWB5NGybrkRlZlVpPyYAGoTrFxpth0IowidmuPODmZddSGINNNVDj/TlTdmEp1" groups="wheel" comment="{{uname}} account" shell=/bin/bash append=yes
- name: Install Authorized key
authorized_key: user={{uname}} manage_dir=yes state=present key="{{akey}}"
- name: uncomment SUDO FILE
lineinfile: "dest=/etc/sudoers state=present regexp='^#?%wheel' line='%wheel ALL=(ALL) NOPASSWD: ALL'"
{noformat}#MAC systems
- hosts: mac
sudo: yes
# vars:
# ausers: [ uname ]
# akeys: [ key ]
tasks:
- name: Create user {{uname}}
user: name={{uname}} password="$6$3dqCf97I8iF$tcxY2fLNS/C41yixh8Bm7P.AAWB5NGybrkRlZlVpPyYAGoTrFxpth0IowidmuPODmZddSGINNNVDj/TlTdmEp1" groups="wheel" comment="{{uname}} account" shell=/bin/bash append=yes
- name: Install Authorized key
authorized_key: user={{uname}} manage_dir=yes state=present key="{{akey}}"
- name: uncomment SUDO FILE
lineinfile: "dest=/etc/sudoers state=present regexp='^#?%wheel' line='%wheel ALL=(ALL) NOPASSWD: ALL'"
No comments:
Post a Comment