community.general/lib/ansible
Adrian Likins e396d5d508 Implement vault encrypted yaml variables. (#16274)
Make !vault-encrypted create a AnsibleVaultUnicode
yaml object that can be used as a regular string object.

This allows a playbook to include a encrypted vault
blob for the value of a yaml variable. A 'secret_password'
variable can have it's value encrypted instead of having
to vault encrypt an entire vars file.

Add __ENCRYPTED__ to the vault yaml types so
template.Template can treat it similar
to __UNSAFE__ flags.

vault.VaultLib api changes:
    - Split VaultLib.encrypt to encrypt and encrypt_bytestring

    - VaultLib.encrypt() previously accepted the plaintext data
      as either a byte string or a unicode string.
      Doing the right thing based on the input type would fail
      on py3 if given a arg of type 'bytes'. To simplify the
      API, vaultlib.encrypt() now assumes input plaintext is a
      py2 unicode or py3 str. It will encode to utf-8 then call
      the new encrypt_bytestring(). The new methods are less
      ambiguous.

    - moved VaultLib.is_encrypted logic to vault module scope
      and split to is_encrypted() and is_encrypted_file().

Add a test/unit/mock/yaml_helper.py
It has some helpers for testing parsing/yaml

Integration tests added as roles test_vault and test_vault_embedded
2016-08-23 20:03:11 -04:00
..
cli Migrate basestring to a python3 compatible type (#17199) 2016-08-23 13:13:44 -07:00
compat Move py34 mock_open compat to compat/test/mock (#17157) 2016-08-19 18:11:24 -04:00
config Making the switch to v2 2015-05-03 21:47:26 -05:00
errors Fix some typos (#16498) 2016-06-29 14:31:25 -04:00
executor fix pycharm debugger issue on missing fileno 2016-08-23 17:00:14 -07:00
galaxy Migrate basestring to a python3 compatible type (#17199) 2016-08-23 13:13:44 -07:00
inventory Don't use an unset playbook basedir when searching for hostgroup vars 2016-08-17 16:28:48 -05:00
module_utils Merge pull request #17200 from privateip/netcfg 2016-08-23 17:08:29 -04:00
modules Update submodule refs 2016-08-23 06:39:30 -07:00
parsing Implement vault encrypted yaml variables. (#16274) 2016-08-23 20:03:11 -04:00
playbook Migrate basestring to a python3 compatible type (#17199) 2016-08-23 13:13:44 -07:00
plugins Migrate basestring to a python3 compatible type (#17199) 2016-08-23 13:13:44 -07:00
template Implement vault encrypted yaml variables. (#16274) 2016-08-23 20:03:11 -04:00
utils Migrate basestring to a python3 compatible type (#17199) 2016-08-23 13:13:44 -07:00
vars Don't use an unset playbook basedir when searching for hostgroup vars 2016-08-17 16:28:48 -05:00
__init__.py Fix ziploader for the cornercase of ansible invoking ansible. 2016-04-29 08:47:49 -07:00
constants.py * Fix race in creating temp directories pre-fork (#16965) 2016-08-04 19:35:36 -04:00
release.py Fix ziploader for the cornercase of ansible invoking ansible. 2016-04-29 08:47:49 -07:00
test-requirements.txt Making the switch to v2 2015-05-03 21:47:26 -05:00