Commit Graph

2339 Commits (9350b5ec22ce12605388976a74b23202d00133ba)

Author SHA1 Message Date
Jordan Borean b1ac65d95a
win_copy: added fix for win_copy deleting local tmp folder (#37964) 6 years ago
Jordan Borean c4e7b54630
win_reboot: fixed up warning message for dep args (#37898) 6 years ago
Toshio Kuratomi a82fea65c1 We need to save the basename into an attribute for calling code 6 years ago
Matt Martz 6051ef4041
Revert accidental addition of Mapping in #37741 (#37939) 6 years ago
Matt Martz ffbbb5a25b
Use arg_spec type for comparisons on default and choices (#37741)
* Use arg_spec type for comparisons on default and choices

* Further improve type casting

* Make sure to capture output in more places

* Individually report invalid choices

* Update ignore.txt after resolving merge conflicts
6 years ago
Nathaniel Case 169209c32a
Put back $PATH checking in ansible-connection call (#37933) 6 years ago
Matt Martz 0dcd8b598c
Don't assume that self._task.action is copy, explicitly set. Addresses #37238 (#37777) 6 years ago
Ganesh Nalawade 8eaa9cc938
Fix junos modules check_mode issue (#37311)
Fixes #37208

If check_mode is enabled instead of committing th config need to
discard all the chnages to cnadidate db
In case of cli to discard changes issue `rollback 0` command
and for netconf execute `discard-changes` rpc call
6 years ago
Eric Brown e95e9de235 Typos in the yaml inventory plugin
This patch fixes up some English typos in the yaml inventory
plugin documentation.

* s/specifically/specific
* s/as/as an

Signed-off-by: Eric Brown <browne@vmware.com>
6 years ago
Alex Tsitsimpis c3ab6cb9b1 template: Add option to `lstrip_blocks' and fix setting`trim_blocks` inline (#37478)
* template: Add integration tests for `lstrip_blocks'

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Fix passing `trim_blocks' inline

Fix passing `trim_blocks' option to the template module as inline
argument. Previously passing the `trim_blocks' option inline instead of
using the YAML dictionary format resulted in it always being set to
`True', even if `trim_blocks=False' was used.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Add option to `lstrip_blocks'

Add option to set `lstrip_blocks' when using the template module to
render Jinja templates. The Jinja documentation suggests that
`trim_blocks' and `lstrip_blocks' is a great combination and the
template module already provides an option for `trim_blocks'.

Note that although `trim_blocks' in Ansible is enabled by default since
version 2.4, in order to avoid breaking things keep `lstrip_blocks'
disabled by default. Maybe in a future version it could be enabled by
default.

This seems to address issue #10725 in a more appropriate way than the
suggested.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Add integration tests for `trim_blocks'

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Check Jinja2 support for `lstrip_blocks'

Since the `lstrip_blocks' option was added in Jinja2 version 2.7, raise
an exception when `lstrip_blocks' is set but Jinja2 does not support it.
Check support for `lstrip_blocks' option by checking `jinja2.defaults'
for `LSTRIP_BLOCKS' and do not use `jinja2.__version__' because the
latter is set to `unknown' in some cases, perhaps due to bug in
`pkg_resources' in Python 2.6.6.

Also update option description to state that Jinja2 version >=2.7 is
required.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>
6 years ago
Fredrik Holmberg e06f3463fd Typo in ipaddr filter (#37592)
interger = integer
6 years ago
Toshio Kuratomi 0633f73faf Fix loader for filters (#37748)
* Fix loading of filter and test plugins

Filter and test plugins are different than other plugins in that they
can have many plugins in a single file.  Therefore they need to operate
a little differently.  They need to have all of the potential files
returned.  Then the caller takes care of passing those onto jinja2 in
order for jinja2 to make use of them.

This problem was (most recently) introduced with f921369445

This commit also restructures how we deduplicate plugins to take paths
into account.  If we want to start scoping which set of modules are
loaded (due to roles, for instance) we'll need to hang on to the path
information.

* add integration test for override

* Fix style checks for bcoca code

* Implement jinja2 plugin loader as a subclass

Having a subclass allows us to customize the overriding of jinja
plugins.  We can then move common parts of common code into the Loader.
6 years ago
Will Thames 9802088082 New generator inventory plugin (#37690)
* New generator inventory plugin

Allows construction of hosts and groups through cartesian
product of various group combinations

* Add generator plugin documentation
6 years ago
Nathaniel Case 6aed74a97d Fix edgeos_config: {backup: yes} (#37619)
* Fix edgeos_config: {backup: yes}

* Add actual plugin copy
6 years ago
Ludek Finstrle 81cfbbbeb9 constructed inventory does not use group variables from previous inventory #37397
* Add support for loading invenotry group variables in constructed plugin
6 years ago
Toshio Kuratomi 09325b619e
Fix csvfile traceback on Python3 (#37625)
* Fix csvfile traceback on Python3

The csvfile lookup uses some custom iterators.  These needed to be
ported to handle the python3 iterator protocol.  In addition, the
csvfile module takes an iterator of byte strings in Python2 and an
iterator of text strings in Python3

Fixes #36808
6 years ago
Matt Martz 6c3e565ba3
Fix py3 issue in wait_for_connection (#37646) 6 years ago
Matt Martz b95b077993 Restore skipped/failed in JSON callback, add custom facts (#37204)
* Restore skipped/failed keys. Fixes #37050

* Display custom stats. Fixes #37184

* Add version_added

* Drop fallback, use self.get_option

* Remove unused import
6 years ago
Andrew Gaffney 0d0bdbec62 Load plugin config defs on first load only (fixes #37553) (#37584) 6 years ago
Nathaniel Case 594840c1d6
Close & remove paramiko connection where appropriate (#37528)
* Close & remove paramiko connection where appropriate

* Update unit test
6 years ago
Dag Wieers cdd21e2170
Clean up module documentation (#36909)
* Clean up module documentation

This PR includes:
- Removal of `default: None` (and variations)
- Removal of `required: false`
- Fixing booleans and `type: bool` where required

* Fix remaining (new) validation issues
6 years ago
Nathaniel Case 85cc5ea129
Raise error when trying to use older iosxr modules with netconf (#37423) 6 years ago
Mans Matulewicz 6292fe1116 small typo fix
small typo fix
6 years ago
mikedlr c2a063a5c0 aws ssm parameter lookup - testing and documentation around negative and failure cases (#36550) 6 years ago
Jordan Borean 708869edd6
win: handle non string as an environment value (#37215)
* win: handle non string as an environment value

* Changed powershell environment handler to use .net function instead for special chars
6 years ago
bdowling 0fee332643 Added missing store regex pattern for prompt found after error (#35820) 6 years ago
Nathaniel Case f0dc0b28d4
Fix side-effect of flags being passed to ios get_config again (#37084) 6 years ago
Anil Kumar Muraleedharan 23f15e6ff6 Lenovo license update (#36840)
* Editing the License text after Review of Lenovo Legal team.
6 years ago
David Newswanger 905b3e2f65
fix NIOS DNS lookup example (#36737) 6 years ago
Nathaniel Case 7016b3b9ca
ios_static_route idempotence fix (#35912)
* Remove default admin_distance and fix the idempotence thereof

Fixes #33290

* Fix tests and use yaml anchors to shorten tests

* Add test for undefined admin_distance

* Read config from `show run` if `show ip static route` fails

* Restore flags to ios.get_config &  use get_config where appropriate
6 years ago
Nathaniel Case 0feea66988
Move _start_connection() to module_utils/connection and fix Popen() call (#36249)
* Fix Popen() call to use ansible python

* Remove PATH searching, reuse location of ansible instead
6 years ago
Peter Sprygada 6cbc69447b adds fix for terminal plugins 6 years ago
Peter Sprygada 18d605a132 ugh q 6 years ago
Peter Sprygada d1ff03e84c fixes cliconf and netconf plugin loaders
This change updates the configuration and plugin loader objects for
cliconf and netconf to pull be able to configure where to find the
plugins.
6 years ago
abirami-n 4021194532 Fix_regex (#36569) 6 years ago
Ganesh Nalawade b12e90311f
map network_os to ncclient device_params (#36819)
* map network_os to ncclient device_params

Fixes #36786

* update device map

* Add default netconf fallback plugin
6 years ago
Ganesh Nalawade 41d75783b5
Fix junos_command py3 related issues (#36782)
Fixes #36204

*  tostring() input string shoulb be in byte string format
*  to_ele() input is required in unicode format
6 years ago
Brian Coca 809106ba77 fix unixy when debug's msg is not text (#36882)
fixes #36850
6 years ago
Alex Ratner c2feab0606 fix plugin-to-doc naming mismatch, typos, grammar (#36366) 6 years ago
Peter Sprygada fb6a8c0133
fix cliconf get_config method to match base signature (#36682)
This commit fixes up the get_config method to match the minimum method
signature as defined by the base class.  Without this patch, the
get_config method calls will fail in some cirumstances.
6 years ago
Dag Wieers 07e8fb5dbb
Windows: Clean up documentation (#36684)
This PR includes:
- Further cleanup of BOTMETA.yml
- Cleanup of author github handles
- Use of proper booleans
- One-line license statement
- Copyright format statement
- Smaller cleanups
6 years ago
Brian Coca 2f13ddbd69
debug should have item (#36534)
* debug should have item

* item should only be present when var
6 years ago
Sloane Hertel 73fd593d45
aws_ec2 inv plugin: remove extra call to verify_file (#36588)
* Remove extra call to verify_file

* Allow next inventory plugin to be tried if the file isn't verified
6 years ago
Matt Martz 10fefc7156
Re-use logic from StrategyBase._load_included_file in StrategyModule.run for free and linear (#36470)
This improves include_role performance and recursion limits
6 years ago
mikedlr 52f2057472 aws ssm parameter lookup - change to return Nones for missing variables (#36456)
* aws ssm parameter lookup - change to return Nones for missing variables

* aws ssm parameter lookup - fix error case message to dump response

* aws ssm parameter lookup - fix integration test cases
6 years ago
Jordan Borean df8a5d7a4f
fetch: set fail_on_missing: True as default as per docs (#36469)
* fetch: set fail_on_missing: True as default as per docs

* Updated docs for fetch to say behaviour was changed in 2.5 and updated tests
6 years ago
Trishna Guha d5858bbcbe
fail module when config is invalid and jsonrpc doesn't return error (#36482)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Brian Coca a79378fccb remove extra fields from debug output
fixes #35493

updated tests
6 years ago
Brian Coca 6af5693dc2
hide uneeded fields for callbacks (#36259)
* hide uneeded fields for callbacks

fix selective instead of pushing uneeded fields to the methods

* piipii
6 years ago
Sloane Hertel b39534201f [cloud] If inventory file isn't able to be parsed by aws_ec2, raise an AnsibleParserError (#36387)
* If inventory file isn't able to be parsed by aws_ec2, return an empty dict instead of None

* Raise an AnsibleParserError instead

* remove extra lines

* aws_ec2 inventory plugin - fix path matching logic
6 years ago