-
Notifications
You must be signed in to change notification settings - Fork 0
/
teamcityInstall.yml
67 lines (58 loc) · 2.03 KB
/
teamcityInstall.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
- name: Install TeamcityServer and Agent
gather_facts: false
hosts: "{{ host | default('all') }}"
vars:
tc_network: tc_net
tc_container_name: tcserver
agent_container_name: tcagent
tasks:
# - copy:
# src: tcBackup.zip
# dest: /root/tcBackup.zip
- name: Install packages
apt:
name: unzip
state: present
- name: Creates directory
file:
path: /root/tcBackup
state: directory
- name: Extract tcbackup
unarchive:
src: tcBackup.zip
dest: /root/tcBackup
- copy:
src: /root/.ssh/id_rsa
dest: /root/tcBackup/config/projects/DemoIacUtn/pluginData/ssh_keys/id_rsa
- name: "Create a network"
docker_network:
name: "{{ tc_network }}"
- name: "Launch Tc server container"
docker_container:
name: "{{ tc_container_name }}"
image: jetbrains/teamcity-server
ports:
- 8111:8111
volumes:
# - "/root/.ssh:/data/teamcity_server/datadir/config/projects/DemoIacUtn/pluginData/ssh_keys:rw"
- "/root/tcBackup/:/data/teamcity_server/datadir/:rw"
restart: true
networks:
- name: "{{ tc_network }}"
aliases:
- "{{ tc_container_name }}"
env:
discovery.type: single-node
- name: "Launch Tc Agent container"
docker_container:
name: "{{ agent_container_name }}"
image: jetbrains/teamcity-agent
links:
- "tcserver:tcserver"
restart: true
networks:
- name: "{{ tc_network }}"
aliases:
- "{{ agent_container_name }}"
env:
SERVER_URL: tcserver:8111