summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--docsite/rst/guide_aws.rst4
-rw-r--r--lib/ansible/module_utils/f5.py64
-rw-r--r--lib/ansible/module_utils/facts.py11
-rw-r--r--lib/ansible/module_utils/openstack.py6
m---------lib/ansible/modules/core10
-rw-r--r--lib/ansible/utils/module_docs_fragments/openstack.py13
-rw-r--r--v2/ansible/module_utils/openstack.py6
8 files changed, 91 insertions, 24 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9800650369..f806cbfb1f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -30,6 +30,7 @@ New Modules:
* cloudstack: cs_instance
* cloudstack: cs_instancegroup
* cloudstack: cs_portforward
+ * cloudstack: cs_project
* cloudstack: cs_sshkeypair
* cloudstack: cs_securitygroup
* cloudstack: cs_securitygroup_rule
diff --git a/docsite/rst/guide_aws.rst b/docsite/rst/guide_aws.rst
index c4e12eab49..e0d0c12630 100644
--- a/docsite/rst/guide_aws.rst
+++ b/docsite/rst/guide_aws.rst
@@ -13,7 +13,7 @@ Requirements for the AWS modules are minimal.
All of the modules require and are tested against recent versions of boto. You'll need this Python module installed on your control machine. Boto can be installed from your OS distribution or python's "pip install boto".
-Whereas classically ansible will execute tasks in it's host loop against multiple remote machines, most cloud-control steps occur on your local machine with reference to the regions to control.
+Whereas classically ansible will execute tasks in its host loop against multiple remote machines, most cloud-control steps occur on your local machine with reference to the regions to control.
In your playbook steps we'll typically be using the following pattern for provisioning steps::
@@ -214,7 +214,7 @@ AWS Image Building With Ansible
```````````````````````````````
Many users may want to have images boot to a more complete configuration rather than configuring them entirely after instantiation. To do this,
-one of many programs can be used with Ansible playbooks to define and upload a base image, which will then get it's own AMI ID for usage with
+one of many programs can be used with Ansible playbooks to define and upload a base image, which will then get its own AMI ID for usage with
the ec2 module or other Ansible AWS modules such as ec2_asg or the cloudformation module. Possible tools include Packer, aminator, and Ansible's
ec2_ami module.
diff --git a/lib/ansible/module_utils/f5.py b/lib/ansible/module_utils/f5.py
new file mode 100644
index 0000000000..2d97662a0b
--- /dev/null
+++ b/lib/ansible/module_utils/f5.py
@@ -0,0 +1,64 @@
+# This code is part of Ansible, but is an independent component.
+# This particular file snippet, and this file snippet only, is BSD licensed.
+# Modules you write using this snippet, which is embedded dynamically by Ansible
+# still belong to the author of the module, and may assign their own license
+# to the complete work.
+#
+# Copyright (c), Etienne Carrière <etienne.carriere@gmail.com>,2015
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+try:
+ import bigsuds
+except ImportError:
+ bigsuds_found = False
+else:
+ bigsuds_found = True
+
+
+def f5_argument_spec():
+ return dict(
+ server=dict(type='str', required=True),
+ user=dict(type='str', required=True),
+ password=dict(type='str', aliases=['pass', 'pwd'], required=True, no_log=True),
+ validate_certs = dict(default='yes', type='bool'),
+ state = dict(type='str', default='present', choices=['present', 'absent']),
+ partition = dict(type='str', default='Common')
+ )
+
+
+def f5_parse_arguments(module):
+ if not bigsuds_found:
+ module.fail_json(msg="the python bigsuds module is required")
+ if not module.params['validate_certs']:
+ disable_ssl_cert_validation()
+ return (module.params['server'],module.params['user'],module.params['password'],module.params['state'],module.params['partition'])
+
+def bigip_api(bigip, user, password):
+ api = bigsuds.BIGIP(hostname=bigip, username=user, password=password)
+ return api
+
+def disable_ssl_cert_validation():
+ # You probably only want to do this for testing and never in production.
+ # From https://www.python.org/dev/peps/pep-0476/#id29
+ import ssl
+ ssl._create_default_https_context = ssl._create_unverified_context
+
diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py
index 3485690b83..1162e05b9c 100644
--- a/lib/ansible/module_utils/facts.py
+++ b/lib/ansible/module_utils/facts.py
@@ -99,8 +99,9 @@ class Facts(object):
('/etc/os-release', 'SuSE'),
('/etc/gentoo-release', 'Gentoo'),
('/etc/os-release', 'Debian'),
+ ('/etc/lsb-release', 'Mandriva'),
('/etc/os-release', 'NA'),
- ('/etc/lsb-release', 'Mandriva'))
+ )
SELINUX_MODE_DICT = { 1: 'enforcing', 0: 'permissive', -1: 'disabled' }
# A list of dicts. If there is a platform with more than one
@@ -416,11 +417,13 @@ class Facts(object):
self.facts['distribution_version'] = self.facts['distribution_version'] + '.' + release.group(1)
elif name == 'Debian':
data = get_file_content(path)
- if 'Debian' in data or 'Raspbian' in data:
+ if 'Ubuntu' in data:
+ break # Ubuntu gets correct info from python functions
+ elif 'Debian' in data or 'Raspbian' in data:
release = re.search("PRETTY_NAME=[^(]+ \(?([^)]+?)\)", data)
if release:
self.facts['distribution_release'] = release.groups()[0]
- break
+ break
elif name == 'Mandriva':
data = get_file_content(path)
if 'Mandriva' in data:
@@ -2160,7 +2163,7 @@ class DarwinNetwork(GenericBsdIfconfigNetwork, Network):
current_if['media'] = 'Unknown' # Mac does not give us this
current_if['media_select'] = words[1]
if len(words) > 2:
- current_if['media_type'] = words[2][1:]
+ current_if['media_type'] = words[2][1:-1]
if len(words) > 3:
current_if['media_options'] = self.get_options(words[3])
diff --git a/lib/ansible/module_utils/openstack.py b/lib/ansible/module_utils/openstack.py
index b58cc53428..4069449144 100644
--- a/lib/ansible/module_utils/openstack.py
+++ b/lib/ansible/module_utils/openstack.py
@@ -93,11 +93,7 @@ def openstack_full_argument_spec(**kwargs):
def openstack_module_kwargs(**kwargs):
- ret = dict(
- required_one_of=[
- ['cloud', 'auth'],
- ],
- )
+ ret = {}
for key in ('mutually_exclusive', 'required_together', 'required_one_of'):
if key in kwargs:
if key in ret:
diff --git a/lib/ansible/modules/core b/lib/ansible/modules/core
-Subproject 5983d64d7728ea88ef27606e95e4aa34cde5ff4
+Subproject f8d8af17cdc72500af8319c96004b86ac702a0a
diff --git a/lib/ansible/utils/module_docs_fragments/openstack.py b/lib/ansible/utils/module_docs_fragments/openstack.py
index 7e42841d6d..99897eee6d 100644
--- a/lib/ansible/utils/module_docs_fragments/openstack.py
+++ b/lib/ansible/utils/module_docs_fragments/openstack.py
@@ -23,7 +23,9 @@ class ModuleDocFragment(object):
options:
cloud:
description:
- - Named cloud to operate against. Provides default values for I(auth) and I(auth_plugin)
+ - Named cloud to operate against. Provides default values for I(auth) and
+ I(auth_type). This parameter is not needed if I(auth) is provided or if
+ OpenStack OS_* environment variables are present.
required: false
auth:
description:
@@ -32,7 +34,8 @@ options:
I(auth_url), I(username), I(password), I(project_name) and any
information about domains if the cloud supports them. For other plugins,
this param will need to contain whatever parameters that auth plugin
- requires. This parameter is not needed if a named cloud is provided.
+ requires. This parameter is not needed if a named cloud is provided or
+ OpenStack OS_* environment variables are present.
required: false
auth_type:
description:
@@ -77,14 +80,17 @@ options:
- A path to a CA Cert bundle that can be used as part of verifying
SSL API requests.
required: false
+ default: None
cert:
description:
- A path to a client certificate to use as part of the SSL transaction
required: false
+ default: None
key:
description:
- A path to a client key to use as part of the SSL transaction
required: false
+ default: None
endpoint_type:
description:
- Endpoint URL type to fetch from the service catalog.
@@ -100,5 +106,6 @@ notes:
can come from a yaml config file in /etc/ansible/openstack.yaml,
/etc/openstack/clouds.yaml or ~/.config/openstack/clouds.yaml, then from
standard environment variables, then finally by explicit parameters in
- plays.
+ plays. More information can be found at
+ U(http://docs.openstack.org/developer/os-client-config)
'''
diff --git a/v2/ansible/module_utils/openstack.py b/v2/ansible/module_utils/openstack.py
index b58cc53428..4069449144 100644
--- a/v2/ansible/module_utils/openstack.py
+++ b/v2/ansible/module_utils/openstack.py
@@ -93,11 +93,7 @@ def openstack_full_argument_spec(**kwargs):
def openstack_module_kwargs(**kwargs):
- ret = dict(
- required_one_of=[
- ['cloud', 'auth'],
- ],
- )
+ ret = {}
for key in ('mutually_exclusive', 'required_together', 'required_one_of'):
if key in kwargs:
if key in ret: