From 9bbfb689bfb761c88bf88672e88caef3faa2b547 Mon Sep 17 00:00:00 2001 From: Gregor Michels Date: Thu, 30 Jun 2022 02:38:24 +0200 Subject: [PATCH] playbook_distribute_authorized_keys: make available on all platforms! --- playbook_distribute_authorized_keys.yml | 30 ++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/playbook_distribute_authorized_keys.yml b/playbook_distribute_authorized_keys.yml index 3fb1d14..2821776 100644 --- a/playbook_distribute_authorized_keys.yml +++ b/playbook_distribute_authorized_keys.yml @@ -1,10 +1,34 @@ --- -- name: distribute authorized_keys - hosts: all +- name: distribute authorized_keys on openwrt with python + hosts: + - gateways + - accesspoints gather_facts: no tasks: - - name: transfer authorized_keys + - name: deploy authorized_keys copy: src: files/authorized_keys dest: /etc/dropbear/authorized_keys mode: 0600 + +- name: distribute authorized_keys on openwrt with rsync + hosts: + - switches + gather_facts: no + tasks: + - name: deploy authorized_keys + synchronize: + src: files/authorized_keys + dest: /etc/dropbear/authorized_keys + owner: no + group: no + +- name: distribute authorized_keys everywhere else + hosts: + - server + - vms + tasks: + - name: deploy authorized_keys + authorized_key: + user: root + key: "{{ lookup('file', 'files/authorized_keys') }}"