This repository has been archived by the owner on Dec 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
assign_agent.yml
77 lines (62 loc) · 2.15 KB
/
assign_agent.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
- name: Install GO CD Agent
hosts: goagents
user: root
tasks:
- name: Update Repositories
apt:
update_cache: yes
- name: GoCD Installation Pre Step 1
command: bash -c "echo "deb https://download.gocd.io /" | sudo tee /etc/apt/sources.list.d/gocd.list"
- name: GoCD Installation Pre Step 2
command: bash -c "curl https://download.gocd.io/GOCD-GPG-KEY.asc | sudo apt-key add -"
- name: Update Repositories and Install go-agent with version 17.0.2
apt:
name: go-agent=17.2.0-4587
update_cache: yes
- name: Docker Installation Pre Step 1
apt: name={{item}} state=installed
with_items:
- apt-transport-https
- ca-certificates
- software-properties-common
- name: Docker Installation Pre Step 2
command: bash -c "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -"
- name: Add Docker repository and update apt cache
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
mode: '644'
update_cache: yes
state: present
- name: Install Docker
apt:
name: docker-ce=17.03.0~ce-0~ubuntu-xenial
update_cache: yes
- name: Install Docker Compose Pre Step 1
command: bash -c "curl -L https://github.com/docker/compose/releases/download/1.11.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
- name: Install Docker Compose Pre Step 2
command: bash -c "chmod +x /usr/local/bin/docker-compose"
- name: Install Java 8 Open JDK
apt:
name: openjdk-8-jdk
- name: Copy GoCD Configuration
copy:
src: /vagrant/go-agent
dest: /etc/default
owner: root
group: root
mode: 0644
- name: Copy daemon.json for Docker Registry
copy:
src: /vagrant/daemon.json
dest: /etc/docker/
owner: root
group: root
mode: 0644
- name: Restart docker daemon
service:
name: docker
state: restarted
- name: Restart GoCD Agent
service:
name: go-agent
state: restarted