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
faaa90ed
Commit
faaa90ed
authored
Jun 19, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ocean' into devel
Conflicts: library/cloud/digital_ocean
parents
c9c45ac5
f9a09e10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
6 deletions
+34
-6
hacking/env-setup
+10
-6
library/cloud/digital_ocean
+24
-0
No files found.
hacking/env-setup
View file @
faaa90ed
#!/bin/bash
#!/bin/bash
# usage: source ./hacking/env-setup [-q]
# usage: source env-setup [-q]
# source hacking/env-setup [-q]
# . ./env-setup [-q]
# . ./hacking/env-setup [q]
# modifies environment for running Ansible from checkout
# modifies environment for running Ansible from checkout
# When run using source as directed, $0 gets set to bash, so we must use $BASH_SOURCE
# When run using source as directed, $0 gets set to bash, so we must use $BASH_SOURCE
if
[
-n
"
$BASH_SOURCE
"
]
;
then
case
"
$0
"
in
HACKING_DIR
=
`
dirname
$BASH_SOURCE
`
(
bash
)
else
HACKING_DIR
=
${
BASH_SOURCE
%/*
}
;;
HACKING_DIR
=
"
$PWD
/hacking"
(
*
)
fi
HACKING_DIR
=
${
0
%/*
}
;;
esac
# The below is an alternative to readlink -fn which doesn't exist on OS X
# The below is an alternative to readlink -fn which doesn't exist on OS X
# Source: http://stackoverflow.com/a/1678636
# Source: http://stackoverflow.com/a/1678636
FULL_PATH
=
`
python
-c
"import os; print(os.path.realpath('
$HACKING_DIR
'))"
`
FULL_PATH
=
`
python
-c
"import os; print(os.path.realpath('
$HACKING_DIR
'))"
`
...
...
library/cloud/digital_ocean
View file @
faaa90ed
...
@@ -131,6 +131,30 @@ EXAMPLES = '''
...
@@ -131,6 +131,30 @@ EXAMPLES = '''
size_id=1
size_id=1
region_id=2
region_id=2
image_id=3
image_id=3
=======
- digital_ocean: state=present command=ssh name=my_ssh_key ssh_pub_key='ssh-rsa AAAA...' client_id=XXX api_key=XXX
If a key matches this name, will return the ssh key id and changed = False
If no existing key matches this name, a new key is created, the ssh key id is returned and changed = False
# Create a new Droplet
- digital_ocean: state=present command=droplet name=my_new_droplet client_id=XXX api_key=XXX size_id=1 region_id=2 image_id=3 wait_timeout=500
Will return the droplet details including the droplet id (used for idempotence)
# Ensure a droplet is present
- digital_ocean: state=present command=droplet id=123 name=my_new_droplet client_id=XXX api_key=XXX size_id=1 region_id=2 image_id=3 wait_timeout=500
If droplet id already exist, will return the droplet details and changed = False
If no droplet matches the id, a new droplet will be created and the droplet details (including the new id) are returned, changed = True.
# Create a droplet with ssh key
- digital_ocean: state=present ssh_key_ids=id name=my_new_droplet client_id=XXX api_key=XXX size_id=1 region_id=2 image_id=3
The ssh key id can be passed as argument at the creation of a droplet (see ssh_key_ids).
Several keys can be added to ssh_key_ids as id1,id2,id3
The keys are used to connect as root to the droplet.
'''
'''
import
sys
import
sys
...
...
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