This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The code below shows how to encrypt and then decrypt some plaintext into a cyphertext using | |
KMS's Encrypt/Decrypt functions and secretbox (https://godoc.org/golang.org/x/crypto/nacl/secretbox). | |
The plaintext message is sealed into a secretbox using a key that is generated by kmsClient.GenerateDataKey(). | |
Note that this procedure reuquires that a master key would *already exist in KMS* and that its arn/alias is specified. | |
The aws library assumes that the proper credentials can be found in the shared file (~/.aws/credentials) | |
and opts for the 'default' role. | |
Once sealed, the cyphertext is then unboxed, again by first getting the key from kms (kmsClient.Decrypt), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# This has been tested with ansible 1.3 with these commands: | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
# NB: The type of the variable is crucial! | |
- name: Ansible Conditionals Examples | |
hosts: $hosts | |
vars_files: |