ansible/test/integration
Adrian Likins a14d0f3586 Use vault_id when encrypted via vault-edit (#30772)
* Use vault_id when encrypted via vault-edit

On the encryption stage of
'ansible-vault edit --vault-id=someid@passfile somefile',
the vault id was not being passed to encrypt() so the files were
always saved with the default vault id in the 1.1 version format.

When trying to edit that file a second time, also with a --vault-id,
the file would be decrypted with the secret associated with the
provided vault-id, but since the encrypted file had no vault id
in the envelope there would be no match for 'default' secrets.
(Only the --vault-id was included in the potential matches, so
the vault id actually used to decrypt was not).

If that list was empty, there would be an IndexError when trying
to encrypted the changed file. This would result in the displayed
error:

ERROR! Unexpected Exception, this is probably a bug: list index out of range

Fix is two parts:

1) use the vault id when encrypting from edit

2) when matching the secret to use for encrypting after edit,
include the vault id that was used for decryption and not just
the vault id (or lack of vault id) from the envelope.

add unit tests for #30575 and intg tests for 'ansible-vault edit'

Fixes #30575
2017-09-26 12:28:31 -04:00
..
targets Use vault_id when encrypted via vault-edit (#30772) 2017-09-26 12:28:31 -04:00
asa.yaml Fix trailing space in ec2_vol example, fix 'the the' typos (#28440) 2017-08-19 23:00:51 +02:00
cloud-config-aws.yml.template Add region to ansible-test AWS cloud config. (#30733) 2017-09-22 00:19:21 -07:00
cloud-config-azure.yml.template Fix Azure config template. 2017-08-16 12:17:38 -07:00
cloud-config-cs.ini.template
dellos6.yaml
dellos9.yaml
dellos10.yaml
eos.yaml Fix trailing space in ec2_vol example, fix 'the the' typos (#28440) 2017-08-19 23:00:51 +02:00
integration_config.yml
inventory Fixes #28540: Corrected ansible_host value for facthost[0:20] from 1270.0.0.1 to 127.0.0.1 (#28541) 2017-08-28 13:19:07 -04:00
inventory.network
inventory.networking.template
inventory.remote.template
inventory.winrm.template
ios.yaml IOS Ping: Add new module to support ping tests from IOS devices (#28557) 2017-08-29 11:21:49 -04:00
iosxr.yaml Fix trailing space in ec2_vol example, fix 'the the' typos (#28440) 2017-08-19 23:00:51 +02:00
junos.yaml Fix trailing space in ec2_vol example, fix 'the the' typos (#28440) 2017-08-19 23:00:51 +02:00
network-all.yaml
network-integration.cfg Increase socket connect retry timeout for integration test (#30681) 2017-09-21 15:02:19 +05:30
nxos.yaml Fix nxos_snmp_community idempotence issue (#30388) 2017-09-15 07:45:51 -07:00
ops.yaml Fix trailing space in ec2_vol example, fix 'the the' typos (#28440) 2017-08-19 23:00:51 +02:00
platform_agnostic.yaml remove net_command (#28525) 2017-08-23 02:07:39 +05:30
target-prefixes.network
vyos.yaml Fix trailing space in ec2_vol example, fix 'the the' typos (#28440) 2017-08-19 23:00:51 +02:00