Commit graph

20383 commits

Author SHA1 Message Date
Adrian Likins
a4785c2691 Fix docker connection plugin version tests and py2.6 compat (#16841)
* Rm py2.7+ code in docker connection plugin

The docker connection plugin was using subprocess.check_output
which only exists in python 2.7 and later. Connection plugins
need to support python2.6 so this replaces it with Popen/communicate()

* Handle docker ver errors in docker connection

Add unit tests for DockerConnection

Fixes #16971
2016-08-22 10:39:38 -04:00
Peter Sprygada
7ce4165671 Merge pull request #17173 from privateip/ios
minor update to the ios shared module
2016-08-22 10:35:27 -04:00
Peter Sprygada
301495ddcc Merge pull request #17172 from privateip/nxos
updates nxos shared module refactor
2016-08-22 10:35:17 -04:00
Brian Coca
54c530a3ee more ways to detect lxc
thanks to @wAmpire for new method and pointing out limitations of existing
2016-08-22 08:45:36 -04:00
Peter Sprygada
1015f11428 minor update to the ios shared module
This completes the refactor for the ios shared module to change
the derived class from NetCli to CliBase.
2016-08-21 08:59:59 -04:00
Peter Sprygada
4ab4b6698d updates nxos shared module refactor
This commit updates the nxos transport shared plugins for
2.2.  This includes updates to both Cli and Nxapi.  This commit
also includes the nxos_config action plugin
2016-08-21 08:57:49 -04:00
Peter Sprygada
321d2e8cee Merge pull request #17168 from privateip/clibase
replaces NetCli in network with CliBase in shell
2016-08-20 17:29:53 -04:00
Toshio Kuratomi
3833b21ab5 Update python3 docs for some of the recent decisions about porting (#17169) 2016-08-20 13:17:38 -07:00
Peter Sprygada
044a0533db replaces NetCli in network with CliBase in shell
This doesn't change any of the behavior but moves NetCli to CliBase and
relcates the object to the shell module
2016-08-20 13:55:07 -04:00
Toshio Kuratomi
d29a7c55fe Enable some basic.py tests on python3 (#17167) 2016-08-20 10:13:54 -07:00
Toshio Kuratomi
171a094805 Cleanup basic.py code now that six is available (#17158)
* Cleanup basic.py code now that six is available

We had some hacks in basic.py to allow us python2 and python3
compatibility.  Those can now be offloaded to the six library that we're
bundling.

* Cleanup basic.py code now that six is available

We had some hacks in basic.py to allow us python2 and python3
compatibility.  Those can now be offloaded to the six library that we're
bundling.
2016-08-20 08:08:59 -07:00
Peter Sprygada
959a5e5fd1 Merge pull request #17166 from privateip/ios
fix import statement in ios shared module
2016-08-20 09:30:06 -04:00
Peter Sprygada
388f98437e Merge pull request #17165 from privateip/network
fix broken import statement from netcli rename
2016-08-20 09:29:55 -04:00
Peter Sprygada
284e6cd365 Merge pull request #17164 from privateip/netcli
rename netcmd module to netcli
2016-08-20 09:29:41 -04:00
Peter Sprygada
53abcb23fa rename netcmd module to netcli
This is part of the 2.2 refactor to extract the Cli class into a
separate module.  This renames netcmd to netcli which is consistent
with the network shared modules implementations
2016-08-20 08:45:53 -04:00
Peter Sprygada
7cb2c31b1a fix import statement in ios shared module
This fixes the import statement when netcmd was renamed to netcli
2016-08-20 08:22:13 -04:00
Peter Sprygada
ac8b8f0b8b fix broken import statement from netcli rename
The network module needed to be updated with the correct module name
when netcmd was renamed to netcli
2016-08-20 08:19:08 -04:00
Peter Sprygada
152fb29337 Merge pull request #17163 from privateip/network
removes Cli and Config objects from network into separate modules
2016-08-20 08:16:56 -04:00
Peter Sprygada
f53dbec55a removes Cli and Config objects from network into separate modules
This completes the refactor of Cli and Config moving them into separate
modules netcmd and netcfg respectively.
2016-08-20 07:57:39 -04:00
Peter Sprygada
7cd682cc1a Merge pull request #17162 from privateip/ios
removes functions from ios module
2016-08-20 07:41:26 -04:00
Peter Sprygada
24c6443557 removes functions from ios module
This removes top level functions from the ios module and moves them
into the specific modules.  This update also includes some clean up
of the Cli transport
2016-08-20 07:27:47 -04:00
Peter Sprygada
90747e6d2f Merge pull request #17161 from privateip/netcmd
moves Cli and Command class from network to netcmd module
2016-08-20 07:25:08 -04:00
Peter Sprygada
7c928e878b moves Cli and Command class from network to netcmd module
This restructure moves the Cli object to netcmd and includes a roll up
of inor bugfix updates to CommandRunner

* CommandRunner now only allows one instance of a command in the stack and
  raise an exception if a duplidate command is detected
* CommandRunner now caches returns based on command and output
* CommandRunner is not responsible for creating Command instances
2016-08-20 06:57:13 -04:00
Adrian Likins
7d41f623dd Move py34 mock_open compat to compat/test/mock (#17157)
test/units/plugins/action/test_action.py had code
for handling a bug in python 3.4's mock_open that
causes errors when reading binary data.

Moved to compat/tests/mock.py so other tests can
use it by default.
2016-08-19 18:11:24 -04:00
scottb
235eab6609 Merge pull request #16316 from alikins/alikins_docsite_make
Fewer deps for 'make webdocs' from top level
2016-08-19 12:06:56 -07:00
scottb
5483528480 Merge pull request #16331 from coryfklein/devel
Add missing documentation about defaults/main.yml
2016-08-19 11:28:02 -07:00
Scott Butler
9abd20d49b Edited https://github.com/ansible/ansible/pull/17128 2016-08-19 11:22:21 -07:00
scottb
495589230b Merge pull request #17128 from bcoca/DONT
Thanks @bcoca; will merge and do some minor wordsmithing.
2016-08-19 11:14:40 -07:00
Matt Clay
04bd6a3619 Make tests more cross platform. (#17154) 2016-08-19 10:23:14 -07:00
Peter Sprygada
fa395bee7b Merge pull request #17149 from privateip/plugin-net-config
action plugin net_config will now remove any private result key
2016-08-19 11:48:00 -04:00
Peter Sprygada
0c7f5f5be5 Merge pull request #17150 from privateip/netcfg
pull Config object out of network and into netcfg
2016-08-19 11:33:36 -04:00
Peter Sprygada
d50ef4446f action plugin net_config will now remove any private result key
This update will now remove any keys from results that are created using
the private names.  Private names are identified as double underscore (__)
on either side of the key name
2016-08-19 11:15:36 -04:00
Peter Sprygada
112f14866a pull Config object out of network and into netcfg
This moves the Config class from network and into netcfg module with
no added features.  This is simply a reorganization of code.
2016-08-19 11:15:01 -04:00
jctanner
a0a2e1509e vmware_inventory script improvements (#17142)
* vmware_inventory script improvements
* switch instance finding method to use containerview based searches
* overhaul the serialization method for objects
* Cleanup the debug outputs
* Add a warning about performance
2016-08-19 10:40:22 -04:00
Dusty Mabe
b817f1f3ea actions/unarchive: fix unarchive from remote url (#17126)
* actions/unarchive: fix unarchive from remote url

Currently unarchive from remote url does not work because the core
unarchive module was updated to support 'remote_src' [1], but the
unarchive action plugin was not updated for this. This causes failures
because the action plugin assumes it needs to copy a file to the
remote server, but in the case of downloading a file from a remote
url a local file does not exist, so an error occurs when the file is
not found.

[1] https://github.com/ansible/ansible-modules-core/commit/467516e

* test_unarchive: fix test with wrong remote_src use

The non-ascii filenames test had improperly set remote_src=yes even
though it was actually copying the file from the local machine (i.e.
the file did not already exist remotely). This test was passing
until the remote_src behavior of unarchive was fixed in 276550f.
2016-08-19 08:16:21 -05:00
Alan Justino da Silva
c5b5a20031 [DOC FIX] Time Limited Background Operations topic styles (#17129)
The styles are leaking, by not closing the "coding" part on the right place
2016-08-18 15:45:59 -07:00
nitzmahone
4fbd17d949 py3 print fix 2016-08-18 14:37:52 -07:00
Josh Preston
2a2d866c0d add cloudforms inventory script (#17037)
* add cloudforms inventory script

based on the foreman inventory script, features:

* cached results (default 600 seconds)
* paginated host results (default 100 hosts)
* ssl verification (default True)
* arguments to flush cache and run in debug mode

* suggested rework

* removed second cache / dict with duplicate info
* added purge_actions configuration option to remove the actions from a host (defaults to False)
* added prefer_ip_address configuration option so give the option of using ip address instead of name (defaults to True)
* removed self variables — just use the arguments directly
* added --pretty command line option to pretty print results
* renamed _resolve_params to _resolve_host

* implement suggestions

* removed not used import
* added warnings to help debug connection issues
* renamed self.cache to self.hosts for clarity
* now will use the first ip address as ansible_ssh_host
* flipped default for prefer_ip_address config option to false - preserve name, and specify ansible_ssh_host as ip address
* added checks and warnings to configuration options, sane defaults for all except required:
** `url` - the first part of the cloudforms server url (https://cfme.example.com)
** `username`  - the cloudforms username to log in with
** `password` - the password for the cloudforms user specified
* removed redundant call to fetch host information (since we’re paging results, no need to split the calls)
* added warning for unexpected responses from CloudForms
* debug for returned sting now prints the string instead of forcing to JSON
* removed no longer needed methods to fetch host information
* using ‘key in list’ instead of ‘list.has_key(key)’
* correctly formatted groups and allowed nested groups
* now create groups for `location`, `type` and `vendor`, with appropriate sub-groups and children
* made to_safe honor config option to clean group names for ansible consumption

* remove prefer_ip_address configuration option

no longer needed since we will specify `ansible_ssh_host` as the returned ip address.

* removed dns_name

no longer needed, will preserve `host[name]` as name in Ansible.

* purge actions from hostvars

changed purge_actions to True

* flake8 suggestion for whitespace

* fix undefined r variable in warning output

use the correct ret variable

* Default purge_actions to True

We probably don’t need them, but it is configurable, so just default to remove them.

* Add configuration option to nest cloudforms tags

disabled by default, the nest_tags option will expand cloudforms tags into a nested group/subgroup structure.  Otherwise, it will use the whole tag name.

* added purging the actions

removed in previous clean up in error.

* fixed undefined variable

specified the correct variable for logging.
2016-08-18 14:37:31 -07:00
James Cammarata
890e096b2b Clean up PlaybookExecutor logic for batches and errors
The calculation for max_fail_percentage was moved into the linear
strategy a while back, and works better there in the stategy layer
rather than at the PBE layer. This patch removes it from the PBE layer
and tweaks the logic controlling whether or not the next batch is run.

Fixes #15954
2016-08-18 13:52:34 -05:00
John R Barker
677a34a191 Merge pull request #17140 from mattclay/roadmap
Updated progress on roadmap items.
2016-08-18 10:00:04 -07:00
Matt Clay
e1262fa49b Updated progress on roadmap items. 2016-08-18 09:55:59 -07:00
Toshio Kuratomi
cb3653295f Update submodule refs 2016-08-18 07:28:03 -07:00
Brian Coca
4fb09d5693 moved from extras repo where it incorrectly exists (#17124)
* moved from extras repo where it incorrectly exists

* added to sanity exclusion for 2.4

* changed license with author's consent
2016-08-18 09:47:21 -04:00
Toshio Kuratomi
bd31cc096a Fix facts.py for python3 (#17131)
* Fix facts.py for python3

* Update facts unittest to account for filepaths being byte strings
2016-08-18 09:36:03 -04:00
Peter Sprygada
9d29431661 Merge pull request #17114 from skg-net/Dell_Ansible_Roadmap
Added Dell Networking Modules to the Roadmap
2016-08-18 08:42:43 -04:00
Sandra Wills
63be666b53 Merge pull request #17119 from sam-at-github/patch-3
I think that is a better analogy.
2016-08-18 07:56:19 -04:00
Adrian Likins
7bd57acda4 Linux mount/fs (lsblk) facts fixes and tests. (#17036)
Fixes #10779

Refactor some of the block device, mount point, and
mtab/fstab facts collection for linux for better
performance on systems with lots of block devices.

Instead of invoking 'lsblk' for every entry in mtab,
invoke it once, then map the results to mtab entries.

Change the args used for invoking 'findmnt' since the
previous combination of args conflicts, so this would
always fail on some systems depending on version.

Add test cases for facts Hardware()/Network()/Virtual() classes
__new__ method and verify they create the proper subclass based
on the platform.system() results.

Split out all the 'invoke some command and grab it's output'
bits related to linux mount paths into their own methods so
it is easier to mock them in unit tests.

Fix the DragonFly* classes that did not defined a 'platform'
class attribute. This caused FreeBSD systems to potentially
get the DragonFly* subclasses incorrectly. In practice it
didnt matter much since the DragonFly* subclasses duplicated
the FreeBSD ones. Actual DragonFly systems would end up with
the generic Hardware() etc instead of the DragonFly* classes.

Fix Hardware.__new__() on PY3, passing args to __new__
would cause "object() takes no parameters" errors. So
check for PY3 and just call __new__ without the args

See
https://hg.python.org/cpython/file/44ed0cd3dc6d/Objects/typeobject.c#l2818
for some explaination.
2016-08-17 17:58:51 -07:00
nitzmahone
9fedcdfc47 bump extras submodule ref 2016-08-17 16:42:37 -07:00
nitzmahone
88c36bbc34 bump submodule refs 2016-08-17 15:52:26 -07:00
jctanner
14da357feb vmware inventory script enhancements (#17106)
* Allow the user to disable certificate verification
* Allow the user to find VMs only in specific clusters
2016-08-17 17:44:15 -04:00