Configure hosts
This commit is contained in:
commit
1b4b62a625
42
playbook.yaml
Normal file
42
playbook.yaml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
- name: Configure swarm hosts
|
||||||
|
hosts:
|
||||||
|
- dockerswarm
|
||||||
|
tasks:
|
||||||
|
- name: Timezone
|
||||||
|
community.general.timezone:
|
||||||
|
name: America/Los_Angeles
|
||||||
|
- name: Prerequisites
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- ca-certificates
|
||||||
|
- curl
|
||||||
|
- gnupg
|
||||||
|
- lsb-release
|
||||||
|
- qemu-guest-agent
|
||||||
|
state: present
|
||||||
|
- name: Get repository gpg key
|
||||||
|
apt_key:
|
||||||
|
url: https://download.docker.com/linux/debian/gpg
|
||||||
|
state: present
|
||||||
|
- name: Set up repo
|
||||||
|
apt_repository:
|
||||||
|
repo: "deb https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
|
||||||
|
filename: docker
|
||||||
|
- name: Install packages
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- docker-ce
|
||||||
|
- docker-ce-cli
|
||||||
|
- containerd.io
|
||||||
|
- slirp4netns
|
||||||
|
- git
|
||||||
|
- name: Add debian user to docker group
|
||||||
|
user:
|
||||||
|
name: "{{ansible_user}}"
|
||||||
|
groups: docker
|
||||||
|
append: yes
|
||||||
|
- name: Install docker-compose
|
||||||
|
get_url:
|
||||||
|
url : https://github.com/docker/compose/releases/download/v2.2.0/docker-compose-linux-x86_64
|
||||||
|
dest: /usr/local/bin/docker-compose
|
||||||
|
mode: 'u+x,g+x'
|
||||||
Loading…
Reference in New Issue
Block a user