README_GCE.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. GCE Setup Instructions
  2. Get a gce service key
  3. ---------------------
  4. 1. ping twiest and ask for a GCE service key
  5. Note: If your GCE project doesn't show a Service Account under <Project>/APIs & auth/Credentials, you will need to use "Create new
  6. Client ID" to create a Service Account.
  7. Convert a GCE service key into a pem (for ansible)
  8. --------------------------------------------------
  9. 1. The gce service key looks something like this: os302gce-ef83bd90f261.p12
  10. 2. the ef83bd90f261 part is the public hash
  11. 3. Be in the same directory as the p12 key file.
  12. 4. The commands below should be copy / paste-able
  13. 5. Run these commands:
  14. # Temporarily set hash variable
  15. export GCE_KEY_HASH=ef83bd90f261
  16. # Convert the service key (note: 'notasecret' is literally what we want here)
  17. openssl pkcs12 -in os302gce-${GCE_KEY_HASH}.p12 -passin pass:notasecret -nodes -nocerts | openssl rsa -out os302gce-${GCE_KEY_HASH}.pem
  18. # Move the converted service key to the .ssh dir
  19. mv os302gce-${GCE_KEY_HASH}.pem ~/.ssh
  20. # Set a sym link so it's easy to reference
  21. ln -s ~/.ssh/os302gce-${GCE_KEY_HASH}.pem ~/.ssh/os302gce_priv_key.pem
  22. 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)
  23. Install Dependencies (not needed for ctl1)
  24. ------------------------------------------
  25. 1. Ansible requires libcloud for gce operations:
  26. yum install -y ansible python-libcloud
  27. Test The Setup
  28. --------------
  29. 1. cd li-ops/cloud
  30. 2. Try to list all instances:
  31. ./cloud.rb gce list
  32. 3. Try to create an instance:
  33. ./cloud.rb gce launch -n ${USER}-minion1 -e int --type os3-minion