blob: 61583a09ed43596f958b833b6d569d99ea451011 [file] [log] [blame]
Jonathan Hart93956f52017-08-22 13:12:42 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
David K. Bainbridgef4181702016-06-17 14:44:03 -070017- name: Ensure Hostname Resolution
18 become: yes
19 lineinfile:
20 dest: /etc/hosts
21 line: 127.0.0.1 docker-registry
22 owner: root
23 group: root
David K. Bainbridge8b179042016-11-30 15:38:42 -080024 mode: "0644"
David K. Bainbridgef4181702016-06-17 14:44:03 -070025
alshabibcfb8d722016-06-15 15:17:37 -070026- name: Directories are present
David K. Bainbridgef4181702016-06-17 14:44:03 -070027 become: yes
alshabibcfb8d722016-06-15 15:17:37 -070028 file:
29 path: "{{ item }}"
30 state: directory
31 recurse: yes
32 with_items:
33 - /data/registry-mirror/conf
34 tags: [registry]
35
36- name: Configuration is copied
David K. Bainbridgef4181702016-06-17 14:44:03 -070037 become: yes
alshabibcfb8d722016-06-15 15:17:37 -070038 copy:
39 src: mirror-config.yml
40 dest: /data/registry-mirror/conf/config.yml
41 tags: [registry]
42
David K. Bainbridgef4181702016-06-17 14:44:03 -070043- name: Ensure Directories
44 become: yes
45 file:
46 path: /etc/maas
47 state: directory
48 owner: root
49 group: root
David K. Bainbridge8b179042016-11-30 15:38:42 -080050 mode: "0755"
David K. Bainbridgef4181702016-06-17 14:44:03 -070051
alshabibcfb8d722016-06-15 15:17:37 -070052- name: Local Docker Registry
53 become: yes
54 template:
55 src: templates/{{ item }}.j2
56 dest: /etc/maas/{{ item }}
alshabib557cdc52016-06-17 16:44:29 -070057 owner: root
58 group: root
David K. Bainbridge8b179042016-11-30 15:38:42 -080059 mode: "0644"
alshabibcfb8d722016-06-15 15:17:37 -070060 with_items:
61 - registry-compose.yml
62 tags: [registry]
63
64- name: Ensure Local Registry Running
65 become: yes
66 command: docker-compose -f /etc/maas/{{ item }} up -d
67 with_items:
68 - registry-compose.yml
David K. Bainbridge17248c02016-08-29 17:04:34 -070069 changed_when: true
alshabibcfb8d722016-06-15 15:17:37 -070070 tags: [registry]