Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 1.53 KB

README.md

File metadata and controls

57 lines (45 loc) · 1.53 KB

First-Time Setup

  1. Go to Google Cloud console and search for "Service Accounts"
  2. Click "Create Service Account"
  3. Enter:
    • Name: legion
    • ID: legion (accept the default value)
    • Description: administer gitlab runner
  4. Click "Create and Continue"
  5. Enter:
    • Role: Editor
  6. Click "Continue"
  7. Click "Done" (skip the "Grant users access ..." dialogue)
  8. Under "Actions" click the vertical dots, then "Manage Keys"
  9. Click "Add Key", then "Create new key"
  10. Enter:
    • Key type: JSON
  11. Click "Create"
  12. Store the downloaded key securely on the local machine
  13. cp default.secrets.sh secrets.sh and update secrets.sh
  14. cp default.inventory.gcp.yml inventory.gcp.yml and update inventory.gcp.yml

Installation

Note: This creates a Conda installation and installs Ansible. (This happens to be the most reliable way to get a version-pinned Ansible, which is necessary to make sure everything is reproducible.)

./install.sh

Running

source env.sh
source secrets.sh
ansible-playbook playbook.yml

Execute Playbook in Steps

This is mainly useful as a time saving measure if you want to e.g. deploy repeatedly without reprovisioning.

ansible-playbook playbook.yml --tags provision
ansible-playbook playbook.yml --tags deploy

TODO

  • Figure out a way of automatically retrieving SSH host keys. One option inspired by 1 would be to use the gcloud CLI to SSH to the node and exfiltrate the keys.