4d91f29b39
This will make sure that the latest relevant images are in the local image storage, and therefore, will cause docker-compose up to recreate containers when the images are updated. Change-Id: Ic6f0bc8c8aea5b5c16501f4ab5d3095fb70c0ff7
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
- name: Synchronize docker-compose directory
|
|
synchronize:
|
|
src: registry-docker/
|
|
dest: /etc/registry-docker/
|
|
- name: Ensure registry volume directories exists
|
|
file:
|
|
state: directory
|
|
path: "/var/registry/{{ item }}"
|
|
loop:
|
|
- data
|
|
- certs
|
|
- auth
|
|
- name: Install passlib
|
|
package:
|
|
name:
|
|
- python3-passlib
|
|
- python3-bcrypt
|
|
state: present
|
|
- name: Write htpassword file
|
|
htpasswd:
|
|
create: true
|
|
crypt_scheme: bcrypt
|
|
path: /var/registry/auth/htpasswd
|
|
name: "{{ registry_user }}"
|
|
password: "{{ registry_password }}"
|
|
- name: Write TLS private key
|
|
copy:
|
|
content: "{{ registry_tls_key }}"
|
|
dest: /var/registry/certs/domain.key
|
|
- name: Write TLS certificate
|
|
copy:
|
|
content: "{{ registry_tls_cert }}{{ registry_tls_chain | default('') }}"
|
|
dest: /var/registry/certs/domain.crt
|
|
- name: Install docker-compose
|
|
package:
|
|
name:
|
|
- docker-compose
|
|
state: present
|
|
- name: Run docker-compose pull
|
|
shell:
|
|
cmd: docker-compose pull
|
|
chdir: /etc/registry-docker/
|
|
- name: Run docker-compose up
|
|
shell:
|
|
cmd: docker-compose up -d
|
|
chdir: /etc/registry-docker/
|