-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-reposilite.yaml
81 lines (70 loc) · 2 KB
/
install-reposilite.yaml
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
78
79
80
81
- name: Deploy docker compose files
hosts: maven-servers
become: yes
tasks:
- name: Update apt cache
apt:
update_cache: yes
# from https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-docker-on-ubuntu-20-04#step-4-adding-docker-image-and-container-tasks-to-your-playbook
- name: Install required system packages
apt:
pkg:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
- python3-pip
- virtualenv
- python3-setuptools
- debian-keyring
- debian-archive-keyring
state: latest
become: true
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
become: true
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu focal stable
state: present
become: true
- name: Update apt and install docker-ce
apt:
name: docker-ce
state: latest
become: true
- name: Create ghactions user
user:
name: ghactions
state: present
shell: /bin/bash
- name: Add ghactions user to docker group
user:
name: ghactions
groups: docker
append: yes
- name: Ensure Docker service is enabled and running
service:
name: docker
state: started
enabled: yes
- name: Copy reposilite folder over
copy:
src: files/reposilite
dest: /home/ghactions
owner: ghactions
group: ghactions
mode: 0755
- name: Tear down existing services
community.docker.docker_compose_v2:
project_src: /home/ghactions/reposilite
state: absent
- name: Create and start services
community.docker.docker_compose_v2:
project_src: /home/ghactions/reposilite
register: output
- name: Show results
ansible.builtin.debug:
var: output