aboutsummaryrefslogtreecommitdiff
path: root/content/blog/ansible/ansible-vault-example.md
diff options
context:
space:
mode:
authorJulien Dessaux2023-04-23 22:33:49 +0200
committerJulien Dessaux2023-04-23 22:34:10 +0200
commitea435049b3a3f5057b3a894040df3cf4f3256d9e (patch)
tree9046430870fa050e6568fcfbe409f8a8d295d0b3 /content/blog/ansible/ansible-vault-example.md
parentDocument the second gotosocial backup job (diff)
downloadwww-ea435049b3a3f5057b3a894040df3cf4f3256d9e.tar.gz
www-ea435049b3a3f5057b3a894040df3cf4f3256d9e.tar.bz2
www-ea435049b3a3f5057b3a894040df3cf4f3256d9e.zip
Refactored syntax highlighting shortcodes into markdown
Diffstat (limited to '')
-rw-r--r--content/blog/ansible/ansible-vault-example.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/content/blog/ansible/ansible-vault-example.md b/content/blog/ansible/ansible-vault-example.md
index ac68feb..cd8567a 100644
--- a/content/blog/ansible/ansible-vault-example.md
+++ b/content/blog/ansible/ansible-vault-example.md
@@ -9,31 +9,31 @@ tags:
## Editing a protected file
Here is how to edit a vault protected file :
-{{< highlight sh >}}
+```sh
ansible-vault edit hostvars/blah.yml
-{{< / highlight >}}
+```
## Using a vault entry in a task or a jinja template
It is as simple as using any variable :
-{{< highlight yaml >}}
+```yaml
- copy:
path: /etc/ssl/private.key
mode: 0400
content: '{{ ssl_key }}'
-{{< / highlight >}}
+```
## How to specify multiple lines entries
This is actually a yaml question, not a vault one but since I ask myself this frequently in this context here is how to put a multiple lines entry like a private key in vault (for a simple value, just don't use a `|`):
-{{< highlight yaml >}}
+```yaml
ssl_key : |
----- BEGIN PRIVATE KEY -----
blahblahblah
blahblahblah
----- END PRIVATE KEY -----
-{{< /highlight >}}
+```
## How to run playbooks when vault values are needed