Commit graph

36499 commits

Author SHA1 Message Date
Pilou
5fc9f3d219 module_common: handle None value for templar (#36651)
* module_common: set required parameter templar

Fix the following error (related to b455901):

  $ ./hacking/test-module -m ./lib/ansible/modules/system/ping.py -I ansible_python_interpreter=/usr/bin/python
  Traceback (most recent call last):
    File "./hacking/test-module", line 268, in <module>
      main()
    File "./hacking/test-module", line 249, in main
      (modfile, modname, module_style) = boilerplate_module(options.module_path, options.module_args, interpreters, options.check, options.filename)
    File "./hacking/test-module", line 152, in boilerplate_module
      task_vars=task_vars
    File "ansible/lib/ansible/executor/module_common.py", line 910, in modify_module
      environment=environment)
    File "ansible/lib/ansible/executor/module_common.py", line 736, in _find_module_utils
      shebang, interpreter = _get_shebang(u'/usr/bin/python', task_vars, templar)
    File "ansible/lib/ansible/executor/module_common.py", line 452, in _get_shebang
      interpreter = templar.template(task_vars[interpreter_config].strip())
  AttributeError: 'NoneType' object has no attribute 'template'

* module_common.modify_module: templar is required

(cherry picked from commit 7908f78fa6)
2018-04-18 10:01:31 -07:00
Jim Gu
8473765ae6 yaml callback fails on python3
When the URI module returns complex JSON objects, the YAML callback
fails while trying to represent these objects.  The problem arises
because the filter method returns an iterator in Python 3, rather than a
str object.  Therefore, the str method expandtabs() is not available,
and the callback fails with the following error:

[WARNING]: Failure using method (v2_runner_on_failed) in callback plugin (<ansible.plugins.callback.yaml.CallbackModule object at 0x7f7c7ed8aa20>): 'filter' object has no attribute 'expandtabs'

Issue can be replicated by running this playbook:

- hosts: localhost
  gather_facts: false
  tasks:
    - uri:
        url: https://jsonplaceholder.typicode.com/posts

ansible-playbook tmp.yml -v

