diff --git a/roles/install-docker/tasks/distro.yaml b/roles/install-docker/tasks/distros/Debian.yaml similarity index 73% rename from roles/install-docker/tasks/distro.yaml rename to roles/install-docker/tasks/distros/Debian.yaml index 52cd83632..99fd589ac 100644 --- a/roles/install-docker/tasks/distro.yaml +++ b/roles/install-docker/tasks/distros/Debian.yaml @@ -1,5 +1,5 @@ - name: Install docker become: yes package: - name: docker-engine + name: docker.io state: present diff --git a/roles/install-docker/tasks/distros/default.yaml b/roles/install-docker/tasks/distros/default.yaml new file mode 100644 index 000000000..d2c1da59d --- /dev/null +++ b/roles/install-docker/tasks/distros/default.yaml @@ -0,0 +1,5 @@ +- name: Install docker + become: yes + package: + name: docker + state: present diff --git a/roles/install-docker/tasks/main.yaml b/roles/install-docker/tasks/main.yaml index c6e5cb38f..875d7603b 100644 --- a/roles/install-docker/tasks/main.yaml +++ b/roles/install-docker/tasks/main.yaml @@ -14,8 +14,17 @@ include: upstream.yaml when: use_upstream_docker -- name: Install docker-engine from distro - include: distro.yaml +- name: Install docker from distro + include_tasks: "{{ lookup('first_found', params) }}" + vars: + params: + files: + - "{{ ansible_distribution }}.{{ ansible_architecture }}.yaml" + - "{{ ansible_distribution }}.yaml" + - "{{ ansible_os_family }}.yaml" + - "default.yaml" + paths: + - distros when: not use_upstream_docker - name: Add user to docker group