Commit Graph

19454 Commits (b7479a1dc666ada3db68d5cb6b74c159105e1807)
 

Author SHA1 Message Date
Matt Martz 9121ca2f8e Use .code instead of .getcode() as py24 does not have .getcode(). Fixes https://github.com/ansible/ansible-modules-core/issues/3608 9 years ago
Toshio Kuratomi cae6240e5e Ship constants to the modules via internal module params rather than a secondary dict. 9 years ago
James Cammarata 2f302e26f4 Make sure setting facts with run_once makes copies of the data
When using run_once, there is only one dict of facts so passing that
to the VariableManager results in the fact cache containing the same
dictionary reference for all hosts in inventory. This patch fixes that
by making sure we pass a copy of the facts dict to VariableManager.

Fixes #14279
9 years ago
Matt Martz 1968bc5952 Cascade ssh_*args configurations in synchronize instead of limiting to just ssh_args. See https://github.com/ansible/ansible-modules-core/issues/3370 9 years ago
Matt Martz 047d62cce3 Guard against a shell profile printing extraneous data 9 years ago
James Cammarata 1c2f0ae8f7 Simply being in an always block shouldn't mean a host did not fail
Previously the changed code was necessary, however it is now problematic
as we've started using the is_failed() method in other places in the code.
Additional changes at the strategy layer should make this safe to remove
now.

Fixes #15625
9 years ago
James Cammarata 3a052654f3 Do not include params when getting role vars in certain situations
In VariableManager, we fetch the params specifically in the next step,
so including them in the prior step is unnecessary and could lead to things
being overridden in an improper order.

In Block, we should not be getting the params for the role as they are
included earlier via the VariableManager.

Fixes #14411
9 years ago
Carl 2a512affde Fixes #15745 playbook include: Conditional scoping
Fixes #15745
Applies conditional forwarding to all tasks/roles within the included playbook.
The existing line only applies forwarded conditionals to the main Task block, and misses pre_, post_, and roles.

Typo ::

Made a selection mistake when I copied over the one line change
9 years ago
Toshio Kuratomi 90fb1fb3fa If we can't squash for any reason, then simply do not optimize the items loop.
Also add more squashing testcases

