Files
infra/ansible/playbook/local-setup-admin-user.yaml
shockrah fbe6e5c3e2
Some checks failed
Ansible Linting / build (push) Failing after 16s
Secops Linting and Safety Checks / checkov-scan-s3 (push) Failing after 18s
Wiki Resources Sanity Checks / ruff-checks (push) Successful in 7s
Removing all ansible-linter errors
2026-04-26 01:35:56 -07:00

29 lines
862 B
YAML

# This playbook is meant to be a oneshot to be ran manually on the dev box
# The rest of the role stuff is meant to be ran as the admin user that
# this playbook creates for us
---
- name: Setup local admin user with a fresh ubuntu host
hosts: nigel.local
remote_user: nigel
vars:
admin:
username: nigel
tasks:
- name: Copy the nigel admin key
ansible.posix.authorized_key:
user: "{{ admin.username }}"
state: present
key: "{{ lookup('file', '~/.ssh/nigel/admin.pub') }}"
- name: Prevent password based logins
become: true
ansible.builtin.lineinfile:
dest: /etc/ssh/sshd_config
line: PasswordAuthentication no
state: present
backup: true
- name: Restart SSH Daemon
become: true
ansible.builtin.service:
name: ssh
state: restarted