-
Notifications
You must be signed in to change notification settings - Fork 2
/
registry.yaml
36 lines (35 loc) · 1.47 KB
/
registry.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
- hosts: master
become: yes
tasks:
- name: Creating Registry Namespace
shell: kubectl create namespace registry >> registry_ns_created.info
become_user: ubuntu
args:
chdir: $HOME
creates: registry_ns_created.info
- name: Copy Docker Registry Configuration directory
become_user: ubuntu
copy:
src: registry-with-authentication
dest: ~/
- name: Prepairing Docker Registry Ingress Configuration
become_user: ubuntu
replace:
path: ~/registry-with-authentication/registry-ingress.yaml
regexp: "{{ item.regexp }}"
replace: "{{ item.var }}"
with_items:
- { regexp: 'registry_certificate', var: "{{ registry_certificate }}" }
- { regexp: 'registry_address_http', var: "{{ registry_address_http }}" }
- name: Deploying Docker Registry
become_user: ubuntu
shell: kubectl create -f {{ item.yaml }} >> registry_{{ item.file }}.info
with_items:
- { yaml: '~/registry-with-authentication/registry-deployment.yaml', file: 'deployment' }
- { yaml: '~/registry-with-authentication/registry-service.yaml', file: 'service' }
- { yaml: '~/registry-with-authentication/registry-ingress.yaml', file: 'ingress' }
- { yaml: '~/registry-with-authentication/configMap-docker.yaml', file: 'configmap' }
- { yaml: '~/registry-with-authentication/configMap-auth.yaml', file: 'auth' }
args:
chdir: $HOME
creates: registry_{{ item.file }}.info