semaphoreui / semaphore

Modern UI for Ansible, Terraform, OpenTofu, Bash, Pulumi.
https://semaphoreui.com
MIT License
10.23k stars 1.03k forks source link

Question: How do I access Key Store Keys in a playbook? #2117

Open MichaelMrt opened 2 months ago

MichaelMrt commented 2 months ago

Question

I have created a Key in the Keystore for a db-user-password and picked login with password while keeping the optional Login empty.

Now I need to access this key through a var in a Playbook to connect to a database. The documentation is not showing how to do that, also #919 and #972 explain how to store it in the UI, but not how to reference the Key in a playbook.

Is this even possible?

I tried something like:

- name: Key Store access
  hosts: my_host

  tasks:
    - name: print key
      debug:
        msg: "{{ lookup('env', 'SECRET_KEY') }}"

Related to

Documentation

timteka commented 1 month ago

Same problem. We want to securely distribute ssh private keys across numerous servers. But stuck with unclear vault use cases.