docker_distribution: Rename role
This commit is contained in:
parent
c67990e462
commit
80b7adbcf8
5 changed files with 1 additions and 1 deletions
3
roles/docker_distribution/files/user.conf
Normal file
3
roles/docker_distribution/files/user.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
[Service]
|
||||
User=docker
|
||||
UMask=027
|
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
|
71
roles/docker_distribution/tasks/main.yml
Normal file
71
roles/docker_distribution/tasks/main.yml
Normal file
|
@ -0,0 +1,71 @@
|
|||
---
|
||||
- name: install packages
|
||||
package:
|
||||
name: docker-distribution
|
||||
state: installed
|
||||
|
||||
- name: create docker group
|
||||
group:
|
||||
name: docker
|
||||
gid: 1004
|
||||
|
||||
- name: create docker user
|
||||
user:
|
||||
name: docker
|
||||
comment: Service Docker-Registry
|
||||
createhome: false
|
||||
group: docker
|
||||
groups: hostkey
|
||||
home: /var/empty
|
||||
shell: /sbin/nologin
|
||||
uid: 1004
|
||||
|
||||
- name: create unit file drop-in directory
|
||||
file:
|
||||
path: /etc/systemd/system/docker-distribution.service.d
|
||||
state: directory
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: create unit file drop-in
|
||||
copy:
|
||||
dest: /etc/systemd/system/docker-distribution.service.d/user.conf
|
||||
src: user.conf
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: restart docker-distribution
|
||||
|
||||
- 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: create docker image directory
|
||||
file:
|
||||
path: /srv/registry/docker
|
||||
state: directory
|
||||
mode: 0770
|
||||
owner: root
|
||||
group: docker
|
||||
|
||||
- name: copy access file
|
||||
copy:
|
||||
dest: /etc/docker-distribution/registry/htpasswd
|
||||
src: "{{ htpasswd }}"
|
||||
mode: 0640
|
||||
owner: root
|
||||
group: docker
|
||||
when: htpasswd is defined
|
||||
notify: restart docker-distribution
|
||||
|
||||
- name: start service
|
||||
service:
|
||||
name: docker-distribution
|
||||
state: started
|
||||
enabled: true
|
28
roles/docker_distribution/templates/config.yml.j2
Normal file
28
roles/docker_distribution/templates/config.yml.j2
Normal file
|
@ -0,0 +1,28 @@
|
|||
version: 0.1
|
||||
log:
|
||||
fields:
|
||||
service: registry
|
||||
storage:
|
||||
cache:
|
||||
layerinfo: inmemory
|
||||
filesystem:
|
||||
rootdirectory: /srv/registry
|
||||
{% if htpasswd is defined %}
|
||||
auth:
|
||||
htpasswd:
|
||||
realm: Authentication Required
|
||||
path: /etc/docker-distribution/registry/htpasswd
|
||||
{% endif %}
|
||||
http:
|
||||
addr: :5000
|
||||
{% if docker_distribution_secret is defined %}
|
||||
secret: {{ secret }}
|
||||
{% endif %}
|
||||
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
Add a link
Reference in a new issue