mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-01-23 20:39:26 +00:00
34 lines
794 B
YAML
Executable File
34 lines
794 B
YAML
Executable File
- hosts: "{{ hosts }}"
|
|
|
|
become: true
|
|
tasks:
|
|
|
|
# Deploy SSH Key
|
|
# --
|
|
- name: Download id_rsa
|
|
ansible.builtin.get_url:
|
|
url: http://192.168.77.106:48000/ssh/id_rsa
|
|
dest: ~/.ssh/id_rsa
|
|
mode: '0600'
|
|
- name: Download foo.conf
|
|
ansible.builtin.get_url:
|
|
url: http://192.168.77.106:48000/ssh/id_rsa.pub
|
|
dest: ~/.ssh/id_rsa.pub
|
|
mode: '0600'
|
|
|
|
- name: install public keys
|
|
ansible.posix.authorized_key:
|
|
user: "{{ user }}"
|
|
state: present
|
|
key: "{{ lookup('file', new_ssh_key_file) }}"
|
|
|
|
|
|
# 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 |