Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
eb84f55a
Commit
eb84f55a
authored
Jun 01, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs/style
parent
53d0a476
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
library/cloud/quantum_router
+14
-10
No files found.
library/cloud/quantum_router
View file @
eb84f55a
...
...
@@ -38,12 +38,12 @@ options:
description:
- Password of login user
required: true
default:
True
default:
'yes'
login_tenant_name:
description:
- The tenant name of the login user
required: true
default:
True
default:
'yes'
auth_url:
description:
- The keystone url for authentication
...
...
@@ -74,12 +74,14 @@ options:
- desired admin state of the created router .
required: false
default: true
examples:
- code: "quantum_router: state=present login_username=admin login_password=admin login_tenant_name=admin name=router1"
description: "Creates a router for tenant admin"
requirements: ["quantumclient", "keystoneclient"]
'''
EXAMPLES
=
'''
# Creates a router for tenant admin
quantum_router: state=present login_username=admin login_password=admin login_tenant_name=admin name=router1"
'''
_os_keystone
=
None
_os_tenant_id
=
None
...
...
@@ -175,26 +177,28 @@ def main():
name
=
dict
(
required
=
True
),
tenant_name
=
dict
(
default
=
None
),
state
=
dict
(
default
=
'present'
,
choices
=
[
'absent'
,
'present'
]),
admin_state_up
=
dict
(
default
=
'true'
,
choices
=
BOOLEANS
),
admin_state_up
=
dict
(
type
=
'bool'
,
default
=
True
),
),
)
quantum
=
_get_quantum_client
(
module
,
module
.
params
)
_set_tenant_id
(
module
)
if
module
.
params
[
'state'
]
==
'present'
:
router_id
=
_get_router_id
(
module
,
quantum
)
if
not
router_id
:
router_id
=
_create_router
(
module
,
quantum
)
module
.
exit_json
(
changed
=
True
,
result
=
"Created"
,
id
=
router_id
)
module
.
exit_json
(
changed
=
True
,
result
=
"Created"
,
id
=
router_id
)
else
:
module
.
exit_json
(
changed
=
False
,
result
=
"success"
,
id
=
router_id
)
module
.
exit_json
(
changed
=
False
,
result
=
"success"
,
id
=
router_id
)
else
:
router_id
=
_get_router_id
(
module
,
quantum
)
if
not
router_id
:
module
.
exit_json
(
changed
=
False
,
result
=
"success"
)
module
.
exit_json
(
changed
=
False
,
result
=
"success"
)
else
:
_delete_router
(
module
,
quantum
,
router_id
)
module
.
exit_json
(
changed
=
True
,
result
=
"deleted"
)
module
.
exit_json
(
changed
=
True
,
result
=
"deleted"
)
# this is magic, see lib/ansible/module.params['common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment