Commit Graph

2457 Commits (cc61c860492d3165a68b4c3361bac900d29613d2)

Author SHA1 Message Date
Toshio Kuratomi 20b9ca6e7c Rename original_basename parameter in various file-related modules
original_basename is a private internal parameter so name it
_original_basename to reflect that it is internal.
6 years ago
Toshio Kuratomi c8ac02d6f2 Emit a warning when src is used with a state where it should be ignored 6 years ago
Nathaniel Case 90770a290f Don't rewrite remote paths when remote is secretly local (#40259)
* Don't rewrite remote paths when remote is secretly local

* Remote overriding is configurable in connection

* Use c.DEFAULT_LOCAL_TMP instead of remote_tmp

* Remove remote_is_local from ConnectionBase

* remote_is_local->_remote_is_local

* Add warning signs to _remote_is_local and explanatory comments to its use
6 years ago
Scott Buchanan b12cf754f6 1Password lookup plugin (#37207)
* add pytest_cache to gitignore

* onepassword lookup plugin

* fix linter/style test complaints

* second pass at making pycodestyle happy

* use json module instead of jq

* update copyrights, license & version added

* fix python2 compatibility

* doh. fix spacing issue.

* use standard ansible exception

* remove potentially problematic stdin argument

* actually call assertion method

* add support for top-level fields

* make vault uuids pedantically consistent in fixture

* fix new style issues

* ability specify section & correct case handling

* improve error handling

* add onepassword_raw plugin

* Add maintainer info

* Move common code to module_utils/onepassword.py

* Load raw data JSON data for easier use in Ansible

* Put OnePass class back inside lookup plugin

There is no good place for sharing code across lookups currently.

* Remove debugging code in unit tests

* Patche proper module in raw unit tests

* Add changelog entry

Co-authored-by: Scott Buchanan <sbuchanan@ri.pn>
6 years ago
Adam Miller 98a198a777
Handle incorrect data type in list lookup plugin (#35483)
handle incorrect data type in list lookup plugin
Fixes #35481
test to ensure that loops properly handle incorrect datatypes

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Anil Kumar Muraleedharan 1cb4619c9a Modifying cnos-facts, cnos_command and cnos-config in line with the design followed in Ansible. Adding unit test cases for these modules. Added plugins to support them. (#39955)
* Modifying cnos-facts, cnos_command and cnos-config in line with the design followed in Ansible. Adding unit test cases for these modules. Added plugins to support them.

* Removing doc fragment conflicts with other modules

* Replacing show with display
6 years ago
Ganesh Nalawade 30f992f260
Add netconf_get module (#39869)
* Add netconf_get module

Implements part-1 of proposal #104
https://github.com/ansible/proposals/issues/104

*  Add netconf_get module
*  Refactor `get`, `get_config`, `lock`, `unlock`
   and `discard_changes` netconf plugin api's
*  Add netconf module_utils file which netconf module
   related common functions
*  Refactor junos and iosxr netconf plugins

* Fix source option handling

* Fix review comments

* Update botmeta file

* Update review comments and add support for lock

* Lock update fix

* Fix CI issue

* Add integration test and minor fixes

* Fix review comments

* Fix CI failure

* Fix CI issues

* Fix CI issues

* Fix review comments and update integration test

* Fix review comments

* Fix review comments

* Fix review comments

Fix reveiw comments
6 years ago
Thad Guidry 98579029d7 small grammar improvements to add clarity (#40157) 6 years ago
Tim Rupp 5e7878a6a1
Adds various fixes for f5 modules (#40208)
* Adds stty expansion for cli commands
* minor fixes
* Make bigiq rest client work correctly
6 years ago
John Sutterfield d5a5e37fcf Add fallback check for IAM role temp creds (#40240)
* Add fallback check for IAM role temp creds
6 years ago
Ricardo Carrillo Cruz 5ae77337a1
Rename persistent_connection_timeout to connect_timeout in INI section (#40260) 6 years ago
Toshio Kuratomi ca4147f2cc Fixes #34893 (#40166)
Fixes several bugs exposed in #34893
* Fixes relative path handling in copy so that it splits directories and
  reconstructs the correct file path
* Return failed in the proper circumstances
6 years ago
Fabian von Feilitzsch 4373b155a5 Move k8s modules to dynamic backend (#39632)
* Move k8s modules to dynamic backend
6 years ago
Anil Kumar Muraleedharan f60731e27e Lenovo cli expansion - Modify command acronyms to full commands (#40218)
* Changing Lenovo Inc to Lenovo and update License file to be consistent.

* Editing cli commands to expanded form. Changing username and password fields as per Ansible standards.
6 years ago
Ricardo Carrillo Cruz 62e1c14edc
Pull persistent connection parameters via get_option (#39367)
* WIP Pull persistent connection parameters via get_option

* Fix pep8

* Add use_persistent_connection setting to paramiko_ssh plugin

* Add vars section to persistent_command_timeout setting and prevail provider values over config manager

* Use persistent_command_timeout on network_cli instead of timeout

* Fix unit tests

If we don't call loader to get network_cli, then _load_name is never
set and we get KeyError.

* Pull persistent_command_timeout via config  manager for ios connection local

* Pull persistent_command_timeout via config manager on connection local
6 years ago
Deepak Agrawal 86c945a628
network_put and network_get modules (#39592)
* Initial commit

* Socket Timeout and dest file handler

* sftp handling

* module name change as per review

* multiple thread tmp file overwite problem

* Integration test suite for network_put

* add additional testcase for dest argument

* fix pylint/pep8/modules warnings

* add socket timeout for get_file

* network_get module

* pep8 issue on network_get

* Review comments
6 years ago
vigiroux 0b3ed626b3 empty lines in csvfile means row has no items in list; check row len first. (#40089) 6 years ago
Tobias Wolf 25a48fb89e Allow Unicode chars to be dumped by yaml stdout callback (#40188)
* Allow Unicode chars to be dumped by yaml stdout callback

Allow Unicode in yaml.dumper to support printing strings unescaped with
\uxxx chars.

Cf. https://stackoverflow.com/a/29600111

* Switch from decode('utf-8') to the more compatible to_text()
6 years ago
Sloane Hertel b8a93c12e2 [aws_s3] Fix uploading src option on the target machine to a bucket (#39023)
* Fix backward compatibility for uploading src option on the target machine to a bucket

* Allow the module to handle errors for nonexistent files
6 years ago
Nathaniel Case f04c876ecd
Nxos fixes (#40117)
* Alter nxos_nxapi tests to test the right thing

* Defend #40027
6 years ago
Jordan Borean e0813d7d47
become win: better error messages and docs update (#39936)
* become win: better error messages and docs update

* Fix syntax error and added changelog fragment
6 years ago
Jordan Borean 44ab948e5d
create module tmpdir based on remote_tmp (#39833)
* create module tmpdir based on remote_tmp

* Source remote_tmp from controller if possible

* Fixed sanity test and not use lambda

* Added expansion of env vars to the remote tmp

* Fixed sanity issues

* Added note around shell remote_tmp option

* Changed fallback tmp dir to ~/.ansible/tmp to make shell defaults
6 years ago
Toshio Kuratomi 38ab36a625 Revert "Configurable list of facts modules (#31783)" (#40022)
This reverts commit 95655fae5c.
6 years ago
Martin Krizek 6d984c7988 low_level_execute_command: add stderr_lines 6 years ago
Trishna Guha 5cf61d7401
ios cliconf plugin fix regex for version (#40066)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Tim Rupp 00a6b19e58
Fixes and additions for f5 modules (#39986)
Small fixes in the f5 module utils. I believe the action plugins now
work consistently across types of connections
6 years ago
Brian Coca 95655fae5c
Configurable list of facts modules (#31783)
* configurable list of facts modules

 - allow for args dict for specific modules
 - add way to pass parameters
 - avoid facts poluting test
 - move to 'facts gathered' flag
 - add 'gathering' setting tests
6 years ago
Martin Krizek b2929f0eba
Fix callback._dump_results to dump vaulted data v2 (#39975) 6 years ago
Toshio Kuratomi 6b6c4914d2 Initial cleanup of file module
* Remove use of six.b as Python-2.6+ have byte literals.
* Make AnsibleModule a global object so we'll have access to it in all
  the functions we're going to break this up into.
* Rework the parameters so things that are in file_common_args are used
  from file_common_args or the reason for deviation is documented.
* Remove validate as a parameter: this should be taken care of by
  removing it from params before the copy and template action plugin
  invoke file.
* Rename diff_peek to _diff_peek as it is an internal parameter.
* add module_name execute_module call to assemble so that it is more greppable
6 years ago
Toshio Kuratomi d994595660 Make the copy module pass correct parameters to file module 6 years ago
Brian Coca cbb6a7f4e8
Enabled unsafe and vault in JSON (#38759)
* allow to load json marked as unsafe or vault

 * centralized json code/decode, add vault support
 * use generics to allow for more varied inputs
 * allow inventory to dump vault w/o decrypting
 * override simplejson also
 * add entry for unsafe also
 * load vaulted and unsafe json, support unvaulting if secrets provided
6 years ago
Andrew Gaffney ff16e993be Fix task banner with 'actionable' callback when using templates in name (#38165)
This fixes #31074.
6 years ago
Nathaniel Case c6270e15a6
Remove provider (and transport, where applicable) from consideration when not using connection=local (#39555)
* Remove provider (and transport, where applicable) from consideration

* Add tests that misplaced transport does not fail task
6 years ago
Trishna Guha f08332acb4
nxos enable mode (#39355)
* nxos enable mode

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix prompt

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add authorize,auth_pass

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* remove byte string from exec_cli_command

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add on_become test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* removed_in_version

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Markus Häll 58f9676d4b hashi_vault: fix for : in secret name (#39820) 6 years ago
Stephan Lohse 1e4c389268 allow become methods for Jail connection plugin (#31746)
* allow become methods

- i personally tested 'su', 'sudo' and 'doas'

* forgot to import constants m(
6 years ago
Matt Martz efff75389d
Use updated task, instead of original, non-merged included_file._task (#39762)
* Used updated task, instead of original, non-merged included_file._task. Fixes #39637

* Add changelog entry
6 years ago
Ganesh Nalawade 0ac222d68b
Fix nxos terminal plugin regex (#39659)
Fix nxos terminal plugin regex to match
command prompt without newline character as prefix
6 years ago
Jordan Borean fc210a4584
base64 filter: Added ability to specify encoding (#39714)
* base64 filter: Added ability to specify encoding

* Added unicode chars for further testing

* Removed errors to keep previous behaviour in place

* Removed surrogate pairs due to issues loading YAML in CI
6 years ago
Abhijit Menon-Sen 0a119c391a Only expand '~' based on become_user/remote_user
Change brought forward from #00c023e in stable-2.5.

Closes #39281 (bug report)
Closes #39540 (PR with substantially the same change)
6 years ago
Brian Coca 70d89b5487 use actual ssh executable as it might not be ssh 6 years ago
Ganesh Nalawade eb5e15e7e0
Fix fetching ios default running config (#39475)
If default option is enable in that case only
add 'all' or 'full' flag
6 years ago
Yanis Guenane dc420fc5fa Allow non-inclusion of setup task in junit report
The JUnit callback pushes every tasks in the report. Even the setup
tasks that - sometime - might clutter the report rather than being
useful, based on one needs.

This PR allows one to specify whether or not the setup tasks should be
part of the final report, defaulting to True to be backward compatible
to what is already in place today.
6 years ago
Jordan Borean 04ae0c3312
winrm: removed old exec_command that is no longer used (#39572) 6 years ago
Dag Wieers e9270fb100 mail callback: Exception info less important
So it seems on failure the last raised (but handled) exception is being
added to the task failure result, which makes it often unrelated to the
actual failure.

Since we assumed the exception was always related, using the exception
information for the subject is plain wrong (and let me to debug
completely unrelated ghost issues).

Also the exception details are now moved back in the output. Maybe we
should not show it unless there's no other information ? But at least it
should not be the mail's subject.
6 years ago
Ikrom b667126d35 Update example in lookup dict.py (#39488)
Typo fixed
6 years ago
Toshio Kuratomi 2976b653ce Need to convert filenames to byte strings before using them in APIs
Under a non-utf-8 locale (for instance, LC_ALL=C), passing a non-ascii
filename to many APIs will traceback.  Fix that by explicitly converting
to byte strings before passing to external APIs.

May fix #27262
6 years ago
Pilou 019decd29a doc: Add missing parenthesis in first_found example (#39420) 6 years ago
Jordan Borean 25dea1f72c Change except Error when trying to get a missing option 6 years ago
jctanner bbfe7a8b2f
more debug logs for free, network_cli, paramiko and add hostname context to debugging messages (#39205)
* Add hostname context to debugging messages
* Set paramiko's channel
6 years ago