From be8d9c68da52562a04feeceacf518c22d89e4d51 Mon Sep 17 00:00:00 2001 From: Asara Date: Sat, 29 Aug 2020 20:32:34 -0400 Subject: [PATCH] Add docker to requirements for running docker containers, add insecure docker registry --- ansible/host_vars/ivyking.minhas.io/main.yml | 3 +++ ansible/requirements.txt | 2 ++ ansible/roles/docker_registry/tasks/main.yml | 28 ++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 ansible/host_vars/ivyking.minhas.io/main.yml create mode 100644 ansible/roles/docker_registry/tasks/main.yml diff --git a/ansible/host_vars/ivyking.minhas.io/main.yml b/ansible/host_vars/ivyking.minhas.io/main.yml new file mode 100644 index 0000000..1d23bc5 --- /dev/null +++ b/ansible/host_vars/ivyking.minhas.io/main.yml @@ -0,0 +1,3 @@ +--- +docker_registry_mnt: /mnt/raid/docker_registry +... diff --git a/ansible/requirements.txt b/ansible/requirements.txt index 659e2db..50a0701 100644 --- a/ansible/requirements.txt +++ b/ansible/requirements.txt @@ -3,6 +3,7 @@ certifi==2020.6.20 cffi==1.14.2 chardet==3.0.4 cryptography==3.0 +docker==4.3.1 hvac==0.10.5 idna==2.10 Jinja2==2.11.2 @@ -12,3 +13,4 @@ PyYAML==5.3.1 requests==2.24.0 six==1.15.0 urllib3==1.25.10 +websocket-client==0.57.0 diff --git a/ansible/roles/docker_registry/tasks/main.yml b/ansible/roles/docker_registry/tasks/main.yml new file mode 100644 index 0000000..d9b67c9 --- /dev/null +++ b/ansible/roles/docker_registry/tasks/main.yml @@ -0,0 +1,28 @@ +--- +- name: debug + debug: + msg: "{{ lookup('hashi_vault', 'secret=pki_int/masked.name') }}" + +- name: ensure docker registry dir + file: + path: "{{ docker_registry_mnt }}" + state: directory + owner: root + group: root + mode: 0755 + +- name: ensure python-docker is installed + apt: + name: python3-docker + state: present + +- name: run docker registry + docker_container: + name: registry + image: registry:2 + ports: + - "5000:5000" + volumes: + - "{{ docker_registry_mnt }}:/var/lib/registry" + restart_policy: always +...