add ssh key option for apps

This way we can push ssh keys that can pull/push to repositories.  This
is very handy if we wish to edit/maintain the appinfo repository right
on the server where it is hosted....
This commit is contained in:
Peter 2025-08-15 22:48:55 +02:00
parent 5fda82d0d3
commit 0a32383de3

View file

@ -19,6 +19,23 @@
line: "export XDG_RUNTIME_DIR=/run/user/$(id -u)" line: "export XDG_RUNTIME_DIR=/run/user/$(id -u)"
regexp: ^export XDG_RUNTIME_DIR= regexp: ^export XDG_RUNTIME_DIR=
- name: "Ensure ssh configuration directory for user {{ ppm_app.user }}"
ansible.builtin.file:
state: directory
mode: "0700"
path: "{{ ppm_app_user.home }}/.ssh"
owner: "{{ ppm_app_user.name }}"
group: "{{ ppm_app_user.group }}"
- name: "Place ssh key for user {{ ppm_app.user }}"
ansible.builtin.copy:
src: "{{ ppm_app.sshkey }}"
mode: "0600"
dest: "{{ ppm_app_user.home }}/.ssh/id_rsa"
owner: "{{ ppm_app_user.name }}"
group: "{{ ppm_app_user.group }}"
when: ppm_app.sshkey is defined
- name: "Place configuration ({{ ppm_app.user }})" - name: "Place configuration ({{ ppm_app.user }})"
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ ppm_app.appconfig | dict2items | selectattr('key', 'ne', 'code') | items2dict | to_nice_yaml }}" content: "{{ ppm_app.appconfig | dict2items | selectattr('key', 'ne', 'code') | items2dict | to_nice_yaml }}"