Fixes #15649
9 years ago
Toshio Kuratomi 8cd0c432e7 Fixed importing the libcloud modules to give a nice error rather than a traceback. 9 years ago
Vic Iglesias 151df71464 Update GCE module to use JSON credentials (#13623)
* Update GCE module to use JSON credentials

* Ensure minimum libcloud version when using JSON crednetials for GCE

* Relax langauge around libcloud requirements
9 years ago
James Cammarata d22898a27c Clear blocked hosts when a role duplicate task is found in free strategy
In the free strategy, we mark a host as blocked when it has work to do
(the PlayIterator returns a task) to prevent multiple tasks from being sent
to the host. However, we check for role duplicates after setting the blocked
flag, but were not clearing that when the task was skipped leading to an
infinite loop. This patch corrects that by clearing the blocked flag when
the task is skipped.

Fixes #15681
9 years ago
Lars Kellogg-Stedman 22b86bbb63 do not erroneously set gathered_facts=True
In `lib/ansible/executor/play_iterator.py`, ansible sets a host's
`_gathered_facts` property to `True` without checking to see if there
are any tasks to be executed.  In the event that the entire play is
skipped, `_gathered_facts` will be `True` even though the `setup`
module was never run.

This patch modifies the logic to only set `_gathered_facts` to `True`
when there are tasks to execute.

Closes #15744.
9 years ago
Andrew Taumoefolau 00b04ab794 Apply inventory host restrictions by host name rather than UUID.
Issue #15633 observes that a meta: inventory_refresh task causes the playbook
to exit. An inventory refresh flushes all caches and rebuilds all host
objects, assigning new UUIDs to each. These new host UUIDs currently fail to
match those on host objects stored for restrictions in the inventory, causing
the playbook to exit for having no hosts to run further tasks against.

This changeset attempts to address this issue by storing host restrictions
by name, and comparing inventory host names against these names when applying
restrictions in get_hosts.
9 years ago
James Cammarata af257c20da Change error about loop variable in use to a warning 9 years ago
Toshio Kuratomi 0040c6a4d2 Add fix for 15601 to the ChangeLog 9 years ago
Toshio Kuratomi 8a84ef80e2 Strip junk after JSON return. (#15822)
Fixes #15601
9 years ago
Toshio Kuratomi e9406bcfd3 Backport some python3 fixes for facts 9 years ago
Brian Coca 1c21baa706 restore old jsonfile behaviour on key expiration
fixes #14456, now it won't expire keys in middle of a play when they
were 'valid' at 'gather time'.
9 years ago
Brian Coca 8a72972360 fix bad assignment, method modifies by ref already
fixes #15694
9 years ago
Toshio Kuratomi b7cab0533e Remove reload from arg related tests. Changes to how ziploader passes args mean we don't need reload anymore. (#15782) 9 years ago
Toshio Kuratomi 6e8b12690b Add s3_bucket fix 9 years ago
Toshio Kuratomi e840816da2 Add s3_bucket fix to CHANGELOG 9 years ago
Matthew Stoltenberg fc4edcbedc add repr for hostvars (#15793)
* allows passing full hostvars to a module
9 years ago
Toshio Kuratomi 31f17d1191 Update submodule ref 9 years ago
Toshio Kuratomi d2e8e8d6a7 Switch to a different url for testing SNI right now. (#15798) 9 years ago
Kamjar Gerami 6f99f40f37 fixes-#15685-tools-that-paginate-show-spurious-less-output: less --version outputs to standard out not to standard error so this changes the redirect from 2> to > (#15720)
fixes-#15685-tools-that-paginate-show-spurious-less-output: Updated redirect to include stderr as well as stdout to not show any errors on screen
9 years ago
Toshio Kuratomi be28443943 Strip leading and trailing whitespace for json arg types 9 years ago
nitzmahone 9620eadc03 bump extras submodule ref 9 years ago
Toshio Kuratomi 73dd183394 Update submodule refs 9 years ago
James Cammarata 506e6255b2 Fixing bugs in strategies
* Don't filter hosts remaining based on their failed state. Instead rely
  on the PlayIterator to return None/ITERATING_COMPLETE when the host is
  failed.
* In the free strategy, make sure we wait outside the host loop for all
  pending results to be processed.
* Use the internal _set_failed_state() instead of manually setting things
  when a failed child state is hit

Fixes #15623
9 years ago
nitzmahone 4574a0e82d bump submodule refs 9 years ago
nitzmahone 761cdc794e add jimi-c's unit test for squashed skip results, tweaked is_skipped() logic to pass 9 years ago
Andrew Taumoefolau da1e62a6d9 Don't assume a task with non-dict loop results has been skipped.
This changeset addresses the issue reported here:

  ansible/ansible-modules-core#1765

The yum module (at least) includes its task results as strings, rather than
dicts, and the code this changeset replaces assumed that in that instance the
task was skipped. The updated behaviour assumes that the task has been
skipped only if:

* results exist, and
* all results are dicts that include a truthy skipped value
9 years ago
Matt Hite 198f57b61e New inventory_ip_type option in gce inventory tool 9 years ago
Brian Coca 90fef85143 check that variable first
before using string methods to check for magic interpreter var
9 years ago
camradal a355ebcbb8 Fix logging into vCloud Director and expose verify_certs argument (#15533) 9 years ago
nitzmahone 2c8715178f error message cleanup 9 years ago
Tobias Wolf 7662b06d5b actionable.py: Do not print next task banner in handler callback (#15698)
Fix actionable callback plugin to not print the banner of the previous
task.

When a handler is executed there is no task banner, so in case it is run,
it will reference the banner from the preceding task.

**Author:** @hvhaugwitz

Test case:

      ---

      - name: actionable filter
        hosts: all
        handlers:
          - name: handler
            command: "true"
        tasks:
          - name: task 1
            file: path=/tmp/test state=touch
            notify: handler
          - name: task 2
            file: path=/tmp/test state=absent
          - name: task 3
            file: path=/tmp/test state=absent
          - name: task 4
            file: path=/tmp/test state=absent
          - name: task 5
            file: path=/tmp/test state=absent
          - name: task 6
            file: path=/tmp/test state=absent

Example output:

BEFORE
------

      PLAY [actionable filter] *******************************************************

      TASK [task 1] ******************************************************************
      changed: [localhost]

      TASK [task 2] ******************************************************************
      changed: [localhost]

      RUNNING HANDLER [handler] ******************************************************

      TASK [task 6] ******************************************************************
      changed: [localhost]

      PLAY RECAP *********************************************************************
      localhost                  : ok=8    changed=3    unreachable=0    failed=0

AFTER
-----

      PLAY [actionable filter] *******************************************************

      TASK [task 1] ******************************************************************
      changed: [localhost]

      TASK [task 2] ******************************************************************
      changed: [localhost]

      RUNNING HANDLER [handler] ******************************************************
      changed: [localhost]

      PLAY RECAP *********************************************************************
      localhost                  : ok=8    changed=3    unreachable=0    failed=0
9 years ago
Toshio Kuratomi e52caba801 Update submodule ref to fix ansible-doc for azure modules 9 years ago
Toshio Kuratomi efbcd8bda0 Add a jsonarg type to arg spec (#15701)
This makes sure that if we get a list or dict that it is turned into
a jsonified string.
9 years ago
Martin Matuska 86768fdcc8 Treat "static: yes/no" with higher priority than "task_includes_static" in ansible.cfg 9 years ago
Martin Matuska e1b7d4cb4d Restore Ansible 2.0 compatibility for includes 9 years ago
Toshio Kuratomi 641b4cc952 Add unarchive fixes to changelog 9 years ago
Toshio Kuratomi 7cc7684abd Update submodule refs 9 years ago
jctanner 16c1f10e18 Remove the ziploader provided pythonpaths from the env inside run_com… (#15674)
Remove the ziploader provided pythonpaths from the env inside run_command.

Fixes #15655
9 years ago
Brian Coca 4abadead76 make vi the default editor if no EDITOR
fixes #15577
9 years ago
James Cammarata c7cae3b08c Don't fail hosts when using any_errors_fatal when ignoring errors
Fixes #15431
9 years ago
Yannig 40c0f34c41 When var name is the same as var content, try to template it before reporting that var is not defined. (#13629)
* When var name is the same as var content, try to template it before reporting that var is not defined.
Add asserts in test_var_blending to check this special corner case.

* Fix integration tests when using debug with list or dict.
9 years ago
Toshio Kuratomi 48fa4f842e Get rid of logentries.to_unicode.
It wasn't doing anything that a literal couldn't do and used
unicode_escape which only understands latin1 (The author of the code
seems to have thought it took an encoding argument but it looks like
that was silently ignored.)
9 years ago