Initial commit of Docker role
Change-Id: I7326a4e1c784b0e27294d9ce11beb4be25386192
diff --git a/tasks/Debian.yml b/tasks/Debian.yml
new file mode 100644
index 0000000..8633b01
--- /dev/null
+++ b/tasks/Debian.yml
@@ -0,0 +1,42 @@
+---
+# docker tasks/Debian.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+- name: Install apt related prereqs
+ apt:
+ name:
+ - "apt-transport-https"
+ - "ca-certificates"
+ - "gpg"
+ - "software-properties-common"
+ state: "present"
+ update_cache: true
+
+- name: Add Docker apt repo key
+ apt_key:
+ data: "{{ lookup('file','docker.gpg') }}"
+ state: "present"
+
+# https://docs.docker.com/engine/install/debian/#install-using-the-repository
+- name: Add Official Docker apt repo
+ apt_repository:
+ repo: >-
+ deb https://download.docker.com/linux/{{ ansible_lsb['id'] | lower }}
+ {{ ansible_lsb['codename'] }} stable
+ mode: 0644
+ update_cache: true
+
+- name: Install Docker daemon apt package
+ apt:
+ name: "{{ docker_package }}={{ docker_apt_epoch }}:{{ docker_version }}*"
+ state: "present"
+ update_cache: true
+ cache_valid_time: 3600
+
+- name: Start and Enable Docker Service
+ service:
+ name: "{{ docker_service }}"
+ state: "started"
+ enabled: true
diff --git a/tasks/main.yml b/tasks/main.yml
new file mode 100644
index 0000000..5364bd1
--- /dev/null
+++ b/tasks/main.yml
@@ -0,0 +1,11 @@
+---
+# docker tasks/main.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+- name: include OS-specific vars
+ include_vars: "{{ ansible_os_family }}.yml"
+
+- name: include OS-specific tasks
+ include_tasks: "{{ ansible_os_family }}.yml"