From 492d1d9f534e2145888e1eb22e950095a1215bed Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Wed, 30 Nov 2016 17:59:51 -0800 Subject: [PATCH] Delete unused file for deploying docker registry --- ansible/roles/docker_registry/tasks/main.yml | 76 -------------------- 1 file changed, 76 deletions(-) delete mode 100644 ansible/roles/docker_registry/tasks/main.yml diff --git a/ansible/roles/docker_registry/tasks/main.yml b/ansible/roles/docker_registry/tasks/main.yml deleted file mode 100644 index 0b2bba4e998..00000000000 --- a/ansible/roles/docker_registry/tasks/main.yml +++ /dev/null @@ -1,76 +0,0 @@ -- set_fact: - local_home: "{{lookup('env','HOME')}}" - -- name: Ensure directory exists - file: path=/home/{{ansible_user}}/certs/ mode=0755 state=directory - -- name: make sure SSL certificate exists - copy: - content: '{{ ssl_certificate }}' - dest: /home/{{ansible_user}}/certs/domain.crt - mode: 0600 - no_log: true - -- name: make sure SSL private key exists - copy: - content: '{{ ssl_private_key }}' - dest: /home/{{ansible_user}}/certs/domain.key - mode: 0600 - no_log: true - -- name: Ensure directory exists - file: path=/home/{{ansible_user}}/auth/ mode=0755 state=directory - -- name: make sure htpasswd exists - copy: - content: '{{ htpasswd }}' - dest: /home/{{ansible_user}}/auth/htpasswd - mode: 0600 - no_log: true - -# Ensure docker service started and enabled -# Note: keep it before all dockers -- name: Ensure docker service started and enabled - sudo: true - service: name=docker - state=started - enabled=yes - tags: always - -- name: Pull docker image from registry and run it in a container - docker: - name: registry - image: registry:2.3.1 - state: reloaded - pull: always - detach: yes - net: bridge - tty: yes - ## Note: stdin_open=yes will fulfill reload condition every time - stdin_open: no - ## TODO: use unless-stopped after Ansible 2.1 - ## unless-stopped: - ## Always restart the container regardless of the exit status, but do not start it on daemon startup - ## if the container has been put to a stopped state before. - ## always: - ## Always restart the container regardless of the exit status. When you specify always, the Docker daemon - ## will try to restart the container indefinitely. The container will also always start on daemon startup, - ## regardless of the current state of the container. - ## ref: https://docs.docker.com/engine/reference/run/#restart-policies-restart - restart_policy: always - ports: - - "5000:5000" - volumes: - - "/home/{{ansible_user}}/auth:/auth:ro" - - "/home/{{ansible_user}}/certs:/certs:ro" - env: - REGISTRY_AUTH: htpasswd - REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm - REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd - DEBUG: true - REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt - REGISTRY_HTTP_TLS_KEY: /certs/domain.key - REGISTRY_STORAGE: azure - REGISTRY_STORAGE_AZURE_ACCOUNTNAME: "{{REGISTRY_STORAGE_AZURE_ACCOUNTNAME}}" - REGISTRY_STORAGE_AZURE_ACCOUNTKEY: "{{REGISTRY_STORAGE_AZURE_ACCOUNTKEY}}" - REGISTRY_STORAGE_AZURE_CONTAINER: "registry"