Commit graph

11046 commits

Author SHA1 Message Date
Toshio Kuratomi
283205d7b3 We've changed run_command to return native_strings
on python3, this means that we don't get bytes back by default.  We
probably do want bytes here so modify our call to run_command so we get
bytes instead of text.
2016-12-08 11:25:18 -05:00
Ryan Brown
b091d39baf Handle termination_protection parameter when restarting instances (#5076)
* Restart EC2 instances with multiple network interfaces

A previous bug, #3234, caused instances with multiple ENI's to fail when being
started or stopped because sourceDestCheck is a per-interface attribute, but we
use the boto global access to it (which only works when there's a single ENI).

This patch handles a variant of that bug that only surfaced when restarting an
instance, and catches the same type of exception.

* Default termination_protection to None instead of False

AWS defaults the value of termination_protection to False, so we don't
need to explicitly send `False` when the user hasn't specified a
termination protection level. Before this patch, the below pair of tasks
would:

1. Create an instance (enabling termination_protection)
2. Restart that instance (disabling termination_protection)

Now, the default None value would prevent the restart task from
disabling termination_protection.

```
- name: make an EC2 instance
  ec2:
    vpc_subnet_id: {{ subnet  }}
    instance_type: t2.micro
    termination_protection: yes
    exact_count: 1
    count_tag:
       Name: TestInstance
    instance_tags:
       Name: TestInstance
    group_id: {{ group }}
    image: ami-7172b611
    wait: yes
- name: restart a protected EC2 instance
  ec2:
    vpc_subnet_id: {{ subnet  }}
    state: restarted
    instance_tags:
       Name: TestInstance
    group_id: {{ group }}
    image: ami-7172b611
    wait: yes
```
2016-12-08 11:25:18 -05:00
John R Barker
3333035ef4 Add matching quotes (#5133)
Will fix broken syntax highlighting
2016-12-08 11:25:18 -05:00
Matt Davis
e2f66abe73 fixed windows setup to run in check_mode 2016-12-08 11:25:18 -05:00
Toshio Kuratomi
007b5f4c32 Fix assemble module for python3 2016-12-08 11:25:18 -05:00
Peter Sprygada
9c664f424e adds exception handling for adding an invalid condition (#5125)
This change will now handle a problem adding a condition that raises
an AddConditionError and return a well formed error to the user.
2016-12-08 11:25:18 -05:00
Pradeep
b405931e8b Typo Fix 2016-12-08 11:25:18 -05:00
Gabriele
b4565b6667 Adding more details on DOCSTRING about how to use the module (#5121) 2016-12-08 11:25:18 -05:00
Peter Sprygada
9707ae6490 adds exception handling for AddConditionError (#5124)
AddConditionErrors are now handled by nxos_command and a well formed error
is returned from the module
2016-12-08 11:25:17 -05:00
Peter Sprygada
f5e72c6590 adds check for AddConditionError when adding conditional statements (#5123)
The Conditional instance will now raise the AddConditionError and this
change instructs eos_command to catch the error and return a nicely formed
error message
2016-12-08 11:25:17 -05:00
Matt Davis
48b0cb750c (re)add post-watchdog-launch sleep to Windows async_wrapper (#5122)
fixed apparent race where subprocess appears to never start
2016-12-08 11:25:17 -05:00
Gabriele
d4c2a13325 Improving nxos_igmp_snooping (#5011) 2016-12-08 11:25:17 -05:00
Gabriele
3c257688bc Fixing nxos_igmp_interface (#5010) 2016-12-08 11:25:17 -05:00
Gabriele
b6c07bc9e9 Fixing nxos_hsrp (#5009)
* Fixing nxos_hsrp

* Adding space after =
2016-12-08 11:25:17 -05:00
Senthil Kumar Ganesan
21ae84a04e Remove the dellosX_template module (#5110) 2016-12-08 11:25:17 -05:00
Matt Davis
c07a2b49b6 add JSON junk filter to async_wrapper (#5107) 2016-12-08 11:25:17 -05:00
Peter Sprygada
d58462949f roll up of unicode fixes in junos modules (#5113)
* fixes junos_template (fixes #3962)
* fixes junos_config
2016-12-08 11:25:17 -05:00
Gabriele
62bf8d0c78 Add ethernet-link-oam mapping to nxos_feature (#4956)
* Add ethernet-link-oam mapping

* Adding port-secutiry mapping

* Fixing command output format
2016-12-08 11:25:17 -05:00
Gabriele
67d6f2c0d6 Fixing nxos_vlan (#5005)
* Fixing nxos_vlan

* Fixing docstring

* Fixing docstring
2016-12-08 11:25:17 -05:00
Gabriele
43632951fe Fixing nxos_aaa_server (#5002)
* Fixing command output formatting

* Fixing cmds
2016-12-08 11:25:17 -05:00
Gabriele
7f861fb9ce Fixing nxos_acl (#5006)
* Fixing nxos_acl

* Fixing nxos_acl
2016-12-08 11:25:17 -05:00
Gabriele
272b20000f Fixing nxos_acl_interface (#5007) 2016-12-08 11:25:17 -05:00
Gabriele
75c4051933 Fixing nxos_interface (#5012) 2016-12-08 11:25:16 -05:00
Gabriele
1be7ca4f70 Fxing nxos_ip_interface (#5013) 2016-12-08 11:25:16 -05:00
Gabriele
6708874f1c Fixing nxos_mtu (#5014) 2016-12-08 11:25:16 -05:00
Gabriele
6934f11e1f Fixing nxos_ntp (#5015) 2016-12-08 11:25:16 -05:00
Gabriele
6201a57d83 Fixing nxos_ntp_auth (#5016) 2016-12-08 11:25:16 -05:00
Gabriele
c50324fb08 Fixing nxos_ntp_options (#5017) 2016-12-08 11:25:16 -05:00
Gabriele
4b6ee73f8c Fixing nxos_pim_interface (#5018) 2016-12-08 11:25:16 -05:00
Gabriele
5b96fb1dac Fixing nxos_portchannel (#5019) 2016-12-08 11:25:16 -05:00
Gabriele
ebb39a0151 Fixing nxos_smu (#5021) 2016-12-08 11:25:16 -05:00
Gabriele
cda65cad18 Fixing nxos_snmp_community (#5022) 2016-12-08 11:25:16 -05:00
Gabriele
f74275fc1d Fixing nxos_snmp_contact (#5023) 2016-12-08 11:25:16 -05:00
Gabriele
73d66e28ab Fixing nxos_snmp_host (#5024) 2016-12-08 11:25:16 -05:00
Gabriele
7c7eee94b2 Fixing nxos_snmp_location (#5025) 2016-12-08 11:25:16 -05:00
Gabriele
19769903e6 Fixing nxos_snmp_traps (#5026) 2016-12-08 11:25:16 -05:00
Gabriele
bf59e458b1 Fixing nxos_snmp_user (#5027) 2016-12-08 11:25:16 -05:00
Gabriele
04e62346d1 Fixing nxos_udld_interface (#5030) 2016-12-08 11:25:16 -05:00
Gabriele
6bedeb28d8 Fixing nxos_switchport (#5028) 2016-12-08 11:25:16 -05:00
Gabriele
773f1703b7 Fixing nxos_udld (#5029) 2016-12-08 11:25:15 -05:00
Gabriele
d61950d48c Fixing nxos_vpc_interface (#5032) 2016-12-08 11:25:15 -05:00
Gabriele
51c37e9f58 Fixing nxos_vrf (#5033) 2016-12-08 11:25:15 -05:00
Gabriele
8f331e01ca Fixing nxos_vpc (#5031) 2016-12-08 11:25:15 -05:00
Gabriele
9ff6070eb8 Fixing nxos_vrf_interface (#5034) 2016-12-08 11:25:15 -05:00
Gabriele
e7286ed43c Fixing nxos_vtp_domain (#5036) 2016-12-08 11:25:15 -05:00
Gabriele
c19e3b5924 Fixing nxos_vrrp (#5035) 2016-12-08 11:25:15 -05:00
Gabriele
f89cb1717c Fixing nxos_vtp_password (#5037) 2016-12-08 11:25:15 -05:00
Gabriele
b897b497c1 Fixing nxos_vtp_version (#5038) 2016-12-08 11:25:15 -05:00
Matt Davis
66a1b15f89 remove broken ansible_user_uid fact from Windows setup 2016-12-08 11:25:15 -05:00
Ryan Brown
135b92bf4e Check status of finished spot instance requests (#4990)
Per #3877, the code to wait for spot instance requests to finish would
hang for the full wait time if any spot request failed for any reason.
This commit introduces status checks for spot requests, so if the
request fails, finishes, or is cancelled the task will fail/succeed
accordingly.

One edge case introduced here is tha if a user terminates the instance
associated with the request manually it won't fail the play, under the
presumption that the user *wants* the instance terminated.
2016-12-08 11:25:15 -05:00
Brian Coca
22d29be478 1st draft of include docs 2016-12-08 11:25:15 -05:00
Toshio Kuratomi
132fcc434b Set some hosts privileged so they can perform mount tests (#5087) 2016-12-08 11:25:15 -05:00
Jiri Tyr
2b145a0052 Fixing bind mount pattern in the mount module (#5084) 2016-12-08 11:25:15 -05:00
Peter Sprygada
58a5ec6c51 fixes junos_command module paring of wait_for strings (#5083)
The junos_command module wasn't properly parsing strings to apply
conditionals due to the return value not being converted to json
before the results where handed to the runner.
2016-12-08 11:25:15 -05:00
Peter Sprygada
9ed01d0cfd fixes junos_template ignoring the action directive (#5080)
This updates the junos_template to properly process the action
directive when loading the configuration.
2016-12-08 11:25:15 -05:00
Toshio Kuratomi
9436d013d4 Fix mount default options -- should be defaults, not default 2016-12-08 11:25:14 -05:00
John R Barker
177dcadbc0 deprecated _template network modules: Rename in modules-core (#5072) 2016-12-08 11:25:14 -05:00
Jiri Tyr
be1036f461 Ultimate fix of the mount module for Linux (#5055) 2016-12-08 11:25:14 -05:00
John R Barker
f7b10720ac typo in module name (#5062) 2016-12-08 11:25:14 -05:00
Kevin Carter
e2e7f20e34 apt: fix cache time handling (#1517)
This change is in response to issue #1497 where the apt module would not properly updating the apt cache in some situations and never returned a state change on cache update when the module was used without or without an item to be installed or upgraded.

The change simply allows the apt module to update the cache when update_cache option is used without or without a set cache_valid_time.
If cache_valid_time is set and the on disk mtime for apt cache is ">" the provided amount of seconds, which now has a default of 0, the apt cache will be updated. Additionally if no upgrade, package, or deb is installed or changed but the apt cache is updated the module will return a changed state which will help users to know that the state of the environment has changed due to a task operation, even if it was only an apt cache update.

fixes #1497

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-12-08 11:25:14 -05:00
Peter Sprygada
0a85e64b4a fixes exception raised due to KeyError (#5068)
The vyos_config module would error when looking for a key called `updates`
in module.params.  There is no such key.  This fixes the problem.
2016-12-08 11:25:14 -05:00
Peter Sprygada
73cf85d677 catches exception if conditional cannot be parsed (#5067)
If the conditional cannot be parsed, the module will now catch the exception
and return a well formed failed message.

fixes #5060
2016-12-08 11:25:14 -05:00
Peter Sprygada
da4c11241f fixes error when 'delete ...' config command is specified but doesn't exist (#5064)
The junos_config module will generate an exception if a 'delete ...' config
command is attempted to be loaded into a device configuration.  This change
will first check to see if the delete command is valid and filter it out
of the change set if it is not valid.

fixes #5040
2016-12-08 11:25:14 -05:00
Nathaniel Case
aa82f48dc8 Network module code cleanup (#5061)
* Fix imports in junos_template

* Python 3 compatibility in eos_command

* Python 3 compatibility for ios_command

* Clean up issues with ios_facts

* Python 3 compatibility for ios_facts

* Import shuffle in ios_template

* Python 3 compatibility for iosxr_command

* Clean up iosxr_facts.py

* Python 3 compatibility for iosxr_facts

* Python 3 compatibility for junos_command

* Python 3 compatibility for ops_command

* Cleanup issues with ops_facts

* Python 3 compatibility for ops_facts

* Cleanup issues with ops_template

* Python 3 compatibility for vyos_command

* Cleanup issues with vyos_facts

* Python 3 compatibility for vyos_facts
2016-12-08 11:25:14 -05:00
Nathaniel Case
6ae0342a0a Fix imports in junos_template (#5059) 2016-12-08 11:25:14 -05:00
David Shrewsbury
d0f7af4b09 Fix os_network's create_network() call for older shade versions (#5058)
A value for the project_id parameter to shade's create_network()
call was always being sent, even if no value for 'project' was
supplied. This was breaking folks with older versions of shade
(< 1.6).

Fixes PR https://github.com/ansible/ansible-modules-core/issues/3567
2016-12-08 11:25:14 -05:00
Matt Clay
25d829c8f2 Detect tar type (bsd, gnu) and only use gnu tar. (#4352)
* Detect tar type (bsd, gnu) and only use gnu tar.

* Revert return code checking for TgzArchive.
2016-12-08 11:25:14 -05:00
Nathaniel Case
9b286b1775 eos_facts cleanup (#5057)
* dict.iteritems does not exist in Python 3

Now just dict.items
six.iteritems handles the change

* Addresses point 1

Unsure if this is a good idea or not.

* Addresses point 2

This shouldn't have any particular change, just marks load_comments as abstract

* Remove unused import

Addresses point 3

* Clarify invalid subset error message

Addresses point 4
2016-12-08 11:25:14 -05:00
Chris Houseknecht
0e4b470ee2 Let docker-py handle decoding and JSON parsing of stream data. Fixes #4930. 2016-12-08 11:25:14 -05:00
Chris Houseknecht
9432adfaf7 Put requested devices in correct format to enable config comparison. Fixes #5000. 2016-12-08 11:25:14 -05:00
Peter Sprygada
0ef16b44ca fixes exception being raised when show configuration command issued (#5047)
The junos_command expects commands to be returned as xml by default but
`show configuration [options]` will return text not xml.  This fix
will set the output format for any command that starts with `show
configuration` to text

fixes #4628
2016-12-08 11:25:14 -05:00
Peter Sprygada
a5b32fa0d1 fixes return passing output from command through jxmlease in junos_command (#5044)
The return string from the commands was not being passed through the
jxmlease library and therefore being returned as a string instead of a
json data structure.  This also adds back the missing xml key in the
return that includes the raw xml string.

fixes #5001
2016-12-08 11:25:14 -05:00
Aditya Marella
c3f815a6f6 Docker module: add support for OomScoreAdj
* docker-py param name oom_score_adj
* translates to OomScoreAdj in the docker remote API
* setting version_added to "2.2"
2016-12-08 11:25:13 -05:00
shaung
bcbeed244b Fix #4504 Respect timeout option when starting/stopping/restarting containers. 2016-12-08 11:25:13 -05:00
Denis Tiago
c0c5b9a50a fix health instances count when we have more than one lb in asg 2016-12-08 11:25:13 -05:00
Jiri Tyr
5a9f5918d3 Fixing bind mount on Linux (#1942) (#4439)
* Fixing bind mount on Linux

* Fixing broken implementation
2016-12-08 11:25:13 -05:00
Andrew Gaffney
460b0e1ab6 Match existing INI file entry with leading whitespace (fixes #4997) (#4998) 2016-12-08 11:25:13 -05:00
Senthil Kumar Ganesan
4504f2d8c7 Update minimum required version and ssh rate limit (#4995) 2016-12-08 11:25:13 -05:00
Matt Clay
efaed0b68d Revert "Set PRIVILEGED=true for Linux integration tests. (#4993)"
This reverts commit fb779bf30c.
2016-12-08 11:25:13 -05:00
Matt Clay
2b33d55442 Set PRIVILEGED=true for Linux integration tests. (#4993)
This should allow test_mount tests to run on Shippable.
2016-12-08 11:25:13 -05:00
Matt Clay
1854337eb1 Fix handling of ansible-doc errors. (#4992) 2016-12-08 11:25:13 -05:00
Toshio Kuratomi
08874e4bf6 Fix #3153 again (#4989) 2016-12-08 11:25:13 -05:00
Peter Sprygada
654a38897f fixes exception raised when nxos_facts uses nxapi transport (#4988)
This fixes a condition where an exception is raised when collecting `interface`
facts and the transport is set to nxapi in the nxos_nxapi module.

fixes ansible/ansible#17691
2016-12-08 11:25:13 -05:00
Toshio Kuratomi
27759ee58f Working subset of mount fixes (#4987)
* Fixing bind mount on Linux

* The latest update from jtyr doesn't pass integration tests.

Manually select the changes that are necessary to fix the bug with
unmounting
2016-12-08 11:25:13 -05:00
Peter Sprygada
df6b7703bb fixes default value in docstring for http (#4985)
The docstring incorrectly stated the default value for http is yes when
indeed its no.  This fixes the docstring
2016-12-08 11:25:13 -05:00
Peter Sprygada
88b2c7e1f6 fixes bug where setting state=absent in nxos_nxapi is not idempotent (#4984)
When setting state=absent the nxos_nxapi module would always try to remove
the configuration regardless of the current state of the device.  This will
fix that problem.

This also updates the docstring to correctly reflect https as default=no

fixes #4955
depends on ansible/ansible#17728
2016-12-08 11:25:13 -05:00
John R Barker
f63e5d078e Force is not a 2.2 feature
9b5e6bbfa1 incorrectly chopped some text around
2016-12-08 11:25:13 -05:00
Matt Clay
da8538698b Add shellcheck to sanity checks. (#4976)
Also disable deprecation warnings during module validation.
2016-12-08 11:25:13 -05:00
Trond Hindenes
0da88d4744 win_feature_docs_update (#4421) 2016-12-08 11:25:12 -05:00
Timothy Appnel
6647e8c271 Fixes grammatical error in assert module example (#4972) 2016-12-08 11:25:12 -05:00
Ryan S. Brown
93737f819a Accept JSON type as the content of policy_json parameter on iam_policy module 2016-12-08 11:25:12 -05:00
Søren Kröger
61144f4da9 Added single_transaction and quick to db_dump (#3687)
It was missing before, ...
2016-12-08 11:25:12 -05:00
JesseEmond
6ddbc63b1d Unarchive stop passing file mode to tar command (#4179)
Fixes #4063.

Tar does not use this parameter on extraction (-x) or diff (-d)(the
only two cases where it is passed in unarchive). It only uses it on
creation:
https://www.gnu.org/software/tar/manual/html_section/tar_33.html

Providing `unarchive` with a file mode of `0755` (octal) makes it pass
the argument `--mode 493` (493 = 0755 in decimal) to `tar`, which then
fails while verifying it (because it contains an invalid octal char
'9'). Not passing the parameter to tar solves the issue.
2016-12-08 11:25:12 -05:00
Marius Gedminas
9509224768 postgresql_db: fix inverted 'changed' logic when state=absent (#4934)
Fixes #4933.
2016-12-08 11:25:12 -05:00
David Shrewsbury
56211bd7ed Correct reuse_fips param to reuse_ips (#4939)
This new parameter was incorrectly named. Fixing to match the expected
name in the shade library.
2016-12-08 11:25:12 -05:00
Toshio Kuratomi
77975c232b Fix pip freeze workaround with virtualenv (#4951) 2016-12-08 11:25:12 -05:00
Matt Clay
d1ef5f947e Remove script previously used by Travis. 2016-12-08 11:25:12 -05:00
Toshio Kuratomi
a8fbdcd80d pip list isn't available on pip less than 1.3 so make a fallback (#4947) 2016-12-08 11:25:12 -05:00
Timothy Appnel
b18c22f69b Adds docs for msg param in assert modules plus some other clean up (#4926) 2016-12-08 11:25:12 -05:00
Peter Sprygada
b06123e986 fixes junos_config to be idempotent when confirming a commit (#4946)
The junos_config module would always return true when confirming a commit
This changes the module to now check first making the feature idempontent
2016-12-08 11:25:12 -05:00