Commit graph

18244 commits

Author SHA1 Message Date
Serge Nikalaichyk
dc8aedb274 Fix OS version check in win_power_plan (#30538)
* Fixed win_power_plan OS version check

* Original error message case
2017-09-22 06:23:02 +10:00
Jordan Borean
fb628acb6e win_domain_membership: added better error handling and basic tests (#30674) 2017-09-22 05:59:42 +10:00
Jordan Borean
59187358ee win_scheduled_task_stat: add new module to get stat on scheduled tasks (#30602)
* win_scheduled_task_stat: add new module to get stat on scheduled tasks

* fixed up linting errors and aliases file

* I should learn how to spell

* removing URI from test

* added state information for the task

* removed argument so task stays running
2017-09-22 05:59:06 +10:00
Dag Wieers
13bc5314ce win_shortcut: Add hotkeys examples to documentation (#30694)
This fixes #29110
2017-09-22 05:37:15 +10:00
Martin Krizek
cca4f94736 Mention all yum list options in docs (#30706) 2017-09-21 19:11:53 +02:00
Jiri Tyr
962528f511 Make clear the file must not contain .repo (fixes #30644) (#30656) 2017-09-21 19:11:07 +02:00
Reid Wahl
a22d7513a7 Remove invalid e.response from BotoCoreErrors in ec2_asg.py (#30121) (#30495) 2017-09-21 13:10:05 -04:00
Toshio Kuratomi
46e5c48f03 Split ec2_elb_* modules in service of rename/interface changes (#30532)
* Undeprecate ec2_elb_*
* Make ec2_elb* full fledged modules rather than aliases
* Split tests for ec2_elb_lb and elb_classicb_lb
* Change names in documentation of old and new elb modules

Add tests for ec2_elb_lb
2017-09-21 13:06:14 -04:00
Brian Coca
236d13ac3a become flags are primary
with new configuration the sudo flags are always set and become cannot override,
switching to simle 'or' will result in become_flags working.

also sudo_flags are deprecated.
also changed from YAML null causing a 'None' str

fixes #30629
2017-09-21 10:00:52 -04:00
Tim Rupp
0eb0d96286 Adds module which allows users to manage partitions on a BIG-IP (#30577) 2017-09-21 14:48:51 +01:00
David Mahler
05ec0c9b8d Minor typo on deprecation warning (#30615) 2017-09-21 15:33:23 +05:30
Dag Wieers
2392934f48 More PEP8 fixes
Not sure why it missed those.
2017-09-21 05:16:49 +02:00
Dag Wieers
63c6afeaee Fix PEP8 issue 2017-09-21 05:07:49 +02:00
Dag Wieers
57b85198fe Add support for loop-tasks and improved output
This PR includes:
- Support for loop-tasks with proper subject/error content
- Improved output (and proper indentation)
- Complex data structures are now pretty printed
- Better selection of mail subject
2017-09-21 04:54:26 +02:00
Toshio Kuratomi
72bdf7aa7e Fix python3 and nonascii handling in inventory plugins
Fixes #30663
2017-09-20 19:39:15 -07:00
Brian Coca
f12c6e0946 moved from eval to templating + literal_eval 2017-09-20 21:35:02 -04:00
Dag Wieers
31e7d735a3 win_environment: Make this the Windows reference module
As discussed before we selected win_environment to the documentation,
and point to win_uri for a more advanced module.

If we want to make this the reference module, we have to get this one
absolutely right in every possible way.

This PR cleans up both win_environment and win_uri, and makes the
required changes to the windows module development section.
2017-09-21 03:20:17 +02:00
Brian Coca
9f4d73b699 fixed credstash docs 2017-09-20 20:52:52 -04:00
Hervé Beraud
b8e21bca46 [fix] sanity check errors on pylint 2017-09-20 17:38:55 -07:00
Reid Wahl
5f90169d73 modules/system/user.py: Change createhome to create_home (#30179) 2017-09-20 17:34:49 -07:00
Dag Wieers
f5dded59c2 mail: Fix charset encoding issue
This PR includes:
- An important fix to charset encoding of from address
- Documentation and examples cleanup
- PEP8 fixes
- Warning on insecure access
- Strict parameter typing
- More modern interface (using lists rather than comma, space or pipe-delimited strings)
- Warn on failure to send mail to some recipients
  ```
   [WARNING]: Failed to send mail to 'foobar': 550 5.1.1 <foobar>:
Recipient address rejected: User unknown in local recipient table
  ```
- Warn on failure to parse some headers
  ```
  [WARNING]: Skipping header 'Foobar', unable to parse
  ```
- Return failed recipients as return value
- Changed default encoding to utf-8
2017-09-21 01:07:53 +02:00
Brian Coca
c3ba579f6b constants as tuples instead of lists/sets 2017-09-20 16:57:45 -04:00
Will Thames
685267df73 Improve error handling for IdempotentParamaterMismatch (#30324)
Ensure all the return variables are correctly populated
and return more info in the error message
2017-09-20 16:42:13 -04:00
Brian Coca
d3e85bd045 dont override previous ini entries with defaults
corrected setting example, quotes mess up the regex
fixes #30633
2017-09-20 16:38:11 -04:00
Brian Coca
131d417c7a made callbacks backwards compatible (#30625)
* made callbacks backwards compatible

This fixes #30597 for those that were not inheriting from base.

Added deprecation notice so those callbacks get updated.

Callback must either inherit from base (directly or indirectly),
which already implements this or implement set_options themselves.

* added note about porting guide
2017-09-20 15:20:19 -04:00
Vladimir Utenkov
875153d503 [cloud][py3] Fix AttributeError in iam_policy on python3 (#30551) 2017-09-20 15:14:09 -04:00
Will Thames
d871964aca Ensure region is set in ec2_vpc_subnet_facts (#30399)
Make requested change in #30370
2017-09-20 11:23:48 -04:00
Adrian Likins
174cb1f33c Check number of vault secrets after setup. (#30520)
This is to catch vault secrets from config and
cli. Previously vault_password_file in config was
missed since it was added by setup_vault_secrets,
so check after setup_vault_secrets.
2017-09-20 10:31:36 -04:00
Will Thames
18582295e3 Fix broken LimitExceeded check in iam_managed_policy (#30537)
When policy versions exceed 5, we hit LimitExceeded. However,
the exception checking should use `e.response['Error']['Code']`
2017-09-20 09:27:45 -04:00
Patrick Ogenstad
d74c871559 Restore correct coloring to selective callback (#30528)
* Restore correct coloring to selective callback

This fixes the bug raised in #30506

* Fix format issues for Python 2.6 & indent

Removed the zero length fields to support format under Python 2.6

Fixed E128 continuation line under-indented for visual indent issue
2017-09-20 09:14:59 -04:00
dteach
ca56a248d8 junos_facts: Add Hardware facts. (#30304)
* Add Routing Engine Facts

 - Map routing engine output information to routing_engines facts dict.
 - Add fact 'has_2RE', which is a quick way to determine how many REs
   the chassis has.

* Fix a typo

* Fix more typos

* Add slot number to routing_engine dict

* Add facts about the installed chassis modules

* Fix typo

* Fixed another typo

* Fix Path

* Change path again.

* More Typos

* Add some deubgging

* Add additional information for hardware components.

 - Return information about the Routing Engines.
 - Return a fact to easily determine if the device
   has two routing engines.
 - Return information about the hardware modules.

* Addressed pep8 stardard failures.

* Add unit test fixtures.

* Rename fixture.

* Fix unit test failures.

 - Rename the fixture file to what the unit test expects.
 - Strip out junos namespace attributes.
Rename file to match what the unit test expects.

* Scrubbed the routing engine serial numbers.

* Add unit test facts for new tests.

 - Add unit test for ansible_net_routing_engines fact
 - Add unit test for ansible_net_modules fact
 - Add unit test for ansible_net_has_2RE

* Fixed spacing.
2017-09-20 12:43:07 +05:30
David Mahler
d395166ae0 Vyos correction (#30605) 2017-09-20 11:57:18 +05:30
Laurent Coustet
17995f0e48 Remove unused variable in git module. (#28464) 2017-09-20 02:24:03 -04:00
Jordan Borean
a940eb1e80 CamelConverter - more fixes picked up in testing (#30601) 2017-09-20 15:17:26 +10:00
Willem van Ketwich
92426840d6 fix for unrequired parameter 2017-09-19 21:37:42 -07:00
Trishna Guha
ae044f507f fix nxos_reboot command format (#30549)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-09-20 10:06:57 +05:30
Trishna Guha
e308176f3e fix write_on_file nxos_snapshot (#30545)
* fix write_on_file nxos_snapshot

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

* some more logic

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-09-20 10:06:38 +05:30
s-hertel
b3273223db Previously to use the modes put or get the object had to be specified with a leading /. Since the boto call doesn't take an object like that this was overlooked and removed. Added a check to remove that leading character. 2017-09-19 21:21:02 -07:00
Jordan Borean
1ea0293878 CamelConversion: fix to not convert string values (#30595) 2017-09-20 13:03:45 +10:00
Jordan Borean
838f39e76a win_scheduled_task: rewrite (#28995)
* win_scheduled_task: rewrite for additionality functionality and bug fixes

* fixes for docs and os version differences

* started with the testing

* doc fix

* added more tests

* added principals tests

* finished tests for win_scheduled_task rewrite

* feedback from PR

* change to fail when both new and deprecated args are set

* change diff variable to match new standard and update doc sentance
2017-09-20 10:28:03 +10:00
Will Thames
31daeb4b85 New module for querying ACM certificates (#29430)
Not using AnsibleAWSModule so that it can be dropped into
a module library of Ansible 2.3
2017-09-19 19:10:39 -04:00
Martin Krizek
32d6b1d0e0 user: fix default non-system user's shell on macOS 2017-09-19 18:11:22 -04:00
Adrian Likins
307be59092 Don't ask for password confirm on 'ansible-vault edit' (#30514)
* Don't ask for password confirm on 'ansible-vault edit'

This is to match the 2.3 behavior on:

        ansible-vault edit encrypted_file.yml

Previously, the above command would consider that a 'new password'
scenario and prompt accordingly, ie:

        $ ansible-vault edit encrypted_file.yml
        New Password:
        Confirm New Password:

The bug was cause by 'create_new_password' being used for
'edit' action. This also causes the previous implicit 'auto prompt'
to get triggered and prompt the user.

Fix is to make auto prompt explicit in the calling code to handle
the 'edit' case where we want to auto prompt but we do not want
to request a password confirm.

Fixes #30491
2017-09-19 17:39:51 -04:00
Brian Coca
71cc906ec8 fixed password lookup docs 2017-09-19 16:33:15 -04:00
Chrrrles Paul
e3ef80f5d6 oc module- Fixing description & removing example command (#30257)
* Fixing description & removing oc/adm example

Noticed formatting errors on http://docs.ansible.com/ansible/latest/oc_module.html -- also removing oc/oadm command examples

* Trailing whitespace..
2017-09-19 15:09:22 -04:00
Brian Coca
b9120dfd97 fixed decreption
(cherry picked from commit 1cee81375386a7f3ac3d1893342b9323983f00c9)
2017-09-19 11:43:36 -04:00
Brian Coca
24d4787b2d Lookup docs (#30280)
* finalize lookup documentation
* minor fixes to ansible-doc
 - actually show which file caused error on when listing plugins
 - removed redundant display of type and name
* smart quote fixes from toshio
2017-09-19 10:49:07 -04:00
Dag Wieers
2ef8c5a03d Fix typo
And also clean up Copyright/License statements when we're at it.
2017-09-19 16:10:21 +02:00
Joel Diaz
6c7d46a9e3 add default role of 'prometheus_alerts' for alerts (#29111)
Currently, MIQ only supports an alert type of 'prometheus', so rather than have the caller of manageiq_provider pass this info, just set it as the default.
2017-09-19 09:32:59 -04:00
Joel Diaz
79d034b088 update miq compare_user group comparison (#29063)
When calling manageiq_user to an already existing user (but leaving out the password so that it doesn't automatically 're-create' the user), the module fails with:

fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Shared connection to 127.0.0.1 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_Fr7Nt3/ansible_module_manageiq_user.py\", line 324, in <module>\r\n    main()\r\n  File \"/tmp/ansible_Fr7Nt3/ansible_module_manageiq_user.py\", line 315, in main\r\n    res_args = manageiq_user.edit_user(user, name, group, password, email)\r\n  File \"/tmp/ansible_Fr7Nt3/ansible_module_manageiq_user.py\", line 229, in edit_user\r\n    if self.compare_user(user, name, group_id, password, email):\r\n  File \"/tmp/ansible_Fr7Nt3/ansible_module_manageiq_user.py\", line 189, in compare_user\r\n    (group_id and user['group']['id'] != group_id)\r\nKeyError: 'group'\r\n", "msg": "MODULE FAILURE", "rc": 0}

The 'group' field turns out to be 'current_group_id' (at least with ManageIQ 4.6). Update the comparison accordingly.
2017-09-19 09:10:21 -04:00
Joel Diaz
99f6f0ccc2 add 'update_password' param to manageiq_user (#29093)
* add 'update_password' param to manageiq_user

Currently with the manageiq_user module, if you call it repeatedly while passing the 'password' parameter, it will always run the task and mark it as 'changed'.

Following the pattern of the AWS IAM module, add an 'update_password' parameter that takes 'always' (default) or 'on_create'. This will let you set an initial password when creating a user, but allow the user to modify their password and not stomp over their password changes if you re-run the playbook/task that created the user.

* don't stomp password when other fields change

Handle case where user fields change, but we don't want to stomp on a potentially user-changed password. Previously, if a non-password field changed, and the password param was passed in, it would ignore the 'update_password': 'on_create' setting (ie it would update/modify the password even if the user already exists).

Add trailing ',' to list of params.
2017-09-19 09:10:12 -04:00
Ondra Machacek
0aebdb4aca ovirt_vms: Fix the logout condition (#30410) 2017-09-19 08:27:09 +02:00
Matt Clay
7714dcd04e Enable more pylint rules and fix reported issues. (#30539)
* Enable pylint unreachable test.
* Enable pylint suppressed-message test.
* Enable pylint redundant-unittest-assert test.
* Enable pylint bad-open-mode test.
* Enable pylint signature-differs test.
* Enable pylint unnecessary-pass test.
* Enable pylint unnecessary-lambda test.
* Enable pylint raising-bad-type test.
* Enable pylint logging-not-lazy test.
* Enable pylint logging-format-interpolation test.
* Enable pylint useless-else-on-loop test.
2017-09-18 23:20:32 -07:00
Jordan Borean
01563ccd5d windows: fix list type in legacy module utils (#30483)
* windows: fix list type in legacy module utils

* only change the return for the list type instead of affecting it all

* additional null check when using an array
2017-09-18 21:18:52 -07:00
jctanner
5aebcd4f7f Remove redundant check for group membership in add_host (#30530) 2017-09-18 20:22:30 -04:00
Wolfgang Felbermeier
f3865e370c Fix tags in ec2_instance_facts (#30333)
* Fix tags in ec2_instance_facts
The method boto3_tag_list_to_ansible_dict in module_utils/ec2.py changed
and does no longer check whether the returned result of boto3 uses
"key" or "Key" as the tag key identifier.
This fixes ec2_instance_facts to make this check in its own, since boto3
may return "key" instead of "Key"

* Since the indices for the tags are already formatted to lowercase
by the snaking, we can assume, that the index for the tags are already
formatted
2017-09-19 10:09:56 +10:00
Toshio Kuratomi
c82cf791dd Add a code-smell test for smart quotes and remove smart quotes from all files 2017-09-18 16:49:16 -07:00
Shinichi TAMURA
934ae28365 Timezone modeule: Better env choice for Linux (#28229)
* timezone module: fixed platform decision rule for Linux
— For better handling of environments where timedatectl is unavailable

* timezone module: allow absence of configuration files if specific commands are available

* timezone module: remove duplicated line

* timezone module: fixed docs to clarify returned diff

* timezone module: fixed “undefined variable err”

* Revert "timezone module: fixed docs to clarify returned diff"

This reverts commit 4b783227f7.

* timezone module: revert platform decision rule; just warn instead of futher command checks

* timezone module: [NosystemdTimezone] enhanced error message
2017-09-18 19:04:58 -04:00
Dag Wieers
229a86c952 win_file: Fix check-mode issue removing dirs (#30475)
This fixed #30442
2017-09-19 06:43:49 +10:00
Scott Buchanan
4617be3085 clarify documentation of import_role 2017-09-18 16:17:58 -04:00
Brian Coca
314e6d0d8a start of 'is chroot' fact
probably missing cornercases for some linux/bsd setups and other OSs
2017-09-18 16:16:41 -04:00
hiddenicon
33b8d7069f Add _ and . to regex (#30396)
Adding underscore and period to the nxos regex for determining the prompt for hostnames with underscores and periods in the hostname.
2017-09-18 14:59:11 +05:30
Toshio Kuratomi
47d303e255 Update the bundled six library to 1.11.0 2017-09-17 22:00:02 -07:00
Brian Coca
6e857468a2 expose soem options as vars (#30379)
* expose some useful options as vars for plays and plugins
2017-09-17 12:25:56 -04:00
Miouge1
96ebfd78af os_image: Add checksum based glance image manipulation (#27107)
* Add checksum based glance image manipulation

* Update os_image.py

* Move to 2.5
2017-09-17 15:19:58 +02:00
Brian Coca
ae29245e05 decelerate! (#30160)
removed accelerate code
removed keyczar dep for accelerate
2017-09-16 23:35:50 -04:00
Anil Kumar Muraleedharan
1921eaf096 Resolving bug on CNOS Image download on multiple devices. 2017-09-16 10:53:21 -07:00
Marko Stanković
85649876d0 Add a note about the limitations of a namespace check 2017-09-16 17:37:12 +02:00
Marko Stanković
16ca412bd7 xml module: Improve error message for missing namespaces 2017-09-16 17:37:12 +02:00
Matt Davis
0e70057f56 CommandUtil C# API tweaks (#30453)
* changed RunCommand result from Tuple to CommandResult for easier future extensibility
* moved Win32 Dictionary->multi-null-string environment munging into C#
2017-09-15 23:09:15 -07:00
Matt Davis
c12c7a72ed Various fixes to azure_rm_virtualmachine for managed disks and allocated. (#30450)
* fixes #30194
* fixes #30193
* fixes #29662
* fixes #28859
2017-09-15 20:55:23 -07:00
Matt Davis
6b5b465125 azure_rm_dnsrecordset rewrite (#30449)
As-merged, had several issues that prevented idempotent usage. Some args were defined at the wrong UI level. Dual-state args didn't match up with typical Ansible UI.
2017-09-15 18:12:46 -07:00
Matt Clay
61dd5517c3 Fix PEP 8 issue. 2017-09-15 14:44:21 -07:00
Brian Coca
8799038a89 deprecated include
added docs for new actions that take over include duties
2017-09-15 13:20:32 -07:00
Brian Coca
fc9b44e021 clear correct cache when reconcile is invoked
moved it to ensure all callers get the correct hosts after
2017-09-15 12:58:40 -07:00
Nathaniel Case
7dc60c3f24 nxos_install_os install_state fix 2017-09-15 15:34:32 -04:00
Matt Clay
4ce13e983a Command module bug fix, tests and cleanup. (#30432)
* Add more command integration tests.
* Remove unnecessary command test debug tasks.
* Fix traceback in command module for empty args.
* Remove unreachable code.
2017-09-15 11:57:50 -07:00
René Moser
f128796782 cs_volume: fix CloudStackException dependency (#30389)
fixes pep8
2017-09-15 20:40:28 +02:00
Kedar K
ff84fc969c Fixes nxos_pim_rp_address module idempotence (#29620)
* Fixes nxos_pim_rp_address module idempotence

*  * Adds a note in header comment to indicate no support for absent state
2017-09-15 14:21:34 -04:00
Brian Coca
81fd67c10f fixed issue with default callback inheritance (#30427)
* fixed issue with default callback inheritance

 - callbacks need to document same options as callbacks they inherit from to get them configured
 - since default is also used by many 3rd party callbacks for inheritance, making the code 'tolerate' the missing docs
   and fallback to using the direct constant to configure it's options.
2017-09-15 11:14:47 -07:00
Nathaniel Case
5d404af76e Raise an error if ansible_network_os is not specified (#30429) 2017-09-15 13:56:05 -04:00
Brian Coca
f87d0b3502 typo fix 2017-09-15 13:13:41 -04:00
Ganesh Nalawade
11310b8c4a Update removed_in_version to 2.9 for network module top level cred args (#30416)
* Update removed_in_version to 2.9 for network module top level credential args

* Add documentation
2017-09-15 21:20:07 +05:30
Moshe Shitrit
7da69a23e6 Added nopackages option and Fix #24997 (#28831)
* Added nopackages option and Fix #24997
Adding a new option - nopackages.
This enables the option to add the --nopackages flag while registering a new node to RHN Satellite. We are not uploading the rpm data on our nodes and since we started utilizing ansible for nodes registration, I figures it would be useful for others as well.
Also-
Fixes #24997 (verified in my lab)

* Fixed documentation

* Documentation changes:
- typo fix in "default"
- Added "version_added" and set to 2.4

* Documentation changes:
- Removed trailing whitespaces in nopackages['version_added']

* This change is unrelated for this feature pull request and shouldn't be here (and also seems wrong, see #25079).

* Changed "version_added" to 2.5 in the module docs
2017-09-15 10:50:47 -04:00
Mike Wiebe
9af6dc4751 Fix nxos_snmp_community idempotence issue (#30388)
* Fix nxos_snmp_community idempotence issue

* Use passed in name to filter

* Test updates and remove unused method
2017-09-15 07:45:51 -07:00
Abhijit Menon-Sen
0addd53926 Don't expect (postgres) SERVER_VERSION to be M.N (#30417)
It could be something like '10beta4', which StrictVersion() would
reject. When Postgres 10 is released, it will be '10', which
StrictVersion() would STILL reject.

Fortunately, psycopg2 has a 'server_version' connection attribute that
is guaranteed to be an integer like 90605 for version 9.6.5, or 100000
for version 10. We can safely use this for version-specific code.
2017-09-15 18:03:06 +05:30
KrdLab
a6c8978b74 Fix RETURN section document in lambda.py (#28333)
* Fix RETURN section document in lambda.py

* Fix typo
2017-09-15 05:08:15 -04:00
Sloane Hertel
bdbe5337c6 s3 integration tests (#28396)
* Replace pause in integration tests with until.

Use resource prefix instead of generating a random number

Only try to delete keys if they exist

* Add alias to tests
2017-09-15 05:08:09 -04:00
KrdLab
e0a5b7d7ea Fix RETURN section document in iam_role.py (#28430) 2017-09-15 04:21:27 -04:00
Stepan Stipl
4ec91491e2 Pass region and ec2_url to boto3 connection (#30370)
fixes ansible/ansible#30368
2017-09-15 13:54:29 +10:00
Brian Coca
f8005d2737 fix git wrapper (#29069)
* fix git wrapper

* fallback to bin/sh

* Use percent formatting as per sivel's review
2017-09-14 23:27:55 -04:00
James Cammarata
cd2774af78 Fixing two bugs with import_role (#30398)
1) import_role was never resulting in a static inclusion of the role
   tasks due to a logic error.
2) no error was raised when import_role tried to use a with loop, resulting
   in a strange error down the execution path.
2017-09-14 22:04:20 -05:00
Brian Coca
c027ad943e remove dupe deprecation on config (#30364)
* remove dupe deprecation on config

also move failed typing to same place to use 'standard' display vs hack.
2017-09-14 16:56:52 -04:00
James Cammarata
6730f81024 Correctly create include_role blocks when using loops (#30372)
Also fixes instances where conditionals or other variables may result in
hosts executing lists of tasks of differing sizes.

Fixes #18748
2017-09-14 15:56:12 -05:00
Mike Wiebe
173c41aefe Rel240/fix nxos pim interface (#29885)
* fix nxos_pim_interface

* Add integration test coverage and fix unit test

* Add clarifying comments

* Make ansibot happy
2017-09-14 13:36:32 -07:00
Toshio Kuratomi
8a2f069468 Document boolean default value treatment (#30062)
* Consistency and document treatment of default bool values

* Document that default bool values can be any Ansible recognized bool.
  choose the one that reads better in context
* For fragments used by the copy module, make bool types use type=bool and not choices

* Edit for clarity
2017-09-14 13:27:16 -07:00
Brian Coca
7a12314d54 fixed 'typing' for deprecated get_config 2017-09-14 13:20:55 -07:00
Ganesh B. Nalawade
8c3bf20a13 Use safe_load to load yaml
Replad `yaml.load` with `yaml.safe_load`
2017-09-14 11:19:00 -07:00
Pierre-Louis Bonicoli
e9d202f944 module_utils/avi.py: fix broken import 2017-09-14 10:59:25 -07:00
Mike Wiebe
3faba93a2b Fix nxos_interface error for nxapi and idempotence problem (#29136)
* Fix nxos_interface nxapi error and idempotence

* Make shippable happy
2017-09-14 10:25:35 -07:00
Patrick Ogenstad
58088e836e Fix import error. Was pointing to the wrong module (#30293) 2017-09-14 10:24:28 -07:00
rahushen
37f68bffc0 fixes #27177 - nxos_aaa_server_host multiple issues (#29103) 2017-09-14 09:29:53 -07:00
mwellmeyer
8749894ebc add possibility for log messages via log_prefix (#30358) 2017-09-14 12:12:26 -04:00
Yanis Guenane
0648e339a7 openssl: remove static dict for keyUsage (#30339)
keyUsage and extendedKeyUsage are currently statically limited via a
static dict defined in modules_utils/crypto.py. If one specify a value
that isn't in there, idempotency won't work.

Instead of having static dict, we uses keyUsage and extendedKyeUsage
values OpenSSL NID and compare those rather than comparing strings.

Fixes: https://github.com/ansible/ansible/issues/30316
2017-09-14 12:03:00 -04:00
Brian Coca
1950bcc14e better error on bad playbook encoding 2017-09-14 08:53:15 -07:00
Mark Goddard
ac69fcccdc Fix Dell OS network module timeout (#30355)
The dellos action plugins should add the remote address of the switch
provider to the play context. This was fixed in issue #23589 in an
almost identical manner for the eos, ios, iosxr, and vyos action
plugins.

Fixes: #30350
2017-09-14 15:40:50 +01:00
Yanis Guenane
3e4a306a42 openssl_certificate: Correctly set the version (#30314)
Current openssl_certificate is mistakenly taking its derivating its
version number from the csr version number.

Thos two fields are completly unrelated and hence the version number of
the certificate should be able to be directly specified (via
selfsigned_version parameter).
2017-09-14 15:21:32 +02:00
Abhijit Menon-Sen
524c5dcfef Avoid KeyError when subnet['Tags'] doesn't exist (#30349)
The problem was introduced in 2cdf31d3.
2017-09-14 21:30:09 +10:00
John R Barker
4c9ad00c50 Specify default delay (DOCUMENTATION only change) (#30344)
* Specify default delay

Also clarify that tx_rate is in bps

* aggregates -> aggregate
2017-09-14 11:42:20 +01:00
ethackal
4980ebf064 Fixes verify_ssl option when False in ansible_tower module util (#30308)
* Fixes verify_ssl option when False in ansible_tower module util

* fixed comparison to None per PEP-8 standards
2017-09-14 12:03:33 +02:00
Ganesh Nalawade
3ff527b1d2 Fixes #30281 eos_banner integration test failure (#30283)
* Fixes #30281 Configure login prompt for eos_banner

* Fix unit test

* Fix pep8 issue
2017-09-14 13:56:32 +05:30
Matt Clay
ec59650528 Fix logic error in nxos get_config. 2017-09-13 23:48:15 -07:00
Toshio Kuratomi
62f49120cd Fix regression in format of lvm facts (#30326)
lvm information should not have leading whitespace in the key names

Fixes #30006
2017-09-14 13:50:47 +10:00
Abhijeet Kasurde
b3cba957e0 Correct sl_vm documentation (#29433)
Fix corrects sl_vm documentation from wait_timeout to wait_time

Fixes: #29395

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-09-14 09:21:32 +10:00
David Critch
e462e3bb3f Support one to many A records in nsupdate module (#25620)
* Updating the nsupdate module to accept a list for 'value' instead
of a string. This is to allow manipulating 1:many DNS records.

A string can still be supplied so it should be backwards compatible.

Addresses issue #25554

* Update nsupdate.py

* Update nsupdate.py

* Update nsupdate.py
2017-09-13 18:21:48 -04:00
MarkusTeufelberger
2186b04934 Add simple integration test for openssl_certificate (#29038)
* openssl_certificate: Fix parameter assertion in Python3

Parameter assertion in Python3 is broken. pyOpenSSL get_X() functions
returns b'' type string and tries to compare it with '' string, leading
to failure.

The error mentionned above has been fixed by sanitizing the inputs from
a user to the assert only backend.

Also, this error was hidden by the fact that the improper check method
was called in the generate() functions.

* Add simple integration test for openssl_certificate

* remove subject == issuer assertion

* run integration tests only on supported hosts

* change min supported version to 0.15.x

* Add test for more CSR fields

* also convert dict members to bytes

* fix version_compare

* openssl_{csr, certificate}: Fail if pyOpenSSL <= 0.15

Previous 0.13 pyOpenSSL was a C-binding, and required the parameter
passed to add_extention to be in ASN.1. This has changed with the move
to 0.14 and it is now all pythong and string based.

Previous the 0.15 release, the `get_extensions()` method didn't exist,
since the modules rely heavily on it we ensure pyOpenSSL version is at
last 0.15.0.

* check pyopenssl version in openssl_csr integration test
2017-09-13 14:39:32 -07:00
Marek Hulan
9ad90de4bc Fix sending facts to Foreman 2017-09-13 13:58:45 -07:00
Felipe Garcia Bulsoni
4f682e8896 Updated version_added to 2.5 2017-09-13 13:13:19 -07:00
Felipe Garcia Bulsoni
18707136e2 Added support to retrieving SAN Manager resources in HPE OneView
- Added unit tests
- Added _main_ function to oneview unit tests which were missing it
2017-09-13 13:13:19 -07:00
Will Thames
fd18d7ebb5 [cloud] Don't alter dictionary during iteration in elb_target_group_facts, avoiding RuntimeError (#30247)
Don't update the target_group_attributes dict
while iterating over it.

Fixes #30190
2017-09-13 14:34:26 -04:00
Sloane Hertel
4bc4abfe1b [cloud] ec2_group: Handle duplicate names between EC2 classic and VPC groups (#28931)
* ec2_group: Handle name conflict with empty vpc_id.

If several groups exist with the same name (and vpc_id is None) then
treat the group outside the vpc as preferred (same as it would for a vpc
group with vpc_id specified). Also don't run the egress rules code in
that case.

* Handle lack of `IpPermissionsEgress` attribute on EC2 classic groups

In EC2 classic groups, the `while True` loop checking for egress
permissions will continue infinitely.

* Handle incompatible combinations of EC2 Classic + VPC groups

* Fix integration tests in accounts lacking EC2 classic

This change checks against the security group created, instead of the
module parameters, for VPC ID. This means that new accounts with a
default VPC will still wait properly for the first egress rule to
populate.

* Fix conditional for storing described groups with preference for matching VPC IDs

* Revert `vpc_id is None` on conditional to allow for default VPCs
2017-09-13 14:19:05 -04:00
saichint
4e32c92166 nxos_udld_interface: improve interface detection (#28682)
* fix for nxos_udld_interface

* Tested Note added back
2017-09-13 11:06:56 -07:00
Jordan Borean
6d196eaa98 windows command changed to use CreateProcess (#30253)
* windows command changed to use CreateProcess

* change to get become to work
2017-09-13 09:58:49 -07:00
Andrea Tartaglia
ea8af15dfe Updated Display.do_var_prompt to use to_native on prompt ( Fixes #30265 ) (#30285)
* Updated Display.prompt to use the normalized prompt message.
2017-09-13 09:58:28 -07:00
James Cammarata
b38f746604 Fix conditional inheritance on dynamic includes (tasks and roles) (#30178)
Per the new style of execution, for dynamic tasks conditionals are expected
to only affect the include task itself and should not be inherited by child
tasks. This patch brings the behavior inline with this expectation.

Fixes #27845
2017-09-13 11:33:43 -05:00
Adrian Likins
b2ac60cfd7 Remove some non-ascii chars from strings
quote some unwieldy strings, etc.
2017-09-13 09:23:53 -07:00
Nathaniel Case
8c03609e54 nxos_snmp cleanup (#28922)
* Clean up nxos_snmp_contact & nxos_snmp_location

* Bring nxos_snmp_community in line

* Bring nxos_snmp_host in line

* And I would have gotten away with it too,

if it weren't for those meddling sanity tests

* Bring nxos_snmp_traps & nxos_snmp_user in line

* Appease Shippable
2017-09-13 08:23:36 -07:00
rahushen
1a266e29a7 Fixes #28793, #27484 (#29745) 2017-09-13 08:08:22 -07:00
rahushen
169fbc4c94 Fixes #28493 (#29061) 2017-09-13 08:00:13 -07:00
MarkusTeufelberger
2f06d572ba Add extended key usages to module_utils/crypto.py (#30128)
* Add extended key usages
2017-09-13 07:49:52 -07:00
rahushen
5537218c94 fixes #27066 - nxos_acl errors when there are 0 or 1 access lists configured (#29076)
* fixes #27066

* replace type() with isinstance()
2017-09-13 18:07:06 +05:30
rahushen
f1cc5a928c Fixes #27336 - nxos_gir_profile_management issue while creating profile (#29151)
* Fixes #27336

* Correct documentation errors
2017-09-13 17:54:35 +05:30
Mike Wiebe
7292dd20ed Fix nxos_overlay_global networking modules (#28943) 2017-09-13 17:33:06 +05:30
aperigault
3622801ad4 Use ansible network env vars to authentication on fortigates (#29499) 2017-09-13 12:44:41 +01:00
rahushen
bc6e015a86 Fixes #27138 (#29064) 2017-09-13 17:11:00 +05:30
Trishna Guha
578ae3b238 fix nxos_file_copy and provider getting set to None when transport is cli (#30262)
* nxos_file_copy bug fix

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

* provider gets set to None in module level when transport is cli

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-09-13 16:36:41 +05:30
Ganesh Nalawade
d8371cec91 Fix ios_system lookup enable issue (#30263)
Fixes #29974

Add `None` check while comparing module parameter values (want) with the actual
configuration present on device (have).
2017-09-13 15:19:09 +05:30
follower
8489e298ca doc: Typo fix: "accesability" --> "accessibility" (#30251) 2017-09-13 11:17:29 +02:00
Christian Pointner
1fe5171f1a openssl_certificate: make subject-alt-name identifier conistent with openssl_csr (#30151) 2017-09-13 05:06:23 -04:00
Matt Clay
442af3744e Miscellaneous pylint fixes.
The following rules are no longer disabled:

- bad-format-string
- duplicate-key
- lost-exception
- trailing-newlines
- unexpected-keyword-arg
- useless-suppression
- using-constant-test
2017-09-13 01:53:08 -07:00
Jordan Borean
77b2aca5a2 fixed become to show the stdout and stderr streams instead of the StreamReader (#30254) 2017-09-13 17:35:12 +10:00
Mike Wiebe
cef7ed0310 Fix nxos_mtu nxapi failure (#30153) 2017-09-13 10:51:46 +05:30
Daniel Shepherd
2cdf31d3a2 Update ec2_vpc_subnet_facts to use Boto3 (#25374)
* update ec2_vpc_subnet_facts module to use boto3 and support gathering updated fact items from AWS API

add version_added to new parameter

added return docs and other requested changes

removed errant extra blank line

updates per review

* update per review: fix AWSRetry backoff implementation and fix example that was not correct
2017-09-13 10:17:17 +10:00
Pavel Zagalsky
779e365639 Modified yaml examples (#29039)
Additional fields

Another change

Lint fix

Removed "valid" option from documentation

Checking without cert example

Added fake cert
2017-09-12 18:48:00 -04:00
Jacob McGill
2489eeece0 ACI EPG TO DOMAIN: Add vm_provider docstring and add support for micr… (#29114)
* ACI EPG TO DOMAIN: Add vm_provider docstring and add support for microsoft and openstack

* Fix typo

* Fix whitespace
2017-09-12 22:53:17 +01:00
Matt Davis
212bb76326 deprecated azure classic module (#30241) 2017-09-12 14:49:59 -07:00
Mike Wiebe
f973f93963 Fix nxos_smu error (#30157) 2017-09-12 22:17:07 +01:00
Martin Krizek
59702318e1 yum: fallback to epoch=0 if not available 2017-09-12 13:30:35 -07:00
Michael Price
fd8b1e5f34 Refactor E-Series Storage-Pool to use module_utils (#20900)
Refactor the NetApp E-Series module to utlize the common module_utils
and doc_fragments.
2017-09-12 16:17:42 -04:00
Jordan Borean
f6858cdd4d windows facts: better way to get machine SID (#29821)
* windows facts: better way to get machine SID

* remove the substring and just get the property that contains the value we need
2017-09-12 13:00:28 -07:00