Skip to content

Commit d522610

Browse files
committed
Configuration tool
1 parent 3fb4679 commit d522610

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed

devops/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM ubuntu:20.04
2+
3+
RUN apt-get update && apt-get install -y python3.9 && apt-get -y install python3-pip
4+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 && update-alternatives --set python /usr/bin/python3.9
5+
RUN apt-get install -y curl
6+
7+
## allows the container to continue running regardless of the PostgreSQL service inside the container
8+
ENTRYPOINT ["tail", "-f", "/dev/null"]
9+
## downside: need to manually start PostgreSQL in the container once the container is running

devops/ansible.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[defaults]
2+
auto_legacy = /usr/local/bin/python3
3+
4+

devops/tagserver_playbook.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
- hosts: all
3+
gather_facts: yes
4+
connection: docker
5+
6+
tasks:
7+
- name: Install apt-transport-https
8+
ansible.builtin.apt:
9+
name:
10+
- apt-transport-https
11+
- ca-certificates
12+
- lsb-release
13+
- gnupg
14+
state: latest
15+
update_cache: true
16+
17+
- name: Add signing key
18+
ansible.builtin.apt_key:
19+
url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg"
20+
state: present
21+
22+
- name: Add repository into sources list
23+
ansible.builtin.apt_repository:
24+
repo: "deb [arch={{ ansible_architecture }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
25+
state: present
26+
filename: docker
27+
28+
- name: Install Docker
29+
ansible.builtin.apt:
30+
name:
31+
- docker
32+
- docker.io
33+
#- docker-compose
34+
- docker-registry
35+
state: latest
36+
update_cache: true
37+
38+
- name: Install git
39+
apt:
40+
name: "{{ item }}"
41+
state: installed
42+
state: "{{ item.state | default('present') }}"
43+
with_items:
44+
- git
45+
- curl
46+
- systemctl
47+
- name: Install docker-compose
48+
command: curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
49+
- name: Create symbolic link for docker-compose
50+
command: ln -sf /usr/local/bin/docker-compose /usr/bin/docker-compose
51+
- name: Setting permissions right for docker-compose
52+
command: chmod +x /usr/local/bin/docker-compose
53+
- name: Cloning tagbase-server project
54+
git:
55+
repo: https://github.com/tagbase/tagbase-server.git
56+
dest: /root/tagbase-server
57+
clone: yes
58+
update: yes
59+
- name: Setting up tagbase-server env file
60+
copy:
61+
content: |
62+
63+
PGADMIN_DEFAULT_PASSWORD=tagbase
64+
POSTGRES_PASSWORD=tagbase
65+
POSTGRES_PORT=5432
66+
SLACK_BOT_CHANNEL=tagbase-server
67+
SLACK_BOT_TOKEN=XYZXYZ
68+
dest: /root/tagbase-server/.env
69+
- name: Build Tagbase services
70+
command: chdir=/root/tagbase-server docker-compose build
71+
- name: Deploy Tagbase services
72+
command: chdir=/root/tagbase-server docker-compose up

0 commit comments

Comments
 (0)