Jonathan Hart | 93956f5 | 2017-08-22 13:12:42 -0700 | [diff] [blame] | 1 | |
| 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. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 17 | - 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. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 24 | mode: "0644" |
David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 25 | |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 26 | - name: Directories are present |
David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 27 | become: yes |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 28 | 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. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 37 | become: yes |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 38 | copy: |
| 39 | src: mirror-config.yml |
| 40 | dest: /data/registry-mirror/conf/config.yml |
| 41 | tags: [registry] |
| 42 | |
David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 43 | - name: Ensure Directories |
| 44 | become: yes |
| 45 | file: |
| 46 | path: /etc/maas |
| 47 | state: directory |
| 48 | owner: root |
| 49 | group: root |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 50 | mode: "0755" |
David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 51 | |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 52 | - name: Local Docker Registry |
| 53 | become: yes |
| 54 | template: |
| 55 | src: templates/{{ item }}.j2 |
| 56 | dest: /etc/maas/{{ item }} |
alshabib | 557cdc5 | 2016-06-17 16:44:29 -0700 | [diff] [blame] | 57 | owner: root |
| 58 | group: root |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 59 | mode: "0644" |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 60 | 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. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame] | 69 | changed_when: true |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 70 | tags: [registry] |