Linting + bootstrap Ansible user
This commit is contained in:
14
bootstrap/create_ansible_user.sh
Executable file
14
bootstrap/create_ansible_user.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/env bash
|
||||
|
||||
PUBKEY=./id_ansible.pub
|
||||
|
||||
useradd ansible --create-home --shell /bin/bash
|
||||
# Ensure existing but unusable password (for Ubuntu)
|
||||
usermod -p '*' ansible
|
||||
mkdir /home/ansible/.ssh
|
||||
chown -R ansible:ansible /home/ansible/.ssh
|
||||
install -m 600 $PUBKEY /home/ansible/.ssh/authorized_keys
|
||||
chmod 700 /home/ansible/.ssh
|
||||
# Allow passwordless sudo
|
||||
echo "ansible ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/ansible
|
||||
|
||||
1
bootstrap/id_ansible_lab.pub
Normal file
1
bootstrap/id_ansible_lab.pub
Normal file
@@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINRKrmDyGyAKcFGHWakIcbG9C2bLW+XaNdrD4ws6d+lw nicolo@Sidereus
|
||||
Reference in New Issue
Block a user