added docs for vault and made trigger shorter: !vault (#20985)

* added docs for vault and made trigger shorter: !vault

* added single var valuting

* Update playbooks_vault.rst

Edit pass for spelling and grammar. Ship it!

* Update playbooks_vault.rst

Typo fixes.
This commit is contained in:
Brian Coca 2017-02-03 15:28:50 -05:00 committed by GitHub
commit a2c38c47aa
7 changed files with 31 additions and 8 deletions

View file

@ -156,6 +156,4 @@ AnsibleConstructor.add_constructor(
u'!unsafe',
AnsibleConstructor.construct_yaml_unsafe)
AnsibleConstructor.add_constructor(
u'!vault-encrypted',
AnsibleConstructor.construct_vault_encrypted_unicode)
AnsibleConstructor.add_constructor(u'!vault', AnsibleConstructor.construct_vault_encrypted_unicode)

View file

@ -40,7 +40,7 @@ def represent_hostvars(self, data):
# Note: only want to represent the encrypted data
def represent_vault_encrypted_unicode(self, data):
return self.represent_scalar(u'!vault-encrypted', data._ciphertext.decode(), style='|')
return self.represent_scalar(u'!vault', data._ciphertext.decode(), style='|')
if PY3:
represent_unicode = yaml.representer.SafeRepresenter.represent_str

View file

@ -73,7 +73,7 @@ class AnsibleSequence(AnsibleBaseYAMLObject, list):
class AnsibleVaultEncryptedUnicode(yaml.YAMLObject, AnsibleUnicode):
__UNSAFE__ = True
__ENCRYPTED__ = True
yaml_tag = u'!vault-encrypted'
yaml_tag = u'!vault'
@classmethod
def from_plaintext(cls, seq, vault):