Compare commits

..

2 Commits

Author SHA1 Message Date
Vincent Stuyck
57fef3ca81 add create ansible user script for new servers 2025-07-20 00:22:39 +02:00
Vincent Stuyck
42ebc08206 do not update proxmox. should be done seperatly 2025-07-20 00:22:22 +02:00
2 changed files with 19 additions and 1 deletions

18
create-ansibleuser.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
groupadd -g 3003 ansible
useradd -g 3003 -u 994 -m -r ansible
usermod -aG ansible vst
mkdir /home/ansible/.ssh
cat << EOL > /home/ansible/.ssh/authorized_keys
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMuxBznuFNFztZt1MbuDRdww7LdmWq0dpK7F3Is/gMPO ansible@semaphore
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMqPCol1eSm4vrAYK0XEaq05n6BAQqQVJOAWhRItfZRS vst@yuuki
EOL
chown -R ansible: /home/ansible/.ssh
chmod 400 /home/ansible/.ssh/authorized_keys
cat << EOL > /etc/sudoers.d/ansible
%ansible ALL = (ALL) NOPASSWD: ALL
EOL

View File

@ -1,6 +1,6 @@
--- ---
# source: https://www.jeffgeerling.com/blog/2022/ansible-playbook-upgrade-ubuntudebian-servers-and-reboot-if-needed # source: https://www.jeffgeerling.com/blog/2022/ansible-playbook-upgrade-ubuntudebian-servers-and-reboot-if-needed
- hosts: ubuntu:proxmox - hosts: ubuntu
gather_facts: yes gather_facts: yes
become: yes become: yes