Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

GoCD Agent Creator ready for Docker and Docker Compose, using Ansible and Vagrant.

Notifications You must be signed in to change notification settings

hepsiburada/gocd-linux-agent-creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assigning GOCD agents with Ansible. You need a linux machine containing Ansible, thats why we use Vagrant.

How?

  • Your ansible installed linux machine, or vagranted virtual machine connects to each host mentioned in hosts
  • It installs go-agent, docker and docker compose
  • Related configuration is introduced
  • Done!

Installs Go Agent version 17.2.0-4587

Prerequisites

  • You already installed Vagrant and Oracle Virtual Machine.
  • Change agent ip list in hosts file
  • Change docker registry server ip in daemon.json

Creating a new virtual machine consisting ansible

  • Go to the root directory in bash/cmd. (root dir consists Vagrantfile)
  • vagrant up

Once Vagrant set the new vm, go inside it by: vagrant ssh

One time setup:

Adding your generated ssh key to the remotes: for each remote:

ubuntu@ubuntu-xenial:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ubuntu/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ubuntu/.ssh/id_rsa.
Your public key has been saved in /home/ubuntu/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:FoOStEG/xqbJuY/5Nu/IruFylc2k0SQwE8Llbi3IR0s ubuntu@ubuntu-xenial
The key's randomart image is:
+---[RSA 2048]----+
| ..oXo           |
|  .+ B...        |
|    E o+o        |
| . = =..oo       |
|  o * *BS        |
|   + B+.o        |
|    *.           |
|  ...*o.         |
|   o***+o        |
+----[SHA256]-----+
ubuntu@ubuntu-xenial:~$

$ ssh-copy-id root@REMOTE_IP

Assigining agents

  • change hosts file
  • run ansible-playbook -i hosts -s -u root assign_agent.yml

Agent restart may be needed for assigning docker group

About

GoCD Agent Creator ready for Docker and Docker Compose, using Ansible and Vagrant.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages