Commit Graph

2615 Commits (97cc0cce7f53b704f8541530e42d5e515584cd95)

Author SHA1 Message Date
Peter Sprygada d086d57d11 adds a new feature to the telnet action plugin
This change adds a new argument to the telnet action plugin that will
cause the module to send a newline character before trying to login.
This is convienent when using telnet over a console connection that
needs an initial newline character to start the login process.

This change also will cause the sent command and command response to be
displayed on stdout when running in verbose mode (5 v's).
6 years ago
Nathaniel Case 6b162142a7 ios_file: Don't leave leftover files behind (#42622)
* Don't leave leftover files behind

* Fix writing files in python3

* Replace nonascii.bin with one that will not pass for unicode
6 years ago
Jordan Borean d723b8541d changed winrm _reset to reset and make ssh reset show warning (#42651)
* changed winrm _reset to reset and make ssh reset show warning

* minor changelog update
6 years ago
Samir Musali 985768b2af LogDNA Callback Plugin (#40296)
* LogDNA Callback Plugin...
6 years ago
Fran Fitzpatrick 5928ec04ca Adds an ipmath filter (#41985) 6 years ago
Jerry Chong 42f44b24c6 Fix NameError in pause module (#42038)
* Fix NameError in pause module

* Add comment and changelog

Co-authored-by: Jerry Chong <jchong@netbase.com>
6 years ago
Jordan Borean 940d4a0e89
win_reboot: fix 2.6 issues and better handle post reboot reboot (#42330)
* win_reboot: fix 2.6 issues and better handle post reboot reboot

* changed winrm _reset to reset

* Add handler to reset calls when .reset() throws an AnsibleError on older hosts

* Moving back to _reset to get the issue fixed
6 years ago
Andrew Gaffney 824524c67a
Display task banner before showing file diff (#42573) 6 years ago
Brian Coca 4a7940c562
Ensure string types (#42362)
* actually enforce string types

* unquote after its text

* fixed incorrect template type

* fixing string showed error in template typing
6 years ago
Toshio Kuratomi 673c55f2ef Separate some 255 exit codes that are not ssh errors
The ssh connection plugin is overzealous in thinking that error code 255
can only come from ssh.  Python can return 255 in some circumstances and
error from php does as well.
6 years ago
Brian Coca 8e1d223301
complete plugin docs (#42355)
* complete plugin docs

  * add missing 'plugin' option
  * user and password are now 'correctly' required
  * added  inventory source example and extension information for user
6 years ago
Brian Coca 2496fd35fb added required missing field for common yaml fmt 6 years ago
Matt Martz 50905b980d Support item label in v2_playbook_on_include (#42478)
* Support item label in v2_playbook_on_include. Fixes #42301

* test fixes
6 years ago
Sam Doran 1d1595b990
Fix pause module so it does not stack trace when redirecting stdout. (#42217)
* Use separate variables for stdin and stdout file descriptors

* Do not set stdout to raw mode when output is not a TTY
6 years ago
Jordan Borean 8bdd04c147 Fix remote_tmp when become with non admin user (#42396)
* Fix tmpdir on non root become

 - also avoid exception if tmpdir and remote_tmp are None
 - give 'None' on deescalation so tempfile will fallback to it's default behaviour
   and use system dirs
 - fix issue with bad tempdir (not existing/not createable/not writeable)
   i.e nobody and ~/.ansible/tmp
 - added tests for blockfile case

* Revert "Temporarily revert c119d54"

This reverts commit 5c614a59a6.

* changes based on PR feedback and changelog fragment

* changes based on the review

* Fix tmpdir when makedirs failed so we just use the system tmp

* Let missing remote_tmp fail

If remote_tmp is missing then there's something more basic wrong in the
communication from the controller to the module-side.  It's better to
be alerted in this case than to silently ignore it.

jborean and I have independently checked what happens if the user sets
ansible_remote_tmp to empty string and !!null and both cases work fine.
(null is turned into a default value controller-side.  empty string
triggers the warning because it is probably not a directory that the
become user is able to use).
6 years ago
Ganesh Nalawade 5635848654
Fix typo in cliconf pluign (#42399)
* Fix capability key typo error in ios, eos and
  vyos cliconf plugins.
6 years ago
Brian Coca 475abc0af7
inventory plugin docs (#42022)
* inventory plugin docs
* added set options
* minor wording and formatting fixes
* changed headers to std as per #35520, also added to main readme
* unified inventory plugin devel, referenced from generic plugin dev
* fixed typos and update as per feedback
6 years ago
Deepak Agrawal 30688fecf3
Idempotency for net_get and net_put modules (#42307)
* Idempotency for net_get and net_put modules

* pep8 warnings fix

* remove import q
6 years ago
Ganesh Nalawade 31dd41e4c5 Fix fetching old style facts in junos_facts module (#42336)
* Fix fetching old style facts in junos_facts module

Fixes #42298
* To fetch old style facts from junos device it requires
  login credentials in provider, hence while using
  connection=nectonf do not delete provider values
  as it might not be ignored

* Add `ofacts` as one of the options in `gather_subset`

* Minor update in documentation

* Fix CI failure
6 years ago
Ganesh Nalawade 75382814f0
Add fetching default filter in ios cliconf plugin (#42339)
* Add capability to fetch default filter flag in
  ios cliconf plugin.
6 years ago
Rémi REY da0f58787e callback/grafana_annotations: define validate_grafana_certs type as bool (#42318)
Fixes #42317
6 years ago
Ganesh Nalawade c068b88b38
Update eos, ios, vyos cliconf plugin (#42300)
* Update eos cliconf plugin methods

*  Refactor eos cliconf plugin
*  Changes in eos module_utils as per cliconf plugin refactor

* Fix unit test and sanity failures

* Fix review comment
6 years ago
Trishna Guha df8ad8ebf9
fix regex cliconf nxos (#42288)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Trishna Guha 0e05425b32
Refactor nxos cliconf get_device_info and add requirements for JSON structured output support in nxos_facts module (#42089)
* nxos_facts requires JSON structured output support

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

* refactor get_device_info for legacy devices

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

* update additional logic

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Ashish Billore faa83285dc Udate ini.py with corrected intended use (#42232)
* Udate ini.py with corrections to intended use

Corrected the intended use for ini reads.

* Update ini.py with corrected intended use info
6 years ago
Nathaniel Case 5850591d14
Base connection class for network-style connections (#41839)
* Create base class for network-style connections

* clean up some differences

* Move NetworkConnectionBase

* Tweak netconf for tests

* Tweak when network_os is checked to avoid failing tests

* Pull back exec_command
6 years ago
Andrew Gaffney f4efa2c4cc
Provide a fallback value for all options in 'default' callback plugin (#42155)
This is necessary for plugins that subclass 'default' but don't also
include its docs fragment. This is a follow-up to #41058
6 years ago
Sloane Hertel 44e5886385 Fix setting required options for inventory plugins (#42049)
* Fix setting required options for inventory plugins

* call set_options for yaml and script plugin
6 years ago
Matt Martz aea396f04b
Add items2dict filter that is the reverse of dict2items (#42071)
* Add items2dict filter that is the reverse of dict2items

* Address feedback about type checking, and add docs for zip/zip_longest
6 years ago
Ganesh Nalawade 88b966e23b
Fix junos_config confirm commit issue (#41527)
* Fix junos_config confirm commit issue

Fixes #40626

* Due to issue in ncclient commit() method for Juniper
  device (ncclient/ncclient#238)
  add a workaround in junos netconf plugin to generate proper
  commit-configuration xml and execute it using ncclient
  generic `rpc()` method.

* Update junos_config doc
6 years ago
Ganesh Nalawade e41d427d1b
Add run_commands api for ios and vyos cliconf plugin (#42093)
* Add run_commands api for ios and vyos cliconf plugin

*  Add run_commands api to ios and vyos cliconf plugin
*  Refactor ios and vyos module_utils to check return code
   in run_commands

* Fix Ci failures
6 years ago
Troy Murray 15ce7c5bab change OS X to macOS (#41294)
* change OS X to macOS

<!--- Your description here -->

+label: docsite_pr

* Update all Mac OS X references to be macOS

* Drop extra Mac
6 years ago
hirsts c0c20835ac Create splunk.py (#40568)
* Create splunk.py

This is a new callback for logging to Splunk. It is based on sumologic.py and updated to work with the Splunk HTTP Event Collector. 
This has been by our team and others. 
It is working with Ansible 2.5.2

* Update splunk.py

Addressed white spaces and formatting issues

* Update splunk.py

* Update splunk.py

* Updated version to match target release

Following code review recommendations. Thanks for the help

* Updated colon impacting documentation

Updated based on code reviews. Thanks the help

* Updated quotes to be consistent
6 years ago
Brian Coca 27e3cd6e05 options should be settable multiple times 6 years ago
Ganesh Nalawade 9acb5780bc
Add diff capability in vyos edit_config (#41950)
* Add diff capability in vyos edit_config

Fetch onbox diff within edit_config cliconf
plugin and return it in response

* Remove diff returned from ios edit_config

* Fix CI failure

* More CI fixes
6 years ago
Jordan Borean 2af36412f9
runas + async - get working on older hosts (#41772)
* runas + async - get working on older hosts

* fixed up sanity issues

* Moved first task to end of test for CI race issues

* Minor change to async test to be more stable, change to runas become to not touch the disk

* moved async test back to normal spot
6 years ago
Matt Martz 93537425a0
Don't import password lookup from network filters. Fixes #41874 (#41907) 6 years ago
Matt Martz 1a2ef0922f
Use inventory.get_host instead of direct access to inventory.hosts (#41860)
* Use inventory.get_host instead of direct access to inventory.hosts. Fixes #32152

* Prevent potential side effect, by using self._inventory.localhost directly instead of get_host
6 years ago
Jordan Borean 9b7b564d75
Stop displaying kinit pass input on a failure (#41882)
* Stop displaying kinit pass input on a failure

* Fixed up minor logic info and added tests
6 years ago
Nathaniel Case 97ffb4c4d2
New base class for HttpApi plugins (#41915) 6 years ago
Martin Krizek 8b5283f547 Template handler name 6 years ago
Ganesh Nalawade b84adfd885
Fix ios and vyos cliconf edit_config return type (#41896)
* Fix ios and vyos cliconf edit_config return type

Modify cliconf edit_config api to return a json string with
diff and response received from remote host for ios and vyos.

* Doc change
6 years ago
Paul Neumann d4b9105c9c cliconf: Fix use of multiple prompts in send_command (#41885)
Upon preparing the commands for sending to the device, cliconf converts
the optional prompt to a byte string. However, since there might be
multiple prompts specified, the conversion has to happen for each prompt
individually. Otherwise, wrong regexes will be compiled in
_handle_prompt from network_cli Connection.
6 years ago
Ganesh Nalawade 773c031d33
vyos and ios cliconf plugin refactor (#41846)
* vyos and ios cliconf plugin refactor

*  Refactor vyos cliconf plugin
*  Change vyos module_utils and vyos_config as per refactor
*  Minor changes in ios cliconf plugin

* Fix unit test failure

* Fix sanity issues

* Add get_diff to rpc list
6 years ago
Andrew Gaffney 9c5d40ff15
Merge various stdout callback plugins into 'default' (#41058)
This allows mixing and matching of stdout callback features
6 years ago
Brian Coca 11dbed1350 fix vars hostname fallback
also made it optimistic, rely on exceptions instead of copmlex if chains
6 years ago
Nathaniel Case dd932c9ace
Make validate_certs togglable for httpapi (#41538)
* Make validate_certs togglable for httpapi

* Add `version_added`
6 years ago
Nathaniel Case 9aa8c652ba
Netconf bytes fixes (#41607)
* Solve some bytes issues on iosxr

* Solve some bytes issues in junos

* Do the correct thing with tostring based on lxml or not
6 years ago
Brian Coca 0102e42272
exclude lookup_terms from config errors (#41740)
* exclude lookup_terms from config errors
* moved direct
6 years ago
Olivier Bourdon 06b73ff8f1 Add random_mac string filter (#39775)
Add new filter to generate random MAC addresses from
string prefix. See docs/docsite/rst/user_guide/playbooks_filters.rst
for more detailed infos.
6 years ago