-
Notifications
You must be signed in to change notification settings - Fork 1
/
registry.yml
66 lines (57 loc) · 1.81 KB
/
registry.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
---
- name: Deploy container registry
hosts: tag_Type_Docker
become: yes
roles:
- registry
tasks:
- name: Fetch Registry Certificate
fetch:
src: /etc/docker-distribution/server.crt
dest: /tmp/server.crt
flat: yes
- name: Push Container Images to registry
hosts: localhost
become: yes
tasks:
- name: Install Packages
yum:
name: docker,skopeo,docker-python
state: latest
- name: Start Docker
service:
name: docker
state: started
enabled: yes
- name: Create Docker Certificate Directory for Registry
file:
path: "/etc/docker/certs.d/{{ registry_hostname }}:5000"
state: directory
- name: Copy Registry Certificate into Docker
copy:
src: /tmp/server.crt
dest: "/etc/docker/certs.d/{{ registry_hostname }}:5000/server.crt"
- name: Login to Docker Registry
docker_login:
registry: "{{ registry_hostname }}:5000"
username: admin
password: "{{ registry_pw }}"
- name: Push Images to registry
shell: 'skopeo copy --dest-tls-verify=false dir://data/{{ item.split(" ")[0] }} docker://{{ registry_hostname }}:5000/{{ item.split(" ")[1] }}'
loop: "{{ lookup('file', 'images').splitlines() }}"
- name: Add Registry Certificate to OCP Nodes
hosts: tag_Type_OSE_App:tag_Type_OSE_Infra:tag_Type_OSE_Master
become: yes
tasks:
- name: Install Packages
yum:
name: docker
state: latest
- name: Create Docker Certificate Directory for Registry
file:
path: "/etc/docker/certs.d/{{ registry_hostname }}:5000"
state: directory
- name: Copy Registry Certificate into Docker
copy:
src: /tmp/server.crt
dest: "/etc/docker/certs.d/{{ registry_hostname }}:5000/server.crt"