From e48d959aefd57cc0da1e522b3caaebd151f1d5e2 Mon Sep 17 00:00:00 2001 From: Jochen Demmer Date: Wed, 19 Oct 2022 13:52:22 +0200 Subject: [PATCH] breaking change to dropbear key handling openwrt_dropbkear_keys -> openwrt_dropbear_keyshost -> openwrt_dropbear_keysgroup see https://wiki.junicast.de/de/junicast/docs/AnsibleOpenWrtCollection/RolleDropbear --- roles/ansible_openwrtdropbear/tasks/main.yml | 2 ++ roles/ansible_openwrtdropbear/tasks/merge.yml | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 roles/ansible_openwrtdropbear/tasks/merge.yml diff --git a/roles/ansible_openwrtdropbear/tasks/main.yml b/roles/ansible_openwrtdropbear/tasks/main.yml index 22852de..a95e96f 100644 --- a/roles/ansible_openwrtdropbear/tasks/main.yml +++ b/roles/ansible_openwrtdropbear/tasks/main.yml @@ -1,5 +1,7 @@ --- # tasks file for ansible_openwrtdropbear +- name: merge keys from group and host definitions + include_tasks: merge.yml - name: make sure deploypath config exists ansible.builtin.file: path: "{{ openwrt_dropbear_deploypath }}" diff --git a/roles/ansible_openwrtdropbear/tasks/merge.yml b/roles/ansible_openwrtdropbear/tasks/merge.yml new file mode 100644 index 0000000..6c48447 --- /dev/null +++ b/roles/ansible_openwrtdropbear/tasks/merge.yml @@ -0,0 +1,8 @@ +# Merge keys +- name: merge group keys + ansible.builtin.set_fact: + openwrt_dropbear_keysmergedgroup: "{{ openwrt_dropbear_keysgroup.keys() | list | intersect(group_names) | map('extract', openwrt_dropbear_keysgroup) | combine }}" + when: openwrt_dropbear_keysgroup is defined +- name: combine all keys into openwrt_dropbear_keys + ansible.builtin.set_fact: + openwrt_dropbear_keys: "{{ openwrt_dropbear_keyshost | default([]) + openwrt_dropbear_keysmergedgroup | default([]) }}"