Commit Graph

86 Commits (2ac931d6c9717353fb46984e5aabe8a894e6e3f8)

Author SHA1 Message Date
Brian Coca 2b28cdc0dd be more tolerant with non list descriptions 2015-08-27 14:57:50 -04:00
Abhijit Menon-Sen 090cfc9e03 More helpful prompts from ansible-vault encrypt/decrypt
Now we issue a "Reading … from stdin" prompt if our input isatty(), as
gpg does. We also suppress the "x successful" confirmation message at
the end if we're part of a pipeline.

(The latter requires that we not close sys.stdout in VaultEditor, and
for symmetry we do the same for sys.stdin, though it doesn't matter in
that case.)
2015-08-27 22:04:18 +05:30
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 32b38d4e29 Fix add_option indentation for consistency before adding another option 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
Brian Coca 154754ae50 pushed module_loader to task_queue_manager so all cli's can benefit from it
also normalized -M option across all cli
fixes #12016
2015-08-25 18:14:03 -04:00
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
Brian Coca 16f3f8e244 now does not error out when notes are not included in module 2015-08-24 13:24:58 -04:00
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 e8157eab19 now output works for both search and info 2015-08-22 02:42:21 -04:00
Brian Coca a6c0661d21 made src more prominent 2015-08-22 02:33:17 -04:00
Brian Coca 6ffd9c3025 draft galaxy cli search
TODO: paging results
2015-08-22 02:28:27 -04:00
Brian Coca 26ed50ecdf fixed indent 2015-08-18 09:58:25 -04:00
Brian Coca 17b4b1f85c added ability to limit in ansilbe pull
refactored the options a bit, new inventory_opts made sense to always group
fixes #7917
2015-08-18 03:17:58 -04:00
Brian Coca 6058eaa92f removed unused poller 2015-08-16 20:12:06 -04:00
Brian Coca 9b61cf5840 implemented async tasks in adhoc v2 2015-08-16 20:05:10 -04:00
Brian Coca 92e2f54228 fixed issues with utf-8 encoding in docs, moved pager to use display class instad of bare prints 2015-08-14 22:00:48 -04:00
Brian Coca 39f81a8fa5 removed unused imports 2015-08-12 10:35:49 -04:00
Brian Coca c27978fa93 minor fixes to pull 2015-08-12 10:35:49 -04:00
Brian Coca 9f29e39dea give more matching options for ansible-pull 2015-08-12 10:35:49 -04:00
Brian Coca 4d853a5d3c implemented for v2, missing --tree option for adhoc 2015-08-11 19:18:10 -04:00
Brian Coca 15a20e814b added tags back to ansible-pull 2015-08-06 17:37:05 -04:00
Abhijit Menon-Sen 8de70fa657 Disallow --forks 0
Without at least one worker process, things break:

Traceback (most recent call last):
  File "/home/ams/extern/ansible/ansible/lib/ansible/executor/process/result.py", line 103, in run
    result = self._read_worker_result()
  File "/home/ams/extern/ansible/ansible/lib/ansible/executor/process/result.py", line 69, in _read_worker_result
    (worker_prc, main_q, rslt_q) = self._workers[self._cur_worker]
IndexError: list index out of range
2015-08-02 14:10:45 +05:30
Abhijit Menon-Sen 1f2adb5e14 Show a better message when ansible.cfg is not found
Earlier we would say «Using  as config file» if we didn't find one.
2015-08-01 19:44:20 +05:30
Abhijit Menon-Sen 694d2103b1 Remove outdated FIXME code
This is already handled in PlayContext.set_options.
2015-07-30 23:12:06 +05:30
Brian Coca 17f659a143 added some debug to galaxy 2015-07-30 12:35:27 -04:00
Brian Coca 29bc8f51d7 made tags display closer to v1 2015-07-30 12:35:27 -04:00
Brian Coca 0e77871426 fixed non ignore errors path to actually interrupt
fixed cases where missing/inaccessible file gave exception, now you get nice error
2015-07-29 20:13:17 -04:00
Brian Coca e81ec32719 made galaxy more resilient with bad yaml files and comments/spaces in non yaml files
fixes #10641
2015-07-29 19:28:29 -04:00
Brian Coca ced93d35ca adjusted list hosts across adhoc and playbook cli 2015-07-29 15:46:13 -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 0784fa1765 removed import q 2015-07-29 11:00:04 -04:00
Brian Coca 96bcf50a94 implemented requirements file in v2
fixes #11179
2015-07-29 10:59:33 -04:00
Brian Coca 132c14eb57 indented hosts 2015-07-28 22:31:40 -04:00
Brian Coca c0c094c413 now all --list options are working! 2015-07-28 22:30:59 -04:00
Brian Coca 884435a1aa minor cosmetic changes to list options 2015-07-28 22:14:41 -04:00
Brian Coca 056602c424 rearranged --list- options, now they are consolidated when used toghether, less loops, more concise output
list-hosts works
list-tasks works, but needs better task naming (missing role info)
list-tags only shows play tags
2015-07-28 22:05:49 -04:00
Abhijit Menon-Sen 65d62090c2 A better error message for «ansible playbook.yml»
This is a very conservative change: we add the hint only if we're
definitely going to die already.
2015-07-27 12:43:21 +05:30
Brian Coca 7215470c6f implemented galaxy list in v2 2015-07-24 16:18:55 -04:00
Will Thames 9abd9a8f57 Make ansible-galaxy work with galaxy.ansible.com
Now works with role files that use Ansible Galaxy roles
Still work to do on making this work with internal roles
2015-07-24 16:04:10 -04:00
James Cammarata 698479a623 Add config file info to --version output
Fixes #10348
2015-07-23 15:32:39 -04:00
James Cammarata b8b206005c Generalize extra variable parsing and loading
Fixes #11352
2015-07-21 00:18:35 -04: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 a8ba9cac3f fixed ansible pull bad options ref, removed print in favor of display 2015-07-19 18:28:03 -04:00
Brian Coca 6ba706f753 minor doc reformatting
now version_added < 1.3 does not get shown, up from 1.0
option's version_added is also now filterd against this threshold
module version_added is more prominent
exaples now uses pure rst instead of intermingled with html formatting
aliases now shown in description for options
bad version fields now throw warnings instead of exceptions
ansible-doc errors now show traceback in very very verbose mode, for easier debugging
2015-07-17 10:07:22 -04:00
Brian Coca 5ba9fe4748 now supports maintainers and author field for display as MAINTAINERS 2015-07-16 15:18:33 -04:00