initial deployment
This commit is contained in:
25
ansible/provisoning/add_public_keys.yaml
Normal file
25
ansible/provisoning/add_public_keys.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
- hosts: all
|
||||
|
||||
become: yes
|
||||
tasks:
|
||||
|
||||
# Installs public key
|
||||
# --
|
||||
#
|
||||
- name: install public keys
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ lookup('env','USER') }}"
|
||||
state: present
|
||||
key: "{{ lookup('file', '~/.ssh/ansible_id_rsa.pub') }}"
|
||||
|
||||
# (Optional)
|
||||
# Set all sudoers to no password
|
||||
# --
|
||||
- name: change sudoers file
|
||||
lineinfile:
|
||||
path: /etc/sudoers
|
||||
state: present
|
||||
regexp: '^%sudo'
|
||||
line: '%sudo ALL=(ALL) NOPASSWD: ALL'
|
||||
validate: /usr/sbin/visudo -cf %s
|
||||
Reference in New Issue
Block a user