Commit Graph

20153 Commits (bf8c871801fe75557823cdeb8228da9d18ece599)
 

Author SHA1 Message Date
David Shrewsbury bf8c871801 Fix async logic when parsing fails (#17091)
We want to NOT consider the async task as failed if the result is
not parsed, which was the intent of:

  https://github.com/ansible/ansible/pull/16458

However, the logic doesn't actually do that because we default
the 'parsed' value to True. It should default to False so that
we continue waiting, as intended.
8 years ago
James Tanner 1f5552f586 Update submodule refs 8 years ago
James Cammarata daf6eb97d3 Make sure includes for handlers in roles look in the correct subdir 8 years ago
Brian Coca 64a8d24b72 slightly better presentation docs
- description items are now separated
- choices/defaults start at their own line
8 years ago
Tim Whittington b3c686f4c5 Note that to_nice_yaml(indent=X) was new in 2.2 (#17085)
The ability to pass indent parameter to to_nice_yaml was introduced in 2.2, but this is not noted in the docs.
8 years ago
Ted Timmons f4bd38a153 document what glob style is used (#17080)
Took some digging to find that `with_fileglob` calls a method named `fileglob()`, which uses Python's `glob` library.
8 years ago
Brian Coca 4c034fd002 updated container detection to new lxc (#17063)
fixes #17030
8 years ago
Peter Sprygada 8620fda947 Merge pull request #17077 from agaffney/junos_doc_fix
Update junos docs fragment to note the default port for transport=netconf
8 years ago
John R Barker a8a8ef4682 2.1 has been released
Also link to new feature documentation - We need to do more of this

Thanks to kustodian for suggesting this
8 years ago
James Cammarata 3c65c03a67 Changing license on module_utils/splitter.py to BSD 8 years ago
Andrew Gaffney fdabfb6821 Update junos docs fragment to note the default port for transport=netconf 8 years ago
James Cammarata c669a381d1 Don't immediately return failed for any_errors_fatal tasks
Instead of immediately returning a failed code (indicating a break in
the play execution), we internally 'or' that failure code with the result
(now an integer flag instead of a boolean) so that we can properly handle
the rescue/always portions of blocks and still remember that the break
condition was hit.

Fixes #16937
8 years ago
Matt Clay b44eb402bd Update ansible-core-ci endpoint. (#17071) 8 years ago
scottb 7eed464db0 Merge pull request #17061 from nickmisasi13/patch-1
Update developing_inventory.rst
8 years ago
Dag Wieers cb5675a29f Remove a useless section, only act on 'shell' (#16205) 8 years ago
Matt Clay 4cee67452b Update submodule refs. 8 years ago
jctanner da23700b15 Update submodule refs (#17062) 8 years ago
Dag Wieers 56148291e9 Emit warnings when safe_eval() raises a SyntaxError or other Exception (#14304)
This change is related to reported issue #14291 and pull request #14293.

Without the fix from #14293, this change will emit a warning as shown below, on the following playbook:

``yaml
---
- hosts: localhost
  gather_facts: no
  vars:
    works:
      key1: 'string'
      key2: 1234
    fails:
      key1: 'string'
      key2: 1234
      key3: false
  tasks:
  - debug: msg={{ works | to_json }}
  - debug: msg={{ fails | to_json }}
```

On error, this results in a proper warning:

```
[dag@moria ansible.dag]$ ansible-playbook test49.yml

PLAY ***************************************************************************

TASK [debug] *******************************************************************
ok: [localhost] => {
    "msg": {
        "key1": "string",
        "key2": 1234
    }
}

TASK [debug] *******************************************************************
 [WARNING]: Error in expression "{"key3": false, "key2": 1234, "key1": "string"}". (name 'false' is not defined)

ok: [localhost] => {
    "msg": "{\"key3\": false, \"key2\": 1234, \"key1\": \"string\"}"
}

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0
```
8 years ago
nickmisasi13 85dd9aa4ec Update developing_inventory.rst
Changed a misleading line from returning to printing
8 years ago
Dag Wieers 1268f4778d Introduce new 'filetree' lookup plugin (#14332)
* Introduce new 'filetree' lookup plugin

The new "filetree" lookup plugin makes it possible to recurse over a tree of files within the task loop. This makes it possible to e.g. template a complete tree of files to a target system with little effort while retaining permissions and ownership.

The module supports directories, files and symlinks.

The item dictionary consists of:
 - src
 - root
 - path
 - mode
 - state
 - owner
 - group
 - seuser
 - serole
 - setype
 - selevel
 - uid
 - gid
 - size
 - mtime
 - ctime

EXAMPLES:
Here is an example of how we use with_filetree within a role:

```yaml
 - name: Create directories
   file:
     path: /web/{{ item.path }}
     state: directory
     mode: '{{ item.mode }}'
     owner: '{{ item.owner }}'
     group: '{{ item.group }}'
     force: yes
   with_filetree: web/
   when: item.state == 'directory'

 - name: Template complete tree
   file:
     src: '{{ item.src }}'
     dest: /web/{{ item.path }}
     state: 'link'
     mode: '{{ item.mode }}'
     owner: '{{ item.owner }}'
     group: '{{ item.group }}'
   with_filetree: web/
   when: item.state == 'link'

 - name: Template complete tree
   template:
     src: '{{ item.src }}'
     dest: /web/{{ item.path }}
     mode: '{{ item.mode }}'
     owner: '{{ item.owner }}'
     group: '{{ item.group }}'
     force: yes
   with_filetree: web/
   when: item.state == 'file'
```

SPECIAL USE:
The following properties also have its special use:

 - root: Makes it possible to filter by original location
 - path: Is the relative path to root
 - uid, gid: Makes it possible to force-create by exact id, rather than by name
 - size, mtime, ctime: Makes it possible to filter out files by size, mtime or ctime

TODO:
 - Add snippets to documentation

* Small fixes for Python 3

* Return the portion of the file’s mode that can be set by os.chmod()

And remove the exists=True, which is redundant.

* Use lstat() instead of stat() since we support symlinks

* Avoid a few possible stat() calls

* Bring in line with v1.9 and hybrid plugin

* Remove glob module since we no longer use it

* Included suggestions from @RussellLuo

- Two blank lines will be better. See PEP 8
- I think if props is not None is more conventional 😄

* Support failed pwd/grp lookups

* Implement first-found functionality in the path-order
8 years ago
Jim Ladd 329a134cb3 Increase local version for unofficial rpms (#17026) 8 years ago
Matt Davis 525c0469d2 tweak hacking/env-setup to work under ash (#17054) 8 years ago
jctanner 39d764c7ad Restore previous behavior of ignoring missing files via with_fileglob (#17053)
Fixes #16801
8 years ago
Matt Clay 901042f458 Generate test script to file instead of stdout. 8 years ago
Matt Clay 2b0d63b0d8 Flush stderr to avoid lost output. 8 years ago
James Cammarata 925b0ff9e9 cleaning up some debug statements in _queue_task() 8 years ago
James Cammarata 1c7e0c73c9 Several fixes for includes
* when including statically, make sure that all parents were also included
  statically (issue #16990)
* properly resolve nested static include paths
* print a message when a file is statically included

Fixes #16990
8 years ago
Toshio Kuratomi 854d47826c Fix classes that select a subclass based on platform (#17034)
When unittesting this we found that the platform selecting class
hierarchies weren't working in all cases.  If the subclass was directly
created (ie: LinuxHardware()), then it would use its inherited __new__()
to try to create itself.  The inherited __new__ would look for
subclasses and end up calling its own __new__() again.  This would
recurse endlessly.  The new code detects when we want to find a subclass
to create (when the base class is used, ie: Hardware()) vs when to
create the class itself (when the subclass is used, ie:
LinuxHardware()).
8 years ago
John R Barker b82d150c42 Add missing version_added (#17050)
A number of new arguments were added in
637bbdadfa (diff-60710cdc60751ecd19968b01b98283a0)
but not documented
8 years ago
Dag Wieers 947877dcce Try to avoid module-related tickets in the core Ansible project (#17047)
* Try to avoid module-related tickets in the core Ansible project

Since most users still report module-related problems in the Ansible core GitHub project, I added a warning at the top of the template.

Maybe it could help if the various projects would have more specific names ?

 - ansible/ansible  ->  ansible/main (or something even better ?)
 - ansible/ansible-modules-core  ->  ansible/modules-core
 - ansible/ansible-modules-extras  ->  ansible/modules-extras

I am sure someone can come up with perfect names ;-)

* Remove 'module' from the component options

I would prefer to again note that modules should go elsewhere, but don't want to bloat the text too much.
8 years ago
James Cammarata 68d44e48ba Remove sleeps and rely on regular queue options to process results 8 years ago
scottb aef20c4242 Minor rewording. 8 years ago
Peter Sprygada 7579df33ce Merge pull request #17032 from Qalthos/net_mod_nxos
Update NXOS to NetworkModule
8 years ago
Nathaniel Case 1ced3bfc25 NXOS changes
This refactors the nxos module to implement the classes from the
network common module.
8 years ago
James Cammarata 47acf55fa9 Cache tasks by uuid in PlayIterator for O(1) lookups
Rather than repeatedly searching for tasks by uuid via iterating over
all known blocks, cache the tasks when they are added to the PlayIterator
so the lookup becomes a simple key check in a dict.
8 years ago
Nathaniel Case 125c53e691 Relicense low-hanging fruit to BSD (#17025) 8 years ago
Victor Volle c9d2a67ec7 16888: comment module_utils/urls.py (#16987)
* 16888: comment module_utils/urls.py

* improved documentation of module (mentioning ‘requests’)

* remove mentioning of implementation details (urllib)

* improved parameter and return value documentation
8 years ago
James Cammarata 57fca2dde2 Validate new blocks during copy
It is possible that a block is copied prior to validation, in which case
some fields (like when) which should be something other than a string might
not be. Using validate() in copy() is relatively harmless and ensures the
blocks are in the proper structure.

This also cleans up some of the finalized logic from an earlier commit and
adds similar logic for validated.

Fixes #17018
8 years ago
Rene Moser 543f266801 update submodule refs, fixes build in ansible-modules-extras 8 years ago
jctanner df81f1197f Add Component Name to the issue and pr templates (#17019) 8 years ago
Brian Coca 47e3366744 fixed indent 8 years ago
Brian Coca ea033ae2cc removed extraneous test code 8 years ago
Brian Coca eb0c90ab80 added unsafe_writes as common file feature (#17016) 8 years ago
Adrian Likins 8c7d235323 Update ROADMAP_2_2.rst 8 years ago
James Cammarata 7503875ed7 Mark playbook objects as finalized after post_validate
After post_validate() is called on an object, there should be no
need to continue looking up at parent attributes. This patch adds a
new flag (_finalized) which is set to True at the end of post_validate,
and getattr will not look beyond its own attributes from that point on.
8 years ago
Peter Sprygada 375f7c515a Merge pull request #16978 from caphrim007/feature.add-module-doc-fragments-for-f5-modules
Adds module doc fragment for F5 modules
8 years ago
Peter Sprygada 29c76be768 Merge pull request #16999 from Qalthos/net_mod_ops
OpenSwitch to NetworkModule
8 years ago
Peter Sprygada 7720caadde Merge pull request #17006 from Qalthos/net_mod_ios
Clean up module_utils.ios
8 years ago
Scott Butler 12ce5a24da Minor wordsmithing. 8 years ago
Brian Coca 9a9268de0f version_added is required for new modules/options 8 years ago