David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 1 | - name: Ensure Hostname Resolution |
| 2 | become: yes |
| 3 | lineinfile: |
| 4 | dest: /etc/hosts |
| 5 | line: 127.0.0.1 docker-registry |
| 6 | owner: root |
| 7 | group: root |
| 8 | mode: 0644 |
| 9 | |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 10 | - name: Directories are present |
David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 11 | become: yes |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 12 | file: |
| 13 | path: "{{ item }}" |
| 14 | state: directory |
| 15 | recurse: yes |
| 16 | with_items: |
| 17 | - /data/registry-mirror/conf |
| 18 | tags: [registry] |
| 19 | |
| 20 | - name: Configuration is copied |
David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 21 | become: yes |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 22 | copy: |
| 23 | src: mirror-config.yml |
| 24 | dest: /data/registry-mirror/conf/config.yml |
| 25 | tags: [registry] |
| 26 | |
David K. Bainbridge | f418170 | 2016-06-17 14:44:03 -0700 | [diff] [blame] | 27 | - name: Ensure Directories |
| 28 | become: yes |
| 29 | file: |
| 30 | path: /etc/maas |
| 31 | state: directory |
| 32 | owner: root |
| 33 | group: root |
| 34 | mode: 0755 |
| 35 | |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 36 | - name: Local Docker Registry |
| 37 | become: yes |
| 38 | template: |
| 39 | src: templates/{{ item }}.j2 |
| 40 | dest: /etc/maas/{{ item }} |
alshabib | 557cdc5 | 2016-06-17 16:44:29 -0700 | [diff] [blame] | 41 | owner: root |
| 42 | group: root |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 43 | mode: 0644 |
| 44 | with_items: |
| 45 | - registry-compose.yml |
| 46 | tags: [registry] |
| 47 | |
| 48 | - name: Ensure Local Registry Running |
| 49 | become: yes |
| 50 | command: docker-compose -f /etc/maas/{{ item }} up -d |
| 51 | with_items: |
| 52 | - registry-compose.yml |
David K. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame] | 53 | changed_when: true |
alshabib | cfb8d72 | 2016-06-15 15:17:37 -0700 | [diff] [blame] | 54 | tags: [registry] |