From ec6a74e24a44d6fe8ea59633b6121964f8c1a847 Mon Sep 17 00:00:00 2001 From: pgrondek Date: Mon, 13 Apr 2020 17:42:34 +0200 Subject: [PATCH] add docker-x86 --- docker/docker.yml | 38 ++++++++++++++++++++++++++++++++++++++ inventory/hosts.yml | 29 +++++++++++++++++------------ 2 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 docker/docker.yml diff --git a/docker/docker.yml b/docker/docker.yml new file mode 100644 index 0000000..dcab3d9 --- /dev/null +++ b/docker/docker.yml @@ -0,0 +1,38 @@ +--- +- name: install docker + hosts: node-x86.lan + become_method: sudo + become_user: root + become: yes + + tasks: + - name: install needed packages + apt: + update_cache: yes + pkg: + - apt-transport-https + - ca-certificates + - curl + - gnupg-agent + - software-properties-common + - name: add docker gpg key + apt_key: + url: https://download.docker.com/linux/ubuntu/gpg + state: present + - name: add docker repo + apt_repository: + repo: deb https://download.docker.com/linux/ubuntu {{release}} stable + state: present + filename: docker + - name: install docker + apt: + update_cache: yes + pkg: + - docker-ce + - docker-ce-cli + - containerd.io + - name: add current user to docker group + user: + name: "{{ansible_user_id}}" + groups: docker + append: yes \ No newline at end of file diff --git a/inventory/hosts.yml b/inventory/hosts.yml index e9d77ee..0efed40 100644 --- a/inventory/hosts.yml +++ b/inventory/hosts.yml @@ -1,16 +1,21 @@ --- all: - hosts: - prusa.lan: - vars: - ansible_user: ubuntu - iron-man.lan: children: - docker_swarm: + server: hosts: - node-01.lan: - docker_node: node-01 - node-02.lan: - docker_node: node-02 - node-03.lan: - docker_node: node-03 + prusa.lan: + ansible_user: ubuntu + iron-man.lan: + children: + docker_swarm: + hosts: + node-01.lan: + docker_node: node-01 + node-02.lan: + docker_node: node-02 + node-03.lan: + docker_node: node-03 + node-x86.lan: + docker_node: node-x86 + ansible_host: 192.168.50.186 + release: bionic