Skip to content

Commit

Permalink
Merge pull request openshift#16 from twiest/pr
Browse files Browse the repository at this point in the history
doc update
  • Loading branch information
twiest committed Oct 28, 2014
2 parents b08cc0b + 1e216d4 commit 5cb6943
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 14 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
openshift-online-ansible
========================

This repo houses ansible code used in OpenShift Online.

Setup
-----
- Install base dependencies:
- Fedora:
```
yum install ansible rubygem-parseconfig
```

- Setup for a specific cloud:
- [AWS](../blob/master/README_AWS.md)
- [GCE](../blob/master/README_GCE.md)
40 changes: 40 additions & 0 deletions README_AWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

AWS Setup Instructions
======================

Get AWS API credentials
-----------------------
1. [AWS credentials documentation](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSGettingStartedGuide/AWSCredentials.html)


Create a credentials file
-------------------------
1. Create a credentials file (eg ~/.aws_creds) that looks something like this (variables must have have these exact names).
```
export AWS_ACCESS_KEY_ID='AKIASTUFF'
export AWS_SECRET_ACCESS_KEY='STUFF'
```

1. source this file
```
source ~/.aws_creds
```

1. Note: You must source this file in each shell that you want to run cloud.rb


Install Dependencies
--------------------
1. Ansible requires python-boto for aws operations:
```
yum install -y ansible python-boto
```


Test The Setup
--------------
1. cd openshift-online-ansible
1. Try to list all instances:
```
./cloud.rb aws list
```
36 changes: 22 additions & 14 deletions README_GCE.txt → README_GCE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@

GCE Setup Instructions
======================

Get a gce service key
---------------------
1. ping twiest and ask for a GCE service key
1. ask your GCE project administrator for a GCE service key

Note: If your GCE project doesn't show a Service Account under <Project>/APIs & auth/Credentials, you will need to use "Create new
Client ID" to create a Service Account.
Note: If your GCE project does not show a Service Account under <Project>/APIs & auth/Credentials, you will need to use "Create new Client ID" to create a Service Account.


Convert a GCE service key into a pem (for ansible)
--------------------------------------------------
1. The gce service key looks something like this: os302gce-ef83bd90f261.p12
2. the ef83bd90f261 part is the public hash
3. Be in the same directory as the p12 key file.
4. The commands below should be copy / paste-able
5. Run these commands:
.. the ef83bd90f261 part is the public hash
1. Be in the same directory as the p12 key file.
1. The commands below should be copy / paste-able
1. Run these commands:
```
# Temporarily set hash variable
export GCE_KEY_HASH=ef83bd90f261
Expand All @@ -25,24 +26,31 @@ Convert a GCE service key into a pem (for ansible)
# Move the converted service key to the .ssh dir
mv os302gce-${GCE_KEY_HASH}.pem ~/.ssh
# Set a sym link so it's easy to reference
# Set a sym link so it is easy to reference
ln -s ~/.ssh/os302gce-${GCE_KEY_HASH}.pem ~/.ssh/os302gce_priv_key.pem
```

6. Once this is done, put the original service key file (os302gce-ef83bd90f261.p12) somewhere safe, or delete it (your call, I don't know what else we'll use it for, and we can always regen it if needed)
1. Once this is done, put the original service key file (os302gce-ef83bd90f261.p12) somewhere safe, or delete it (your call, I don not know what else we will use it for, and we can always regen it if needed).



Install Dependencies (not needed for ctl1)
------------------------------------------
Install Dependencies
--------------------
1. Ansible requires libcloud for gce operations:
yum install -y ansible python-libcloud
```
yum install -y ansible python-libcloud
```


Test The Setup
--------------
1. cd li-ops/cloud
2. Try to list all instances:
./cloud.rb gce list
```
./cloud.rb gce list
```

3. Try to create an instance:
./cloud.rb gce launch -n ${USER}-minion1 -e int --type os3-minion
```
./cloud.rb gce launch -n ${USER}-minion1 -e int --type os3-minion
```

0 comments on commit 5cb6943

Please sign in to comment.