docker-distribution: Initial version of role
This commit is contained in:
parent
4547044a07
commit
fd8e0e8558
3 changed files with 44 additions and 0 deletions
5
roles/docker-distribution/handlers/main.yml
Normal file
5
roles/docker-distribution/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: restart docker-distribution
|
||||
service:
|
||||
name: docker-distribution
|
||||
state: restarted
|
20
roles/docker-distribution/tasks/main.yml
Normal file
20
roles/docker-distribution/tasks/main.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
- name: install packages
|
||||
package:
|
||||
name: docker-distribution
|
||||
state: installed
|
||||
|
||||
- name: create config file
|
||||
template:
|
||||
dest: /etc/docker-distribution/registry/config.yml
|
||||
src: config.yml.j2
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: restart docker-distribution
|
||||
|
||||
- name: start service
|
||||
service:
|
||||
name: docker-distribution
|
||||
state: started
|
||||
enabled: true
|
19
roles/docker-distribution/templates/config.yml.j2
Normal file
19
roles/docker-distribution/templates/config.yml.j2
Normal file
|
@ -0,0 +1,19 @@
|
|||
version: 0.1
|
||||
log:
|
||||
fields:
|
||||
service: registry
|
||||
storage:
|
||||
cache:
|
||||
layerinfo: inmemory
|
||||
filesystem:
|
||||
rootdirectory: /srv/registry
|
||||
http:
|
||||
addr: :5000
|
||||
tls:
|
||||
certificate: {{ tls_certs }}/{{ inventory_hostname }}.crt
|
||||
key: {{ tls_private }}/{{ inventory_hostname }}.key
|
||||
clientcas:
|
||||
- {{ tls_certs }}/ca.crt
|
||||
minimumtls: 1.3
|
||||
headers:
|
||||
X-Content-Type-Options: [nosniff]
|
Loading…
Add table
Reference in a new issue