As far as I know, you can only do this by referencing PVCs that can be bound to the containers using the extra_volumes, web_extra_volume_mounts, task_extra_volume_mounts, and ee_extra_volume_mounts directives, likes so:
extra_volumes: |
- name: ssh-config
persistentVolumeClaim:
# This volume claim (and its matching volume) must be created manually
claimName: ssh-config
- name: static-data
persistentVolumeClaim:
# This volume claim (and its matching volume) must be created manually
claimName: arkcase-static-data
web_extra_volume_mounts: |
- name: ssh-config
mountPath: /etc/ssh/ssh_config.d
- name: static-data
mountPath: /var/lib/projects
task_extra_volume_mounts: |
- name: ssh-config
mountPath: /etc/ssh/ssh_config.d
ee_extra_volume_mounts: |
- name: ssh-config
mountPath: /etc/ssh/ssh_config.d
This is what I ended up doing to distribute specific SSH configurations that were required (not keys, but rather configurations the ssh client should apply when attempting connections).
I did look at the source code while researching this and I didn't see a clean way to do more "arbitrary" volume mounts here. The issue stems from the schema for the AWXS definition file restricting the kinds of "magic" one can do with it. I have no doubt something like what you suggest could be supported, but it would definitely require quite a few changes in several places.
Cheers!