Matt Martz
38b663471d
Merge pull request #14311 from sivel/unsafe-yaml-constructor
...
Add new 'unsafe' YAML constructor
2016-02-23 11:29:53 -06:00
Brian Coca
0f73fb0d6f
better error messages when failing to decrypt
2016-02-18 08:57:28 -08:00
Jonathan Davila
b220051c14
Added more info to the no action detected error
...
Error fix
2016-02-08 16:51:10 -05:00
Matt Martz
8bc2d3be9c
Add new 'unsafe' YAML constructor
2016-02-04 10:08:42 -06:00
Brian Coca
db375c22af
load now does not modify the incomming data
...
also removed json loader as yaml loader can do both
2016-01-28 19:43:17 -05:00
Brian Coca
c063803a91
raise AnsibleError as an 'expected' exception
...
fixes #14065
2016-01-25 22:20:55 -05:00
Brian Coca
f26adcc7da
avoid shredding empty files, also x/0
...
also cleaned up unused import and exception var
2016-01-21 10:54:56 -05:00
James Cammarata
46e515131e
Allow module args as k=v pairs when using the module: option with local_action
...
This task format is valid in 1.x, but was broken in 2.x:
- local_action:
module: shell echo "hello world"
2016-01-18 14:32:44 -05:00
Toshio Kuratomi
4958180333
use integer division instead of floating point division.
...
Fixes #13855
2016-01-13 12:35:28 -08:00
Eric Feliksik
11ce08b9dd
cleaner implementation and random chunk length.
2016-01-05 18:04:38 +01:00
Eric Feliksik
151e09d129
use unix shred if possible, otherwise fast custom impl; do not shred encrypted file
2016-01-05 01:43:42 +01:00
Eric Feliksik
1e911375e8
add docs, remove unnecessary int() cast
2016-01-04 18:13:59 +01:00
Eric Feliksik
7193d27acc
add os.fsync() so that the shredding data (hopefully) hits the drive
2016-01-04 17:22:18 +01:00
Eric Feliksik
946b82bef7
shred ansible-vault tmp_file. Also when editor is interruped.
2015-12-30 18:21:34 +01:00
Brian Coca
75e94e0cba
allow for non standard hostnames
...
* Changed parse_addresses to throw exceptions instead of passing None
* Switched callers to trap and pass through the original values.
* Added very verbose notice
* Look at deprecating this and possibly validate at plugin instead
fixes #13608
2015-12-21 13:42:34 -05:00
James Cammarata
8716bf8021
All variables in complex args again
...
Also updates the CHANGELOG to note the slight change, where bare variables
in args are no longer allowed to be bare variables
Fixes #13518
2015-12-16 16:39:08 -05:00
James Cammarata
2b36343451
Missed one place we were appending the incorrectly escaped item to raw params
2015-12-09 17:58:44 -05:00
James Cammarata
1799de8528
Preserve original token when appending to _raw_params in parse_kv
...
Fixes #13311
2015-12-08 15:06:36 -05:00
Toshio Kuratomi
a8e015cc22
Add representers so we can output yaml for all the types we read in from yaml
2015-12-06 22:17:47 -08:00
Monty Taylor
d20e67d708
Put in trap for args being None
...
_normalize_old_style_args can return None. If it does, the loop
"for args in args" blows up.
2015-11-28 13:38:11 -05:00
Yannig Perré
2fc7c8b460
More restrictive test against variable name to allow setting variable starting with _.
2015-11-28 10:35:06 +01:00
Yannig Perré
2c54fb1339
Switch parameters validation after parsing in order to be more consistent between old and new style.
2015-11-26 13:33:58 +01:00
Matteo Acerbi
0127d32652
Fix DataLoader's docstring
...
DataLoader.__init__ doesn't take an argument named vault_password
2015-11-18 11:20:34 +01:00
Abhijit Menon-Sen
7caefa5cd9
Fix typo
2015-11-03 10:57:48 +05:30
Brian Coca
00bc74404a
vault noe preserves permissions on edit and rekey and sets a restricitve default umask for all other cases
2015-10-31 14:13:03 -04:00
Toshio Kuratomi
e3e2db1119
Improve the warning message about duplicate yaml dict keys
2015-10-27 14:20:36 -07:00
Toshio Kuratomi
4203850d1a
Break apart a looped dependency to show a warning when parsing playbooks
...
Display a warning when a dict key is overwritten by pyyaml
Fixes #12888
2015-10-27 12:39:42 -07:00
James Cammarata
86de1429e5
Cleaning up FIXMEs
2015-10-22 16:03:50 -04:00
James Cammarata
0bbe9d5bd0
Make hostvars json/yaml serializable in filters
...
Fixes #12615
2015-10-18 10:09:05 -04:00
Toshio Kuratomi
b23a083776
Make vault use a mapping of cipher name to classes instead of formatting the name for safety.
2015-10-16 10:05:27 -07:00
Toshio Kuratomi
baa309309d
Bundle a new version of python-six for compatibility along with some code to make it easy for distributions to override the bunndled copy if they have a new enough version.
2015-10-16 08:21:28 -07:00
Marius Gedminas
98958ec990
Simplify join expression
2015-10-16 17:39:27 +03:00
Marius Gedminas
56184a3d8c
Python 3: avoid %-formatting of byte strings
...
This is needed for Python 3.4 compatibility; Python 3.5 can use
`b'%s\n' bytestring` again.
2015-10-16 17:18:35 +03:00
Toshio Kuratomi
85abd61001
Add some more info to docstring
2015-10-14 18:57:10 -07:00
Brian Coca
abf2e13955
Revert "Track local_action internally to prevent it from being overridden"
...
This reverts commit 49ca0eb797
.
2015-10-09 13:01:32 -04:00
Brian Coca
101c8785ec
removed changes to make local action equate connection=local and brought it back to equate delegate_to=localhost
2015-10-09 13:01:32 -04:00
Brian Coca
3705d54485
fixed error reporting on splitter
2015-10-01 19:03:04 -04:00
Brian Coca
a680ef66dd
fixed vault password file script execution
2015-10-01 18:49:51 -04:00
Abhijit Menon-Sen
0bb34fd076
Make «ansible-vault view» not write plaintext to a tempfile
...
CLI already provides a pager() method that feeds $PAGER on stdin, so we
just feed that the plaintext from the vault file. We can also eliminate
the redundant and now-unused shell_pager_command method in VaultEditor.
2015-09-30 22:13:36 +05:30
Toshio Kuratomi
dcdcd9e9c5
Move is_executable to the toplevel of basic.py so we can utilize it from other code
2015-09-25 07:48:57 -07:00
James Cammarata
95b371dd60
Use AnsibleFileNotFound instead of AnsibleParsingError when YAML files are not found
...
And update portions of code to expect the proper error.
Fixes #12512
2015-09-24 16:27:25 -04:00
Marius Gedminas
fc0dcc3947
Python 3: there's no basestring
...
Fixes one failing test.
Now technically a filename can be a bytestring, even on Python 3. I
hope this is unlikely for Ansible.
2015-09-22 08:42:33 +03:00
Toshio Kuratomi
627f9d73ba
Detect if core modules aren't installed and warn if that is the case
...
Fixes #11206
2015-09-21 12:31:51 -07:00
Abhijit Menon-Sen
2d420a9bb7
Allow hexadecimal ranges in IPv6 addresses, not only 0-9
2015-09-17 23:32:58 +05:30
Abhijit Menon-Sen
349eec7855
Fix missing colon (typo) in IPv6 pattern
2015-09-17 19:34:33 +05:30
James Cammarata
4f30db8ca5
Check if path is /dev/null when checking if a file is in fact a file
2015-09-14 14:41:22 -04:00
James Cammarata
49ca0eb797
Track local_action internally to prevent it from being overridden
...
Fixes #12053
2015-09-14 12:11:58 -04:00
James Cammarata
aa762bb432
Don't split args out unless we're parsing module args using the new style
...
Fixes #12331
2015-09-12 17:50:05 -04:00
Abhijit Menon-Sen
7479ab47e0
Be stricter about parsing hostname labels
...
Labels must start with an alphanumeric character, may contain
alphanumeric characters or hyphens, but must not end with a hyphen.
We enforce those rules, but allow underscores wherever hyphens are
accepted, and allow alphanumeric ranges anywhere.
We relax the definition of "alphanumeric" to include Unicode characters
even though such inventory hostnames cannot be used in practice unless
an ansible_ssh_host is set for each of them.
We still don't enforce length restrictions—the fact that we have to
accept ranges makes it more complex, and it doesn't seem especially
worthwhile.
2015-09-11 21:47:19 +05:30
Abhijit Menon-Sen
065bb52109
Be systematic about parsing and validating hostnames and addresses
...
This adds a parse_address(pattern) utility function that returns
(host,port), and uses it wherever where we accept IPv4 and IPv6
addresses and hostnames (or host patterns): the inventory parser
the the add_host action plugin.
It also introduces a more extensive set of unit tests that supersedes
the old add_host unit tests (which didn't actually test add_host, but
only the parsing function).
2015-09-11 21:47:18 +05:30