Commit Graph

16320 Commits (0e110d23f8ab1d38cdbbc69794ba62be47d76537)
 

Author SHA1 Message Date
Chris Church ed3a9795d4 Revert "Fix order of loading of modules."
This reverts commit 4b895f04e3.
9 years ago
James Cammarata 1243686b90 Submodule update 9 years ago
James Cammarata 6cf99cf614 Merge pull request #12328 from amenonsen/noneguard
Test state.tasks_child_state before dereferencing
9 years ago
Abhijit Menon-Sen 049a48f3d3 Test state.tasks_child_state before dereferencing
I hit a traceback in the FAILED_TASKS case, but it seemed prudent to add
guards in the other similar branches.
9 years ago
James Cammarata df89f03627 Fixing precedence order for new nonpersistent vars (set_fact/register)
These used to go in vars_cache, so merging them in after that as they
are "live" variables and the user would most likely want to see these
above anything else.
9 years ago
Abhijit Menon-Sen 88a20e7a20 Fix broken integration test with unicode hostnames
1. The test did "name: '{{hostnames}}.{{item}}'" inside a with_sequence
   loop, which didn't do what was intended: it expanded hostnames into
   an array, appended ".1", and set name to the resulting string. This
   can be converted to a simple with_items loop.

2. Some of the entries in hostnames contained punctuation characters,
   which I see no reason to support in inventory hostnames anyway.

3. Once the add_host failures are fixed, the playbook later fails when
   the unicode hostnames are interpolated into debug output in ssh.py
   due to an encoding error. This is only one of the many places that
   may fail when using unicode inventory hostnames; we work around it
   by providing an ansible_ssh_host setting.
9 years ago
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.
9 years ago
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).
9 years ago
James Cammarata 49803509b4 Make sure include paths are templated before dwim in case they're absolute
Fixes #12327
9 years ago
James Cammarata 4cdd9b2a82 Merge pull request #12318 from mgedmin/py3k
Python 3: make ansible.template.safe_eval() work
9 years ago
Brian Coca 52f587cac3 Merge pull request #12325 from quinot/topic/wrong_interp_test
Test for Python must be against basename of interpreter
9 years ago
James Cammarata c2115c3715 Re-adding part of 926f127 which was actually fixing #12277 9 years ago
James Cammarata 083aef65ad Revert "set_fact should put facts in the fact_cache, not vars_cache"
This reverts commit 926f127245.
9 years ago
Thomas Quinot 0bc9223826 Test for Python must be against basename of interpreter
Followup on issue #12076
9 years ago
James Cammarata 441a8af671 Merge pull request #12267 from h-hirokawa/add_replacer_jsonargs
Add the new module replacer <<INCLUDE_ANSIBLE_MODULE_JSON_ARGS>>.
9 years ago
Marius Gedminas f91b28ef23 Fix safe_eval() of set literals
There was code to support set literals (on Python 2.7 and newer), but it
was buggy: SAFE_NODES.union() doesn't modify SAFE_NODES in place,
instead it returns a new set object that is then silently discarded.

I added a unit test and fixed the code.  I also changed the version
check to use sys.version_tuple instead of a string comparison, for
consistency with the subsequent Python 3.4 version check that I added in
the previous commit.
9 years ago
Marius Gedminas 2b73002044 Python 3: make ansible.template.safe_eval() work
Two things changed in Python 3.4:

- 'basestring' is no longer defined, so use six.string_types

- True/False are now special AST node types (NamedConstant) rather than
  just names

