aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2019-10-16 16:25:41 +0000
committerPeter Mikus <pmikus@cisco.com>2019-10-17 08:14:25 +0000
commitd3e0654a57aa958aaef1906e4a759e521655a86b (patch)
treecc0548cf87706dee62451a07add29bbb398e30eb /resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml
parentbf0ea7aee82f32752c4b1a3abc1f60294fbc1f40 (diff)
Ansible: Role cleanup
+ Separate and reuse role (better naming) + Cleanup in naming + Introduce defaults that can be overriden Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: Iedaf7caba1d05a35a6f61cd21a483cdbc0073d32
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml54
1 files changed, 54 insertions, 0 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml
new file mode 100644
index 0000000000..368ddf5d1a
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml
@@ -0,0 +1,54 @@
+---
+# file: roles/docker/tasks/main.yaml
+
+- name: Docker - Install distribution - release - machine prerequisites
+ include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
+ tags: install-docker
+
+- name: Docker - Create Service Directory
+ file:
+ path: '/etc/systemd/system/docker.service.d'
+ state: 'directory'
+ tags: install-docker
+
+- name: Docker - Setup HTTP Proxy
+ template:
+ src: 'templates/docker.service.proxy.http'
+ dest: '/etc/systemd/system/docker.service.d/http-proxy.conf'
+ owner: 'root'
+ group: 'root'
+ mode: '0644'
+ when: >
+ proxy_env is defined and
+ proxy_env.http_proxy is defined
+ tags: install-docker
+
+- name: Docker - Setup HTTPS Proxy
+ template:
+ src: 'templates/docker.service.proxy.https'
+ dest: '/etc/systemd/system/docker.service.d/https-proxy.conf'
+ owner: 'root'
+ group: 'root'
+ mode: '0644'
+ when: >
+ proxy_env is defined and
+ proxy_env.https_proxy is defined
+ tags: install-docker
+
+- name: Docker - Reload systemd daemon and restart service
+ command: 'systemctl daemon-reload'
+ notify:
+ - 'Restart Docker'
+ when: >
+ proxy_env is defined and
+ proxy_env.http_proxy is defined
+ tags: install-docker
+
+- name: Docker - Set specific users to docker group
+ user:
+ name: '{{ item }}'
+ groups: 'docker'
+ append: True
+ with_items: '{{ docker_users }}'
+ when: docker_users
+ tags: install-docker