-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
38 lines (32 loc) · 1000 Bytes
/
playbook.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
- name: Install Docker Registry
hosts: docker-registry
become: yes
vars_files:
- vars/credentials.yml
pre_tasks:
- name: create certificate
local_action: >
shell openssl req -batch -newkey rsa:4096 -nodes -sha256 -x509 -days 30
-subj '/C=RU/ST=Moscow/L=Moscow/O=Example Inc/OU=Example team'
-out ./files/registry.crt
-keyout ./files/registry.key
args:
creates: files/registry.key
- name: pull registry image
local_action: docker_image
args:
name: registry
tag: 2
- name: create htpasswd
local_action: >
shell docker run --entrypoint htpasswd registry:2 -Bbn {{ infra.registry.user }} {{ infra.registry.password }} > files/htpasswd
args:
creates: files/htpasswd
roles:
- role: docker-registry
docker_registry:
htpasswd: /tmp/htpasswd
tls:
certificate: files/registry.crt
key: files/registry.key
port: 5000