hardened & organised the authn keys
This commit is contained in:
parent
c0c47e244a
commit
53553da69d
|
|
@ -7,28 +7,28 @@ all:
|
|||
ansible_host: 192.168.1.10
|
||||
ansible_port: 8883
|
||||
ansible_user: admin
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_rsa_ansible
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_ed25519
|
||||
ansible_become: yes
|
||||
ansible_become_method: sudo
|
||||
mycloud:
|
||||
ansible_host: 192.168.1.219
|
||||
ansible_port: 22
|
||||
ansible_user: sshd
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_rsa_ansible
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_ed25519
|
||||
ansible_become: yes
|
||||
ansible_become_method: sudo
|
||||
rpi4:
|
||||
ansible_host: 192.168.1.151
|
||||
ansible_user: root
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_rsa_ansible
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_ed25519
|
||||
acemagic:
|
||||
ansible_host: 192.168.1.132
|
||||
ansible_user: root
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_rsa_ansible
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_ed25519
|
||||
mikrotik:
|
||||
ansible_host: 192.168.1.1
|
||||
ansible_user: admin
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_rsa_ansible
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_ed25519
|
||||
ftp_servers:
|
||||
hosts:
|
||||
acemagic:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
mikrotik_ssh_key: "/home/seba/.ssh/id_rsa_ansible"
|
||||
mikrotik_ssh_key: "/home/seba/.ssh/id_ed25519"
|
||||
mikrotik_ssh_key_filename: "id_ed25519"
|
||||
mikrotik_user: "admin"
|
||||
backup_dest_path: "/home/seba/googledrive/backups_n_configs/mikrotik/"
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
- name: Bootstrap SSH key to MikroTik
|
||||
community.network.routeros_command:
|
||||
commands:
|
||||
- /file print file=id_rsa_ansible.pub
|
||||
- /file set id_rsa_ansible.pub contents="{{ lookup('file', mikrotik_ssh_key + '.pub') }}"
|
||||
- /user ssh-keys import public-key-file=id_rsa_ansible.pub user={{ mikrotik_user }}
|
||||
- /file remove id_rsa_ansible.pub
|
||||
- /file print file={{ mikrotik_ssh_key_filename }}.pub
|
||||
- /file add name={{ mikrotik_ssh_key_filename }}.pub contents="{{ lookup('file', mikrotik_ssh_key + '.pub') }}"
|
||||
- /user ssh-keys import public-key-file={{ mikrotik_ssh_key_filename }}.pub user={{ mikrotik_user }}
|
||||
- /file remove {{ mikrotik_ssh_key_filename }}.pub
|
||||
when: bootstrap | default(false) | bool
|
||||
|
||||
- name: Schedule daily MikroTik backup on local cron
|
||||
|
|
|
|||
Loading…
Reference in New Issue