Bootstrap FreeKB - Ansible - Retrieve Amazon Web Services (AWS) Secret Value
Ansible - Retrieve Amazon Web Services (AWS) Secret Value

Updated:   |  Ansible articles

If you are not familiar with modules, check out Ansible - Getting Started with Modules.

Prerequisites

Here is an example of how to use set_fact to create a variable named greeting that contains the value of the greeting secret.

---
- hosts: localhost
  tasks:
  - name: retrieve the value of the greeting secret
    set_fact:
      greeting: "{{ lookup('amazon.aws.aws_secret', 'greeting' ) }}"

  - debug:
      var: greeting
...

 

Something like this should be returned.

ok: [localhost] => {
    "msg": {
        "greeting": "Hello World"
    }
}

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 084973 in the box below so that we can be sure you are a human.