Ansible Playbook to install Go.
Model even the most complex build & deploy workflow with ease. Unlike CI servers, Go was built from the ground up with pipelines in mind. Go makes it simple to model failing fast, artifact promotion, self-service environments and single-click deployment.
Product details are available at http://www.go.cd . Source available at https://github.com/GoCD/GoCD
This repository is organized as a multi-role playbook. In order to use it in an existing playbook, you must reference the roles as follows:
roles:
- tpbrown.gocd/roles/common
- tpbrown.gocd/roles/agent
- tpbrown.gocd/roles/server
The default is to install the latest version of the server and agent. To force installation of a specific version override GOCD_GO_VERSION to the desired version.
The server listens on port 8153 by default.
Specify an email address for the Go administrator via GOCD_ADMIN_EMAIL. This is required.
Optionally install Git, Subversion, or Mercurial on all agent & server nodes by setting any of the following to true. Default is false.
A bash script to support automatic backups to Git is provided in /usr/share/go-server/backup_to_git.sh
Create a pipeline with two materials, 'remote' for the Git backup target, and 'local' for the embedded Git repo Go uses for configuration storage.
If security is enabled use ADMIN_USER and ADMIN_PASSWORD environment variables to specify security.
Below is a sample config of a pipeline that triggers a backup of Go every 10 minutes, or if the configuration changes. It uses SSH keys for authentication to Github as described later in this document. It shows ADMIN_PASSWORD as a standard variable, but you should use a secure variable.
<pipelines group="goAdmin">
<pipeline name="backupGo" isLocked="true">
<timer>0 10 * * * ?</timer>
<environmentvariables>
<variable name="ADMIN_USER">
<value>admin</value>
</variable>
<variable name="ADMIN_PASSWORD">
<value>insecure</value>
</variable>
</environmentvariables>
<materials>
<git url="git@github.com:YourUser/YourBackupRepo" dest="remote">
<filter>
<ignore pattern="*" />
</filter>
</git>
<git url="file:///var/lib/go-server/db/config.git" dest="local" />
</materials>
<stage name="defaultStage">
<jobs>
<job name="defaultJob">
<tasks>
<exec command="/bin/sh">
<arg>/usr/share/go-server/backup_to_git.sh</arg>
</exec>
</tasks>
<resources>
<resource>OnServer</resource>
</resources>
</job>
</jobs>
</stage>
</pipeline>
</pipelines>
This capability is basic now, but the goal is to support full configuration of Go via source control with no dependency on the UI. Hopefully this will include the ability to use individual pipeline configuration files that are included in the resulting Go configuration file.
THIS IS A WORK IN PROGRESS: PLEASE MONITOR YOUR GO LOGS TO DETECT INVALID CHANGES. Sorry.
This role can manage the base Go configuration, without losing agent or pipeline definitions.
Enable configuration by setting GOCD_CONFIGURE to true and supply an administrator email address.
SMTP/E-Mail notificationss
User Security
SSH keys. This is primarily for Github SSH access. Specify a keypair via attributes. The keys will be identical on all agents as well as the server. This is because the server monitors for changes, and agents actually handle the checkout.
Fork away! Pull requests are always appreciated. :-)
You should be able to do a vagrant up and have a running instance of this role. Take a look inside Vagrantfile and you'll notice we're forcing a role_path on Ansible.
It's been tested on Vagrant 1.5.1 thru 1.6.5 with VirtualBox primarily, with a little attention paid to Docker.
Vagrant 1.8.5 has also been tested. Should you encounter "Warning: Authentication Failure" when attempting to use vagrant up
, the issue can be remedied with this patch for Vagrant.