From 31d677447525591a86d5e348eab54dc620bb719a Mon Sep 17 00:00:00 2001 From: Maksim Bolshakov Date: Tue, 23 Aug 2022 10:06:23 +0300 Subject: [PATCH] Add new example --- examples/hashivault_plugin_example.yaml | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 examples/hashivault_plugin_example.yaml diff --git a/examples/hashivault_plugin_example.yaml b/examples/hashivault_plugin_example.yaml new file mode 100644 index 0000000..b2e5df6 --- /dev/null +++ b/examples/hashivault_plugin_example.yaml @@ -0,0 +1,31 @@ +- hosts: localhost + tasks: + - name: Read a kv2 secret with kv mount point + vars: + ansible_hashi_vault_auth_method: ldap + ansible_hashi_vault_username: username + ansible_hashi_vault_password: pwd + ansible_hashi_vault_engine_mount_point: kv + ansible.builtin.set_fact: + response: "{{ lookup('community.hashi_vault.vault_kv2_get', 'secret', url='https://vault.domain.local') }}" + + - name: create a VM using app_secret from hashicorp vault + decort_kvmvm: + annotation: "VM managed by decort_kvmvm module" + authenticator: oauth2 + app_id: "" # Application id from SSO Digital Energy + app_secret: "{{ response.data.password }}" # API key from SSO Digital Energy + controller_url: "https://cloud.digitalenergy.online" + name: hashivault_read_example + cpu: 2 + ram: 2048 + boot_disk: 10 + image_name: "DECS Ubuntu 18.04 v1.2.3" #Name of OS image + networks: + - type: VINS + id: 99 #VINS id + tags: "Ansible hashivault_read example" + state: present + rg_id: 99 #Resource group id + delegate_to: localhost + register: simple_vm