Commit Graph

19317 Commits (3466e73c504b81d472809001a4d5c5df5f7f6172)
 

Author SHA1 Message Date
James Cammarata 09c90f7f2f 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
8 years ago
Lars Kellogg-Stedman 21ac95402f 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.
8 years ago
Toshio Kuratomi 5c7ad654db Add some more tests for item squashing 8 years ago
nitzmahone 7708948d7d bump submodule refs 8 years ago
nitzmahone 133395db30 add jimi-c's unit test for squashed skip results, tweaked is_skipped() logic to pass 8 years ago
Andrew Taumoefolau 85868e07a9 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
8 years ago
Brian Coca 478674cc57 typo fix 8 years ago
Brian Coca 3a6ca0b4a6 made ansible-doc complain on missing 'requried' 8 years ago
Brian Coca b7c874f81a enforce required 'required' in docs 8 years ago
Brian Coca 2af8e3b9d8 fix default for removing images 8 years ago
Matt Davis 7b58240654 Merge pull request #15712 from mhite/ip_type
New inventory_ip_type option in gce inventory tool
8 years ago
Brian Coca 27a1ae4732 added ability to also subset make tests 8 years ago
Brian Coca fb7940fc50 check that variable first
before using string methods to check for magic interpreter var
8 years ago
camradal be87cd8c26 Fix logging into vCloud Director and expose verify_certs argument (#15533) 8 years ago
Andrew Taumoefolau bc81c76f86 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.
8 years ago
Robin Roth 56ba10365c better fix for arch version detection (#15705)
* better fix for arch version detection

fixes  #15696

* be extra safe about tracebacks in facts.py

* add comments to explain the setup
* make allowempty more conservative, ignore file content
* wrap function call in try/except
  * should never happen, but if it happens the bug should be distribtion=N/A and not a traceback
8 years ago
Toshio Kuratomi 4f7a0925fd Corrections to documentation formatting 8 years ago
nitzmahone 6373f2b045 error message cleanup 8 years ago
René Moser fbec9ce58b Merge pull request #15561 from resmo/test/support-debian
tests: make tests work for Debian 8/Ubuntu 16.04
8 years ago
Matt Hite fbfc24fb40 New inventory_ip_type option in gce inventory tool 8 years ago
Rene Moser 5583027f99 tests, postgresql: add ubuntu 16.04 support 8 years ago
Rene Moser 39e4caafb2 tests, apt_repository: disable Ubuntu 16.04 as there is no package yet 8 years ago
Rene Moser c20d1fced7 tests: fix tests on Debian 8 8 years ago
Robin Roth cf62a62b83 use userdir module as example instead of alias (#15540)
* alias module is very basic and removing it leads to the suse default
  config failing
* future improvements might test different modules and the effect of
  them being removed
8 years ago
John R Barker 606d35b8a6 Track build times (#15708)
See if https://buildtimetrend.herokuapp.com/ gives us any extra insights
into how we can speed up builds
8 years ago
Toshio Kuratomi ae9ddf0c1c Submodule updates to fix documentation 8 years ago
Tobias Wolf 87648f7bdf 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
8 years ago
Brian Coca 47d58c30e4 another var 'defaulted' in run_tests 8 years ago
James Pic d72a03deae Add get_distribution_Archlinux (#15696) 8 years ago
Toshio Kuratomi fff94551a1 Update core submodule ref to fix docs build 8 years ago
Brian Coca 3669ab2456 added defaults for 'optional' vars 8 years ago
Toshio Kuratomi 3f104dcee9 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.
8 years ago
Brian Coca 52a714143f fine tuned shell switches for run_tests.sh 8 years ago
Brian Coca e0573d3099 make vi the default editor if no EDITOR
fixes #15577
8 years ago
James Cammarata c6a9d20b5c Merge pull request #15689 from axelspringer/include_fix
Restore Ansible 2.0 compatibility for include:
8 years ago
Martin Matuska 5ee38617b9 Treat "static: yes/no" with higher priority than "task_includes_static" in ansible.cfg 8 years ago
Toshio Kuratomi c42501cfe7 Update submodule refs 8 years ago
Toshio Kuratomi 81019e03fc Update submodule refs 8 years ago
Martin Matuska 438ed70a43 Restore Ansible 2.0 compatibility for includes 8 years ago
jctanner eb31faa7f5 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
8 years ago
James Cammarata 1fc44e4103 Don't fail hosts when using any_errors_fatal when ignoring errors
Fixes #15431
8 years ago
Yannig 3901556b35 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.
8 years ago
Toshio Kuratomi f39ad1f13a 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.)
8 years ago
Toshio Kuratomi aec74b4b65 Fix inventory on python3 8 years ago
Toshio Kuratomi b8a988e922 bytes when passing to os.path.* and opening the file, text at other times
Fixes #15644
8 years ago
Toshio Kuratomi f61dd8c7fc Update submodule refs 8 years ago
Toshio Kuratomi 82749cf587 Merge pull request #15677 from abadger/ziploader-cache-lock-dict-fix
Fix the mapping of module_name to Locks
8 years ago
Toshio Kuratomi 98feafb411 Fix the mapping of module_name to Locks
This was reinitialized every time we forked before so we weren't sharing
the same Locks.  It also was not accounting for modules which were
directly invoked by an action plugin instead of going through the
strategy plguins.
8 years ago
Robin Roth 1d6608e84f Dist version fix for Red Hat and more tests (#15663)
* add tests for centos6, rhel6 and rhel7

* gen_distribution_version_testcase with python2.6

* remove unused imports

* fix redhat/vmware/... parsing

* add centos7 test case
8 years ago
Brian Coca 6f4f8e6e79 fix typo 8 years ago