blob: e371463c7290637b49723669e61c8624e55e4a2b [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
53 tags: [registry]