Commit Graph

67 Commits (80652ad054ecc32c1c9f5b78315862811210c080)

Author SHA1 Message Date
Abhijit Menon-Sen b6de6e69a6 Also support output to stdout with no arguments
This allows "cat plaintext|ansible-vault encrypt > ciphertext".
2015-08-27 22:04:18 +05:30
Abhijit Menon-Sen e7eebb6954 Implement cat-like filtering behaviour for encrypt/decrypt
This allows the following invocations:

    # Interactive use, like gpg
    ansible-vault encrypt --output x

    # Non-interactive, for scripting
    echo plaintext|ansible-vault encrypt --output x

    # Separate input and output files
    ansible-vault encrypt input.yml --output output.yml

    # Existing usage (in-place encryption) unchanged
    ansible-vault encrypt inout.yml

…and the analogous cases for ansible-vault decrypt as well.

In all cases, the input and output files can be '-' to read from stdin
or write to stdout. This permits sensitive data to be encrypted and
decrypted without ever hitting disk.
2015-08-27 22:04:18 +05:30
Abhijit Menon-Sen b84053019a Make the filename the first argument to rekey_file 2015-08-26 19:54:59 +05:30
Abhijit Menon-Sen 20fd9224bb Pass the filename to the individual VaultEditor methods, not __init__
Now we don't have to recreate VaultEditor objects for each file, and so
on. It also paves the way towards specifying separate input and output
files later.
2015-08-26 19:17:37 +05:30
Abhijit Menon-Sen f91ad3dabe Don't pass the cipher around so much
It's unused and unnecessary; VaultLib can decide for itself what cipher
to use when encrypting. There's no need (and no provision) for the user
to override the cipher via options, so there's no need for code to see
if that has been done either.
2015-08-26 18:31:45 +05:30
Richard Poole 3090a45891 add option to ansible-vault to read new password from file for rekey
The --new-vault-password-file option works the same as
--vault-password-file but applies only to rekeying (when
--vault-password-file sets the old password). Also update the manpage
to document these options more fully.
2015-08-25 21:14:49 +05:30
Abhijit Menon-Sen 3aedc0bca9 Don't insist on ansible-vault taking only one filename parameter
Apart from ansible-vault create, every vault subcommand is happy to deal
with multiple filenames, so we can check that there's at least one, and
make create check separately that there aren't any extra.
2015-08-23 17:52:51 -04:00
Brian Coca bedfe00de8 Merge pull request #11336 from saada/patch-1
Update Vault rekey() in vault.py to validate files passed before input
2015-07-29 12:52:14 -04:00
Mahmoud Saada ddd46f6599 Update rekey() in vault.py to validate files passed exist before prompting for password 2015-07-29 09:03:15 -07:00
Brian Coca f66ba92745 now vault prompts for password if no password file was given, as in 1.x 2015-07-19 22:24:20 -04:00
Brian Coca 3c7faa8378 fixed missing self in self.action on rekey in vault
fixes #11584
2015-07-14 10:10:03 -04:00
Brian Coca 032690a843 fix read_vault_password_file ref 2015-07-11 15:05:32 -04:00
Brian Coca fe91f7b506 moved read_vault_file to CLI from utils and renamed to clearer read_vault_password_file 2015-07-11 14:24:45 -04:00
Brian Coca 5f791329ce now verbose mode shows config file used 2015-07-04 10:23:49 -04:00
Brian Coca e153f76c95 now validate that we do get a vault password 2015-06-27 00:02:24 -04:00
Edward J Kim 6a5a930c5a Add missing import in vault.py 2015-06-05 23:04:21 -04:00
James Cammarata ce3ef7f4c1 Making the switch to v2 2015-05-03 21:47:26 -05:00