(cherry picked from commit 5839f07e0f)
2018-04-18 10:00:44 -07:00
Artem Tiumentcev
b37facb234 fix set options in callbacks for foreman
(cherry picked from commit 082b03c829)
2018-04-18 10:00:07 -07:00
Brian Coca
d31d84cfa3 avoid caching invetnory sources in loader (#38242)
* fix inventory plugin source caching

 - avoid caching invetnory sources in loader in base
 - same fix for yaml plugin
 - idem for 'auto' plugin

fixes #37162

* fix mock dataloader func sig

(cherry picked from commit 886c4edfb9)
2018-04-18 09:59:35 -07:00
Lutz Reinhardt
a3798d9b62 fix bug in modules/system/user.py (#37552)
for freebsd tool "pw" use date not days in "modify_user"
(cherry picked from commit d512bed495)
2018-04-18 09:57:56 -07:00
Bill Nottingham
923015d9d7 Set raw=True when reading passwords from ConfigParser files. (#35582)
* Set `raw=True` when reading passwords from ConfigParser files.

The assumption is that no one is actually doing interpolation on the
password value, even if they may for other configuration values, and
passwords are far more likely to contain '%'.

* Add vmware_inventory as well.

(cherry picked from commit 15b6ec66bb)
2018-04-18 09:41:16 -07:00
Brian Coca
0852ea6dc0 clarify os x password with user module (#38344)
also removed pointer to non existing example

fixes #36427
(cherry picked from commit f630d420c6)
2018-04-18 09:40:44 -07:00
AlanCoding
dfbba6e75b Reduce recursion within group methods
This offers an optimization that allows loading larger
inventories of various structure by improving the
scaling laws involved for adding hosts and groups.

The primary speed benefit is the elimination of duplicate
recusion from traversing converging paths.

(cherry picked from commit 153c9bd539)
2018-04-18 09:32:30 -07:00
Brian Coca
cf1cb61efb clarifying docs with first_found (#36951)
better examlpes as this was never really a task loop, but contained inside the lookup itself
(cherry picked from commit 42d15671d0)
2018-04-18 09:31:30 -07:00
Brian Coca
00848dff17 made missing cli tools non fatal (#37194)
* made missing cli tools non fatal

* remove bare exceptions

these shoudl not be there as they can prevent 'wanted' exits

(cherry picked from commit 0c2e7fd841)
2018-04-18 09:24:58 -07:00
Toshio Kuratomi
f670602448 Fix places in docs that refer to modules without namespace
We've namespaced all plugin docs.  Change the docs to reflect that

(cherry picked from commit 9faf7b949e)
2018-04-18 08:48:41 -07:00
Martin Krizek
751ae4f4a9 playbooks_variables.rst: fix facts code-block (#38520)
(cherry picked from commit 5297eac46d)
2018-04-18 08:44:27 -07:00
Brian Coca
145f42eba3 fix displaying group vars in graph
(cherry picked from commit 265d838ec9)
2018-04-18 08:34:24 -07:00
Toshio Kuratomi
003c52f1ef Modules that have a link to their own deprecated section need to use a different link syntax (#38697)
The :ref: syntax is for linking to targets which are defined for the
whole document tree.  `link`_ is for linking to targets which are inside
of the document.  We want the latter for deprecated sections because
otherwise we'd have to create namespaced link targets for them.

Also fix expansion of version a deprecated module will be removed in
(cherry picked from commit 25523666ce)
2018-04-18 08:28:59 -07:00
Chris Houseknecht
61e3f32f81 Auth method for the k8s lookup plugin now matches other modules (#37533) (#37618) 2018-04-18 08:08:15 -07:00
Trishna Guha
456fe2add1
nxos bugfixes cherry-pick (#38950)
* fix nxos_ntp_options (#38695)

(cherry picked from commit 1d975bdc93)

* fix ntp_auth issues (#38824)

(cherry picked from commit a372142434)

* update nxos changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-04-18 09:59:39 -04:00
Abhijeet Kasurde
9a7da8d3da
add instanceUuid (also called PersistentId) in vmware utils (#38870)
(cherry picked from commit 0cdba9ff70)
2018-04-18 17:41:15 +05:30
Jordan Borean
0fede2ba60
Tolerate win line endings on module load 2.5 (#38919)
* Tolerate win line endings on windows module_util load (#37291)

* tolerate windows line endings when loading windows module utils.  Helpful for old custom windows modules.

* add test modules to demonstrate win line ending module load behaviour.

* attempt to fix sanity check failures

* pep8 fix

* explict skip of test modules from shebang check (core modules must still have expected unix style line endings)

* switch to rstrip() following core team meeting feedback

(cherry picked from commit ad94d03ba1)

* Added changelog fragment

* Added ignore rules to older sanity tests

* Removed test files due to old shebang not being possible without bigger change
2018-04-18 15:25:18 +10:00
Jordan Borean
4b55ecc825
Update win_certificate_store.py (#38860) (#38927)
* Update win_certificate_store.py

Improvements to describe the different destination stores.

+label: docsite_pr

* Update win_certificate_store.py

Whole line needs to be quoted -- lingfish YAML fail.

(cherry picked from commit d684c51815)
2018-04-18 14:31:09 +10:00
Matt Clay
8606fa0431 Update httptester container reference.
(cherry picked from commit 35748e5228)
2018-04-17 21:26:02 -07:00
scottb
893807bfc9 [WIP] disambiguating autogenerated module docs attempted fix of #38439. (#38890)
Disambiguates autogenerated module docs - fixes #38439.

(cherry picked from commit c97e508806)
2018-04-17 18:49:27 -07:00
Toshio Kuratomi
4091ab479f Add alias's as a :ref: target for modules
This is especially important for deprecated modules as we want to link
to those in porting guides and such.

(cherry picked from commit 8f1b5fc47b)
2018-04-17 18:49:20 -07:00
Jordan Borean
10aa5a37aa
win_regedit: backport 2.5 stabilise tests (#38918)
* win_regedit: stabilise tests (#38912)

(cherry picked from commit 77ef4802f0)

* Added changelog fragment
2018-04-18 08:45:00 +10:00
Jordan Borean
9178def456
Fix typo in windows_faq.rst (#38864) (#38916)
Fix typo in `python-pip` packet name.
+label: docsite_pr

(cherry picked from commit 92f4065157)
2018-04-18 08:06:42 +10:00
Matt Clay
2b73a5b69f Restore docker_secret test on RHEL.
(cherry picked from commit 57f1298074)
2018-04-17 13:57:05 -07:00
Matt Clay
938625add7 Disable failing fortios_* tests. 2018-04-17 11:55:41 -07:00
Sviatoslav Sydorenko
867bc8967e
Upgrade PYPI badge to point to new Warehouse site
It should become default quite soon:
https://github.com/pypa/warehouse/milestone/1
2018-04-17 16:03:11 +02:00
Toshio Kuratomi
ae79eef0b2 Add changelog entry for grafana base64 port
(cherry picked from commit f5cc4acc53)
2018-04-17 06:52:56 -07:00
Rémy Léone
24c1e2ed0a Fix deprecated warnings
(cherry picked from commit 98fb47b061)
2018-04-17 06:52:50 -07:00
John R Barker
f5befa5ab4
Correct formatting (#38874) (#38877)
(cherry picked from commit 3d3781db57)
2018-04-17 13:22:43 +01:00
John R Barker
507423f111
issue:38321 fix onyx_config module failed while using python = 3.5 (#38343) (#38869)
* issue:38321 fix onyx_config module failed while using python = 3.5 (#38343)

(cherry picked from commit 0d79268a6d)

* changelog
2018-04-17 13:16:03 +01:00
Abhijeet Kasurde
bb50c65769
VMware: handle permission denied while reading facts (#38868)
This fix adds exception handling which is raised when user
does not have correct set of permissions/privileges to read virtual machine
facts especially host system configuration.

Fixes: #37056

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit efc3f4f824)
2018-04-17 16:20:46 +05:30
Abhijeet Kasurde
5f8758d6a3
Use correct esxi host variable in vmware_cfg_backup
Fixed bug where hostname could not be found and minor documentation changes.

(cherry picked from commit 8f5320435f)
2018-04-17 15:20:09 +05:30
Abhijeet Kasurde
d9436f18f5
VMware: correct documentation for datacenter
This fixes documentation related to datacenter in vmware_guest_find
module.

Fixes: #38290

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 2367130ba3)
2018-04-17 15:07:05 +05:30
Abhijeet Kasurde
95386d6075
Correct module name in vcenter_license.py (#37672) (#37728)
Module name should be vcenter_license not vmware_license.

(cherry picked from commit 0214a85382)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-17 15:01:00 +05:30
Ganesh Nalawade
8f2d46ecf8
Add supported connection in junos module documentation (#38813) (#38865)
* Add supported connection in junos module documentation

Add supported connection type in junos module doucmentation.

* adds link to platform docs

* makes recommended connection a code snippet

* does this fix banner and command?

* does this fix the rest of the errors?

(cherry picked from commit 67d561b0c8)
2018-04-17 11:58:40 +05:30
Jordan Borean
897eab8d04
win_updates: fix when failed is not present in output (#38856) (#38857)
(cherry picked from commit f1c16438c1)
2018-04-17 11:39:45 +10:00
Matt Clay
ce1913a76f Use new vcenter simulator container location.
(cherry picked from commit 1d5c933ecf)
2018-04-16 15:17:08 -07:00
Brian Coca
4d7e174748 centralize doc/config plugin lists (#38775)
* centralize doc/config plugin lists

also update list for generation in docsite
added note to ensure they are in sync

* updated shell page to list plugins

added some more docs hinting at plugins being configurable

* fix edit link for plugins

(cherry picked from commit bdbb89378f)
2018-04-16 13:02:29 -07:00
s-hertel
b523910269 add changelog 2018-04-16 11:09:30 -04:00
Brian Coca
23fd9bb328 better handling of diff key types in compose
also made separator configurable
fixed some exception types
better error msgs

(cherry picked from commit c679186f17)
2018-04-16 11:09:30 -04:00
Martin Krizek
1684823196
Use correct action in warning about missing name (#38481)
(cherry picked from commit fd96bcd22f)
2018-04-16 14:42:11 +02:00
Deepak Agrawal
829f9fda7a
doc changes for backup option of network _config modules (#38797) 2018-04-16 12:30:05 +05:30
Abhijeet Kasurde
6030535917
VMware: Set default network type as 'dhcp' (#38755)
If user does not specify any network type then set network type
to dhcp. There are additional checks around 'ip', 'netmask' and
'type' in network spec.

Fixes: #38466

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 9b139baacb)
2018-04-14 21:58:49 +05:30
Alicia Cozine
30d338f664 Add details to see decrypted vault value (#37341) (#38746)
* Improves ansible-vault section of network getting started
(cherry picked from commit 521ea56e77)
2018-04-13 17:54:34 +01:00
Alicia Cozine
0fdfb27e0f corrects Junos network_cli example & variables (#38601) (#38705)
* corrects Junos network_cli example & variables

* vdacosta feedback, thanks
2018-04-13 16:43:42 +01:00
Abhijeet Kasurde
1de0515af9 nmcli: change default value of autoconnect (#38686)
There was discrepancy between documentation and actual code.

Fixes: #38671

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

(cherry picked from commit f1cd254265)
2018-04-13 11:28:39 -04:00
Alicia Cozine
e8469a5117
inaugural Network FAQ (#38359) (#38703)
(cherry picked from commit ea99cf3231)
2018-04-13 09:00:57 -05:00
Ganesh Nalawade
0143aa9416
Fix in eos get_config cliconf api (#38682) (#38720)
If format is passed as None to get_config api, wrong command is
genereted ie. `show running-configuration | None | section interface`.
Add format type in command only if format value is either not `text`
or  `None`.
(cherry picked from commit 88662d0c56)

Update changelog
2018-04-13 15:55:14 +05:30
Sviatoslav Sydorenko
fdcbcf313a Suppress a UserWarning about unknown dist option 2018-04-13 00:59:32 +02:00