First commit

This commit is contained in:
Adrien Reslinger 2019-07-01 19:33:54 +02:00
parent 2fdc6b2ca9
commit 5cef7d19b1
Signed by: adrien
GPG key ID: DA7B27055C66D6DE
13 changed files with 182 additions and 1 deletions

37
tasks/Debian.yml Normal file
View file

@ -0,0 +1,37 @@
---
- name: add docker apt key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
when:
- docker_ver == "docker_ce"
- name: add docker repository
apt_repository: repo='deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ansible_distribution_release}} stable' state=present update_cache=yes
when:
- docker_ver == "docker_ce"
- name: "Ensure GRUB_CMDLINE_LINUX is updated"
lineinfile: dest=/etc/default/grub regexp='^(GRUB_CMDLINE_LINUX=".*)"$' line='\1 cgroup_enable=memory swapaccount=1"' backrefs=yes
when:
- not docker_installed.stat.exists
- name: "Update grub.conf"
command: update-grub
when:
- not docker_installed.stat.exists
- name: "Ensure DEFAULT_FORWARD_POLICY in /etc/default/ufw is updated"
lineinfile: dest=/etc/default/ufw regexp='^(DEFAULT_FORWARD_POLICY=").*"$' line='\1ACCEPT"' backrefs=yes
notify: reload ufw
tags: [docker,firewall]
# Need Certificat ? Only in local
#- name: "Add docker port 2376/TCP "
# ufw: rule=allow port=2376 proto=tcp
# notify: reload ufw
# tags: [docker,firewall]
#- name: "Start UFW rules"
# service: name=ufw state=started
# tags: [docker,firewall]