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
7bd1749f
Commit
7bd1749f
authored
Aug 01, 2015
by
Marcos Garcia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #11830, keep working even if we use private_networking
parent
cf35bdbd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
+10
-1
contrib/inventory/digital_ocean.py
+10
-1
No files found.
contrib/inventory/digital_ocean.py
View file @
7bd1749f
...
@@ -55,6 +55,7 @@ When run against a specific host, this script returns the following variables:
...
@@ -55,6 +55,7 @@ When run against a specific host, this script returns the following variables:
- do_id
- do_id
- do_image - object
- do_image - object
- do_ip_address
- do_ip_address
- do_private_ip_address
- do_kernel - object
- do_kernel - object
- do_locked
- do_locked
- de_memory
- de_memory
...
@@ -344,7 +345,15 @@ or environment variables (DO_API_TOKEN)'''
...
@@ -344,7 +345,15 @@ or environment variables (DO_API_TOKEN)'''
# add all droplets by id and name
# add all droplets by id and name
for
droplet
in
self
.
data
[
'droplets'
]:
for
droplet
in
self
.
data
[
'droplets'
]:
dest
=
droplet
[
'ip_address'
]
#when using private_networking, the API reports the private one in "ip_address", which is useless. We need the public one for Ansible to work
if
'private_networking'
in
droplet
[
'features'
]:
for
net
in
droplet
[
'networks'
][
'v4'
]:
if
net
[
'type'
]
==
'public'
:
dest
=
net
[
'ip_address'
]
else
:
continue
else
:
dest
=
droplet
[
'ip_address'
]
self
.
inventory
[
droplet
[
'id'
]]
=
[
dest
]
self
.
inventory
[
droplet
[
'id'
]]
=
[
dest
]
self
.
push
(
self
.
inventory
,
droplet
[
'name'
],
dest
)
self
.
push
(
self
.
inventory
,
droplet
[
'name'
],
dest
)
...
...
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