Move files to submodule
This commit is contained in:
commit
dff3044422
6 changed files with 70 additions and 0 deletions
0
README.md
Normal file
0
README.md
Normal file
3
files/40-max-user-watches.conf
Normal file
3
files/40-max-user-watches.conf
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# increase open file limit
|
||||||
|
fs.inotify.max_user_instances=8192
|
||||||
|
fs.inotify.max_user_watches=1048576
|
24
tasks/docker_swarm.yml
Normal file
24
tasks/docker_swarm.yml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
- name: check for swarm
|
||||||
|
shell:
|
||||||
|
cmd: docker info | grep Swarm
|
||||||
|
register: validate_swarm
|
||||||
|
check_mode: false
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: init swarm
|
||||||
|
shell:
|
||||||
|
cmd: "docker swarm init || true "
|
||||||
|
when: validate_swarm.stdout.find('inactive') != -1
|
||||||
|
|
||||||
|
- name: check for network first
|
||||||
|
shell:
|
||||||
|
cmd: docker network ls | grep proxy
|
||||||
|
register: validate_proxy
|
||||||
|
check_mode: false
|
||||||
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
|
- name: create proxy network
|
||||||
|
shell:
|
||||||
|
cmd: "docker network create -d overlay --scope swarm proxy || true"
|
||||||
|
when: validate_proxy.stdout.find('swarm') == -1
|
9
tasks/main.yml
Normal file
9
tasks/main.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
- name: install docker packages
|
||||||
|
import_tasks: packages.yml
|
||||||
|
|
||||||
|
- name: docker tweaks
|
||||||
|
import_tasks: tweaks.yml
|
||||||
|
|
||||||
|
- name: init docker-swarm
|
||||||
|
tags: [docker_swarm]
|
||||||
|
import_tasks: docker_swarm.yml
|
30
tasks/packages.yml
Normal file
30
tasks/packages.yml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
- name: Add Docker GPG apt Key
|
||||||
|
apt_key:
|
||||||
|
url: https://download.docker.com/linux/debian/gpg
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add Docker Repository
|
||||||
|
apt_repository:
|
||||||
|
repo: deb https://download.docker.com/linux/debian bullseye stable
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: install docker packages
|
||||||
|
tags: [apt]
|
||||||
|
apt:
|
||||||
|
autoremove: yes
|
||||||
|
update_cache: yes
|
||||||
|
cache_valid_time: 3600
|
||||||
|
state: present
|
||||||
|
name:
|
||||||
|
- docker-ce
|
||||||
|
- docker-ce-cli
|
||||||
|
- containerd.io
|
||||||
|
- docker-buildx-plugin
|
||||||
|
- docker-compose-plugin
|
||||||
|
|
||||||
|
- name: start docker service
|
||||||
|
systemd:
|
||||||
|
daemon_reload: yes
|
||||||
|
state: started
|
||||||
|
enabled: yes
|
||||||
|
name: docker.service
|
4
tasks/tweaks.yml
Normal file
4
tasks/tweaks.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
- name: limit max open files in containers
|
||||||
|
copy:
|
||||||
|
src: 40-max-user-watches.conf
|
||||||
|
dest: /etc/sysctl.d/40-max-user-watches.conf
|
Loading…
Reference in a new issue