blob: a55ecad1ec8a72952d6141a6612b6fbcf867f4cf [file] [log] [blame]
David K. Bainbridgef4181702016-06-17 14:44:03 -07001- 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
alshabibcfb8d722016-06-15 15:17:37 -070010- name: Directories are present
David K. Bainbridgef4181702016-06-17 14:44:03 -070011 become: yes
alshabibcfb8d722016-06-15 15:17:37 -070012 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. Bainbridgef4181702016-06-17 14:44:03 -070021 become: yes
alshabibcfb8d722016-06-15 15:17:37 -070022 copy:
23 src: mirror-config.yml
24 dest: /data/registry-mirror/conf/config.yml
25 tags: [registry]
26
David K. Bainbridgef4181702016-06-17 14:44:03 -070027- 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
alshabibcfb8d722016-06-15 15:17:37 -070036- name: Local Docker Registry
37 become: yes
38 template:
39 src: templates/{{ item }}.j2
40 dest: /etc/maas/{{ item }}
alshabib557cdc52016-06-17 16:44:29 -070041 owner: root
42 group: root
alshabibcfb8d722016-06-15 15:17:37 -070043 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. Bainbridge17248c02016-08-29 17:04:34 -070053 changed_when: true
alshabibcfb8d722016-06-15 15:17:37 -070054 tags: [registry]