Playbook for Linux Users - SomethingGeneric/sparkle.local GitHub Wiki
Run Linux passwordless SSH commands
Make sure you re-run these commands everytime you come back to your machine!
eval $(ssh-agent)
ssh-add -t 14400
Make the playbook
- make
linux_users.yml
file in theansible
directory
- use your favorite text editor to make your playbook!
---
- name: Create a Linux Local User
hosts: linux
become: yes
tasks:
- name: Add user sparkle-gremlin
user:
name: sparkle-gremlin
password: "{{ 'password' | password_hash('sha512') }}"
shell: /bin/bash
home: /home/sparkle-gremlin
Run the playbook
ansible-playbook -u sparkle-deployer -i linux_hosts.txt linux_user.yml
- I am running this command form the
sparkle
user account so using theu
command allows me to specify that I want the playbook to run with thesparkle-deployer
account. - the
-i
flag lets you tell ansible which inventory file you will be using.
- I am running this command form the
SSH into new accounts on the linux machines!
docker-sparkle
ssh sparkle-gremlin@docker-sparkle
util-sparkle
ssh sparkle-gremlin@util-sparkle
dhcp1-razzle
ssh sparkle-gremlin@dchp1-razzle
dhcp2-dazzle
ssh sparkle-gremlin@dchp2-dazzle