Skip to content

Commit

Permalink
Merge branch 'release-1.1.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-ctl committed May 13, 2016
2 parents 829766a + 113b6a9 commit 68ca930
Show file tree
Hide file tree
Showing 11 changed files with 1,039 additions and 28 deletions.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,59 @@ Create/Delete a Firewall Policy
| `enabled` | N | True | True, False | If the firewall policy is enabled or disabled



## clc_network Module

Create or delete Network at CenturyLink Cloud.

###Example Playbook
```yaml
---
- name: Create Network
hosts: localhost
gather_facts: False
connection: local
tasks:
- name: Create and update a new network
clc_network:
location: 'ut1'
state: present
name: 'ProdNet5000'
description: 'Production Minecraft'
register: net
- debug: var=net
```
```
---
- name: Delete Network
hosts: localhost
gather_facts: False
connection: local
tasks:
- name: Delete-ification
clc_network:
location: 'ut1'
state: absent
id: 'vlan_1306_10.81.206'
register: net

- debug: var=net

```
###Available Parameters
| Parameter | Required | Default | Choices | Description |
|-----------|:--------:|:-------:|:-------:|-------------|
| `description` | N | | | Description for the network |
| `id` | N | | | Identifier for network to be updated/deleted. This is required when state is 'absent'. This is used to find an existing network when state is 'present' and takes precedence over `name`. The `id` field can be the network id, network name, or network vlan. |
| `location` | Y | | | Datacenter in which the network lives |
| `name` | N | | | The Name of the network. This is used to find an existing network when state is 'present'; if not found, the claimed network is given this name. |
| `state` | N | present | present, absent | Whether to claim or release the network |
| `wait` | N | True | True, False | Whether to wait for network create to complete |
## <a id="dyn_inventory"></a>Dynamic Inventory Script
Scans all datacenters and returns an inventory of servers and server groups to Ansible. This script returns all information about hosts in the inventory _meta dictionary.
Expand Down
4 changes: 2 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

# define project level attributes:
name = 'clc-ansible-module'
version = '1.1.9'
version = '1.1.10'
summary = "Centurylink Cloud Ansible Modules"
description = "Ansible extension modules which allow users to interact with Centurylink Cloud to define and manage cloud components."
authors = [Author ("CenturyLink Cloud", "WFAAS-LLFT@centurylink.com")]
Expand All @@ -55,7 +55,7 @@ def initialize( project ):
project.get_property('filter_resources_glob').append('**/clc_ansible_module/*.py')
# ----------------
# install clc-sdk during installation
project.depends_on("clc-sdk", "==2.44")
project.depends_on("clc-sdk", "==2.45")
# ----------------
# execute some installation scripts
project.set_property('dir_source_main_scripts', 'src/main/python')
Expand Down
14 changes: 14 additions & 0 deletions example-playbooks/example_clc_network_create_playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- name: Create Network
hosts: localhost
gather_facts: False
connection: local
tasks:
- name: Create and update a new network
clc_network:
location: 'ut1'
state: present
name: 'ProdNet5000'
description: 'Production Minecraft'
register: net

- debug: var=net
13 changes: 13 additions & 0 deletions example-playbooks/example_clc_network_delete_playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- name: Delete Network
hosts: localhost
gather_facts: False
connection: local
tasks:
- name: Delete-ification
clc_network:
location: 'ut1'
state: absent
id: 'vlan_1306_10.81.206'
register: net

- debug: var=net
14 changes: 11 additions & 3 deletions example-playbooks/example_clc_network_fact_playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@
- name: Example for clc network fact module
hosts: localhost
tasks:
- name: Get facts on network
- name: Get facts on network as item
clc_network_fact:
id: '247a03273fd74687b72f029e6c82ab80'
location: CA3
register: network
register: fact

- name: output
debug: var=network
debug: var=fact.network

- name: Get facts on all networks as array
clc_network_fact:
location: UC1
register: fact

- name: output
debug: var=fact.networks
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.ctlts</groupId>
<artifactId>clc-ansible-module</artifactId>
<version>1.1.10-SNAPSHOT</version>
<version>1.1.10</version>
<name>clc-ansible-module</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
33 changes: 27 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
ansible
clc-sdk
pybuilder
mock
nose
coverage
ansible==2.0.2.0
args==0.1.0
cffi==1.6.0
clc-sdk==2.44
clint==0.5.1
coverage==4.0.3
cryptography==1.3.1
enum34==1.1.4
funcsigs==1.0.2
idna==2.1
ipaddress==1.0.16
Jinja2==2.8
MarkupSafe==0.23
mock==2.0.0
nose==1.3.7
paramiko==2.0.0
pbr==1.9.1
prettytable==0.7.2
pyasn1==0.1.9
PyBuilder==0.10.63
pycparser==2.14
pycrypto==2.6.1
PyYAML==3.11
requests==2.10.0
six==1.10.0
wheel==0.24.0
xmlrunner==1.7.7
6 changes: 5 additions & 1 deletion src/main/python/clc_ansible_module/clc_blueprint_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,12 @@ def clc_install_package(self, server, package_id, package_params):
package_id=package_id,
parameters=package_params)
except CLCException as ex:
try:
msg = ex.response_text
except:
msg = ex.message
self.module.fail_json(msg='Failed to install package : {0} to server {1}. {2}'.format(
package_id, server.id, ex.message
package_id, server.id, msg
))
return result

Expand Down
Loading

0 comments on commit 68ca930

Please sign in to comment.