Transfer sesam access key to pi authorized keys

This commit is contained in:
Stefan Haun 2022-07-23 20:10:37 +02:00
parent 5495c93ed9
commit bd99ebe684

View file

@ -70,11 +70,27 @@
shell: /home/sesam/door-open.sh shell: /home/sesam/door-open.sh
groups: i2c groups: i2c
append: yes append: yes
generate_ssh_key: yes
- name: Get the SSH public key for sesam
ansible.builtin.slurp:
src: /home/sesam/.ssh/id_rsa.pub
register: sesam_key
- name: Add SSH public identity as authorized key to pi
ansible.posix.authorized_key:
user: "{{ gatekeeper_user }}"
state: present
key: "{{ sesam_key['content'] | b64decode }}"
comment: "Sesam access"
- name: Copy door-open.ssh for sesam - name: Copy door-open.ssh for sesam
ansible.builtin.copy: ansible.builtin.copy:
src: files/platon/sesam-door-open.sh src: files/platon/sesam-door-open.sh
dest: /home/sesam/door-open.sh dest: /home/sesam/door-open.sh
owner: sesam
group: sesam
mode: "0755"
### Gatekeeper user (pi for now) ### Gatekeeper user (pi for now)