Commit graph

20341 commits

Author SHA1 Message Date
Toshio Kuratomi
b8a8027b7d We've decided that python-3.5 is the minimum python version (#17270) 2016-08-29 09:12:37 -07:00
Toshio Kuratomi
fa804125b5 Python3 fixes and porting (#17271)
* Fix to_native call in selinux_context and selinux_default_context to
  use the error handler correctly.
* Port set_mode_if_different to work on python3
* Port atomic_move to work on python3
* Fix check_password_prompt variable which wasn't renamed properly
2016-08-29 09:11:40 -07:00
Peter Sprygada
c16f34bf8e Merge pull request #17279 from privateip/shell
catches timeout error when connecting to remote host in shell
2016-08-29 08:47:48 -04:00
Peter Sprygada
2179677294 Merge pull request #17278 from privateip/nxos
changes nxos method for passing kwargs to get_config()
2016-08-29 08:47:33 -04:00
Peter Sprygada
f5df946e6e Merge pull request #17277 from privateip/eos
fixes two bugs in the eos shared module
2016-08-29 08:47:13 -04:00
Peter Sprygada
820260b22d catches timeout error when connecting to remote host in shell
This will now catch a timeout error when shell attempts to open the
connection to the remove device and gracefully raise it as a ShellError
2016-08-28 23:03:46 -04:00
Peter Sprygada
2cb2ba1fe6 changes nxos method for passing kwargs to get_config()
This change makes both the Cli and Nxapi objects handle the get_config()
method consistently the same
2016-08-28 23:02:36 -04:00
Peter Sprygada
5ce032bf6d fixes two bugs in the eos shared module
* fixes issue with correctly returning the running-config over eapi when a
  call was made to get_config()
* fixes issue the MRO in Cli transport
2016-08-28 22:58:52 -04:00
Abhijit Menon-Sen
a9d5bf717c Merge pull request #17272 from PeterMartini/typo-fix
Simple documentation typo fix, 'iIf' to 'If'
2016-08-27 18:23:00 +05:30
Tobias Rüetschi
457cf49868 univention: add common code for univention corporate server modules (#16172)
* univention: add common code for univention corporate server modules

* univention: try import only univention specific libraries

* Code Review with @2-B, slight API changes and refactoring.

* Added module documentation overview, describing the provided functions
* Moved module-global objects into getter functions, so that we don't
  need to import possibly-unavailable univention modules at the module level.
* Renamed some exports for improved consistency:

  - module_name()    -> module_by_name()
  - orig_ldap        -> ldap_module()
  - ldap             -> uldap()

Note that this introduces slight API changes from the outside. Instead of
directly accessing module properties, you now have module functions with the
same name. Examples:

   - ansible.module_utils.univention.position_base_dn()
   - ansible.module_utils.univention.config_registry()
   - ansible.module_utils.univention.base_dn()
   - ansible.module_utils.univention.config()

* module_utils univention: fix library

* move module_utils from univention to univention_umc, because python import univention fails if library is called univention

* univention_umc: fix intention

* univention: change common code to BSD-2-clause
2016-08-27 09:42:53 +02:00
Peter Martini
15f10ab4bc Simple documentation typo fix, 'iIf' to 'If' 2016-08-26 22:52:12 -04:00
Brian Coca
4e6a7a9e01 allow include_role to specify vars/defaults files 2016-08-26 21:54:59 -04:00
Peter Sprygada
4b679ffd84 Merge pull request #17265 from privateip/iosxr
fixes iosxr configure method to commit the changes
2016-08-26 16:18:01 -04:00
Brian Coca
f25ec5adb3 fix action parsing to avoid conflicts agin 2016-08-26 16:15:55 -04:00
Peter Sprygada
bb630f52ff fixes iosxr configure method to commit the changes
The iosxr configure method did not send the commit command to active the
changes after pushed to the remote device.  This change address that problem
2016-08-26 15:58:06 -04:00
Peter Sprygada
e4b0690ef3 Merge pull request #17264 from privateip/iosxr
disable prompt timestamps upon successful connection to iosxr
2016-08-26 15:27:15 -04:00
Peter Sprygada
be55bd6cdf disable prompt timestamps upon successful connection to iosxr 2016-08-26 15:09:02 -04:00
Peter Sprygada
66825f094d Merge pull request #17262 from privateip/iosxr
add commit keyword arg to load_config method
2016-08-26 14:26:41 -04:00
Brian Coca
c755ae6a1d updated sub refs 2016-08-26 14:12:15 -04:00
Brian Coca
bd9094c925 include_role (role revamp implementation) (#17232)
* attempt #11 to role_include

* fixes from jimi-c

* do not override load_data, move all to load

* removed debugging

* implemented tasks_from parameter, must break cache

* fixed issue with cache and tasks_from

* make resolution of from_tasks prioritize literal

* avoid role dependency dedupe when include_role

* fixed role deps and handlers are now loaded

* simplified code, enabled k=v parsing

used example from jimi-c

* load role defaults for task when include_role

* fixed issue with from_Tasks overriding all subdirs

* corrected priority order of main candidates

* made tasks_from a more generic interface to roles

* fix block inheritance and handler order

* allow vars: clause into included role

* pull vars already processed vs from raw data

* fix from jimi-c blocks i broke

* added back append for dynamic includes

* only allow for basename in from parameter

* fix for docs when no default

* fixed notes

* added include_role to changelog
2016-08-26 13:42:13 -04:00
Peter Sprygada
eac7caefd8 add commit keyword arg to load_config method
this adds a new keyword arg to the load_config method that will control
whether or not a loaded configuration is committed on the device
2016-08-26 13:16:18 -04:00
Michael Scherer
a30f545a62 Do not convert Nonetype to "None" (#17261)
If someone use a task with a empty name like this:

  - name:
    command: true

This will result in displaying 'None' as a task name instead of
'command'.
2016-08-26 09:48:27 -07:00
Brian Coca
1139d61d59 simplified logic paths 2016-08-26 11:39:12 -04:00
Patrik Lundin
b4f338bca7 Add OpenBSD virtualization facts. (#17227)
* Add OpenBSD virtualization facts.

Patch written by @jasperla.

Tested by various people on:
- virtualbox
- vmware esx(i) + fusion
- kvm (smartos + plain linux + a random cloud provider)

This patch is already present in the OpenBSD port of ansible.

* Rework diff to get rid of extra returns.

Requested by @bcoca.

While here, use four-space indentations of all code blocks.

* Set facts even if no match is found.

Discussed with @bcoca.

* Find sysctl via get_bin_path().

Requested by @bcoca.

* Fail if we do not find a sysctl binary.

* Do not fail if a sysctl binary is not found.

Just set empty fact values instead.
Requested by @bcoca.
2016-08-26 11:27:41 -04:00
Abhijit Menon-Sen
b4a035718e Make _display_plugin_load much less noisy
There was general consensus that displaying every plugin load on -vvv
was *way* too noisy. This commit reformats the log message to be less
verbose, and drops it down to debugging-only level.
2016-08-26 20:28:58 +05:30
Alexander Stock
238cccf166 Fix "Text file busy" exception in atomic_move (#9526) (#17204)
tempfile.NamedTemporaryFile keeps a file handle causing os.rename() to fail with windows based vboxfs: [Errno 26] Text file busy.
Changed NamedTemporaryFile to mkstemp() and added a finally block to unlink the temp file in each and every case.
2016-08-26 07:41:17 -07:00
Michael Scherer
a942758a07 Fix wrong error class (#17259)
AnsibleError is not imported in that file, and since that's
a parsing time issue, better raise AnsibleParserError like the
rest of the file.

Issue signaled on irc by gordon`
2016-08-26 08:53:28 -04:00
Toshio Kuratomi
4a3a9c0f2d Fix for run_command on py3 and enable lineinfile test on py3 (#17257)
* run_command needed a bit of tweaking to its string handling of
  arguments.
* The run_command change fixes the last bit of lineinfile so we can
  enable its tests
2016-08-26 01:30:46 -07:00
Toshio Kuratomi
9ac20e231d Update core submodule to pull in lineinfile py3 fix 2016-08-26 01:07:00 -07:00
Toshio Kuratomi
f57f33a8e7 Fix fetch idempotence (#17255)
Fetch always follows symlinks when downloading so it needs to always
follow symlinks when getting the checksum of the file as well.
2016-08-25 21:45:38 -07:00
Peter Sprygada
fb9b98a543 Merge pull request #17254 from privateip/netcli
adds new property command_string to Command object
2016-08-25 22:51:02 -04:00
Peter Sprygada
09f3c3d074 Merge pull request #17253 from privateip/nxos
implements command_string property when preparing commands
2016-08-25 22:23:56 -04:00
Peter Sprygada
9f1ac47f70 adds new property command_string to Command object
This adds a new property to the Command object that is used to hold
modified command strings that could be different from the command used
to create the object.  This allows for seamless switch between text and
json enabled commands.
2016-08-25 22:11:37 -04:00
Peter Sprygada
5036bba2e0 implements command_string property when preparing commands
* commands that need | json added now use command_string property
* adds additonal keyword args in exception handling for json commands
2016-08-25 22:11:23 -04:00
James Cammarata
e375bfd6a5 Use post_validated play for serial calculations in TQM
Fixes #17185
2016-08-25 17:50:22 -05:00
Toshio Kuratomi
0a39700b36 Fix octal output in a few more places (#17250)
Fix filetree lookup plugin for python3 (octal output and selinux API
takes native strings)
2016-08-25 14:58:35 -07:00
John R Barker
35a3653dfc Merge pull request #17248 from abadger/facts-module-dev-docs
Couple things to watch out for when reviewing facts modules
2016-08-25 19:50:08 +01:00
Toshio Kuratomi
7e71299ee1 Couple things to watch out for when reviewing facts modules 2016-08-25 11:37:57 -07:00
Toshio Kuratomi
2dd5e13098 Update submodule refs 2016-08-25 11:04:26 -07:00
Toshio Kuratomi
bd68c324ce Get the ssh plugin working with python3 (#17234) 2016-08-25 10:57:55 -07:00
Chris Faulkner
dbab23e68f Fix context_demo callback plugin. (#17235) 2016-08-25 10:22:27 -07:00
Yann Autissier
8fd3935029 Fix get_distribution for Alpine Linux (#17224)
To override a generic class that is subclassed based on platform, the
subclass must define platform and distribution.

The load_platform_subclass() calls the get_platform() and
get_distribution() methods to detect the platform and the distribution.

On Alpine Linux, get_distribution() method returns None and it is not
possible to have different implementations based on detected platform.
2016-08-25 10:18:42 -07:00
Abhijit Menon-Sen
3ab9dddb3a Make the extract filter return Undefined on KeyError
groups['x']|map('extract', hostvars, 'somevar') would break if any host
didn't have 'somevar' set. With this change, it will return Undefined
instead. This change permits |map('extract', …)|map('default', 42) to
set a default value in such cases.
2016-08-25 22:45:20 +05:30
Tim Whittington
2b3a22fdba Document when clause list of conditions (#17206)
The 'when' clause supports a list of conditions, applying a logical 'and' to the conditions (i.e. requiring all of them to be true).

This can be useful for legibility sometimes, allowing distinct conditions to be listed on separate lines.
2016-08-25 09:52:52 -07:00
Tom
d29e9d7d3c Update command for generating password (#17170)
The option to generate a password is --method=sha-512 instead of --method=SHA-512 which produces a hash not found error
2016-08-25 09:43:28 -07:00
Matt Clay
dd51ddb844 Updated progress on Python 3 CI and test coverage. (#17245) 2016-08-25 09:24:42 -07:00
Peter Sprygada
bed1822b17 Merge pull request #17244 from privateip/sros
initial add of shared modules for supporting Nokia SROS devices
2016-08-25 12:13:52 -04:00
Peter Sprygada
24e8e3b03f initial add of shared modules for supporting Nokia SROS devices
This adds a cli transport, netcfg, and netcli implementations for working
with devices running Nokia SROS.  There is also an update to netcfg
to support the sros config file format.
2016-08-25 11:47:00 -04:00
Matt Clay
178292d2cd Fix file and copy modules on py3 and enable tests. (#17239)
- Fix octal formatting of file mode in module response on py3.
- Convert file path to unicode in copy action.
- Enable file and copy module tests for py3 now that they pass.
2016-08-25 07:44:31 -07:00
Toshio Kuratomi
44d979c8f5 Enable most unittests on python3 (just some vault unittests and a logging one left) (#17240)
Make some python3 fixes to make the unittests pass:

* galaxy imports
* dictionary iteration in role requirements
* swap_stdout helper for unittests
* Normalize to text string in a facts.py function
2016-08-25 07:30:03 -07:00