(Good thing we had tests, or I wouldn't have noticed the 2nd thing!)

I found only one place where safe_eval() is called inside the ansible
codebase: in lib/template/__init__.py.  The call to safe_eval(result,
...) is protected by result.startswith('...'), which means result cannot
possibly be a byte string on Python 3 (or startswith() would raise, so
six.string_types (which excludes byte strings on Python 3) is fine here.
9 years ago
James Cammarata 0c5bbe3c32 Use the original (un-templated) args for include params
Fixes #12314
9 years ago
Brian Coca 5809a2e81d Merge pull request #12299 from resmo/feature/test_cs_user
cloudstack: new integration test role test_cs_user
9 years ago
James Cammarata 292e2da4e1 Fix some bugs related to facts/nonpersistent-facts cache split
Fixes #12313
9 years ago
Brian Coca 1e2dc212bd added openvswitch_db 9 years ago
James Cammarata 444987cde6 Fix unit test for plugins after basedir/push_basedir removal 9 years ago
Brian Coca 91c9df2154 added verbosity to ansible-doc to make it easier to trace down issues 9 years ago
James Cammarata b35529b09f Submodule pointer update 9 years ago
James Cammarata 95a58d1178 Properly serialize UnsafeProxy objects
Required as part of fix for #12123
9 years ago
James Cammarata a410bf26d3 Wrap registered variables in UnsafeProxy
Fixes #12123
9 years ago
Toshio Kuratomi 46bf3d1bc1 Remove plugin._basedirs as we now use different data structures to achieve that functionality. 9 years ago
Brian Coca e6c9efec63 Merge pull request #12310 from amenonsen/hostport
Rename ansible_ssh_{host,port,user} in docs to ansible_*
9 years ago
Abhijit Menon-Sen f56a6e0951 Rename ansible_ssh_{host,port,user} in docs to ansible_*
The _ssh variants will continue to work, but the shorter, more generic
names are preferred now.
9 years ago
Brian Coca 6dac8512a1 Merge pull request #12307 from jtyr/doc_fixes
Doc fixes
9 years ago
Jiri tyr 14dc16ca54 Adding missing colon to fix the block formating 9 years ago
Brian Coca 1fed03a6bd Merge pull request #12308 from jtyr/comment_filter_v2
Resurrection of the comment filter
9 years ago
Jiri tyr 174f805fb3 Resurrection of the comment filter 9 years ago
Toshio Kuratomi 90e005d234 Merge pull request #12302 from mgedmin/py3k
Python 3: use the right PyYAML SafeRepresenter for unicode
9 years ago
Marius Gedminas b95e3d18a7 Python 3: use the right PyYAML SafeRepresenter for unicode
PyYAML has a SafeRepresenter in lib/... that defines

    def represent_unicode(self, data):
        return self.represent_scalar(u'tag:yaml.org,2002:str', data)

and a different SafeRepresenter in lib3/... that defines

    def represent_str(self, data):
        return self.represent_scalar('tag:yaml.org,2002:str', data)

so the right thing to do on Python 3 is to use represent_str.

(AnsibleUnicode is a subclass of six.text_type, i.e. 'str' on Python 3.)
9 years ago
Benno Joy 6de13c3062 Merge pull request #11818 from Java1Guy/module_utils_ec2_for_ecs
change ec2 util to create only requested objects
9 years ago
James Cammarata ee7905c7e1 Compare include params against deprecated param names too
Fixes #12282
9 years ago
James Cammarata 950e067d2f Merge pull request #12295 from napkindrawing/patch-3
Typo in comment: "bsaename" → "basename"
9 years ago
James Cammarata f576e0f1af Merge pull request #12300 from robusto/devel
Vault missing DataLoader for pwd file #12293
9 years ago
James Cammarata 22639a2a22 Fix mistake in fact setting to nonpersistent cache in VariableManager
Fixes #12301
9 years ago
James Cammarata aa3b290efd Fix indent on line in playbook executor 9 years ago
Toshio Kuratomi 4b895f04e3 Fix order of loading of modules.
Allows ANSIBLE_LIBRARY to overload core modules even if the module in
ANSIBLE_LIBRARY doesn't have a .py extension.
9 years ago
James Cammarata e81947c3b4 Fix vars_prompt short form support (and mark deprecated) 9 years ago
Rene Moser f6382a160d cloudstack: new integration test role test_cs_user 9 years ago
Blake Atkinson 6062519986 Vault missing DataLoader for pwd file #12293 9 years ago
James Cammarata be7bd392cb Fix unreachable host detection and have plays continue after unreachable failures
Fixes #12284
9 years ago
Toshio Kuratomi 25c97fff69 Merge pull request #12294 from ansible/fix-password-lookup
Fix problem with "=" in the initial file path.
9 years ago
Brian Coca 0dbebfddaa Revert "remove closing connections after every task, this goes against conneciton caching and was not expected behaviuor nor inhertited from v1"
needed for winrm, disabled closing connections in ssh to avoid issues with that persistance, need to normalize all this in future

This reverts commit 23a22397bf.
9 years ago
Brian Coca 3f0e14c2a0 disabled ssh closing connections 9 years ago
Toshio Kuratomi e2c49b4ef4 Fix problem with "=" in the initial file path. 9 years ago