Huge update (backup, swarm , vault ....)
This commit is contained in:
36
test-vault.yml
Normal file
36
test-vault.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
---
|
||||
- name: Swarm
|
||||
hosts: testswarm
|
||||
become: true
|
||||
gather_facts: false
|
||||
|
||||
|
||||
# apt-get install sshpass
|
||||
|
||||
# #
|
||||
# # @author Stéphane Gratias (2021).
|
||||
#
|
||||
|
||||
pre_tasks:
|
||||
|
||||
|
||||
# "{{ lookup('hashi_vault', 'secret=apps/data/my-app token=s.7z1Vxxx url=https://vault.kar.int')['data']['username'] }}"
|
||||
|
||||
# pip install hvac
|
||||
|
||||
# https://open-amt-cloud-toolkit.github.io/docs/2.0/Docker/dockerLocal_prodVault/
|
||||
|
||||
# https://elatov.github.io/2022/01/using-hashicorp-vault-with-ansible/
|
||||
|
||||
# vault secrets enable -path=apps kv-v2
|
||||
# vault kv get apps/my-app
|
||||
# vault token create -explicit-max-ttl=8760h -policy=test -ttl=720h -renewable=true -display-name=test
|
||||
|
||||
# - ansible.builtin.debug:
|
||||
# msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=/apps/my-app:test token=hvs.CAESIB4eVBWqRNDgcGXJpmvBe9nCpvCJ9-kM-OXq2p1WGlfBGh4KHGh2cy4xdFBYNnNMUEROOVlxOWFad3hERHI5Ulc url=http://myvault:8200') }}"
|
||||
|
||||
- name: Return all secrets from a path
|
||||
delegate_to: localhost
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=apps/data/postgres token=prout url=https://hash.jingoh.fr') }}"
|
||||
Reference in New Issue
Block a user