--- /dev/null
+---
+# Copyright 2019 Nokia
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+- name: create docker repository folders
+ file:
+ path: "{{ item }}"
+ state: directory
+ owner: dockerreg
+ group: dockerreg
+ mode: 0700
+ with_items:
+ - "{{ caas.registry_directory }}"
+ become_user: "root"
+
+- name: template main registry config
+ template:
+ src: main/dockerreg.yml
+ dest: /etc/docker-registry/docker-registry-main-config.yml
+ become_user: "root"
+
+- name: template update registry config
+ template:
+ src: update/dockerreg.yml
+ dest: /etc/docker-update-registry/docker-registry-update-config.yml
+ become_user: "root"
+
+- name: copy registry manifest files
+ template:
+ src: "{{ item }}"
+ dest: "{{ caas.manifests_directory }}/{{ item | basename }}"
+ with_items:
+ - main/docker-registry.yml
+ - update/docker-registry-update.yml
+ - main/registry_service.yml
+ - update/update_registry_service.yml
+
+- name: create kubernetes daemonset for registry
+ kubectl:
+ manifest: "{{ caas.manifests_directory }}/docker-registry.yml"
+ state: present
+
+- name: create kubernetes service for registry
+ kubectl:
+ manifest: "{{ caas.manifests_directory }}/registry_service.yml"
+ state: present
+
+- name: wait for registry kubernetes service to start
+ wait_for:
+ host: "{{ caas.registry_url }}"
+ port: "{{ caas.registry_port }}"
+ state: started
+ timeout: 60