Notes
- https://www.journaldunet.com/solutions/cloud-computing/1146290-docker-la-technologie-qui-revolutionne-le-cloud/
- http://sametmax.com/redis-pourquoi-et-comment/
- https://web.leikir.io/docker-compose-un-outil-desormais-indispensable/
Rôles Ansible
Rôle qui installe docker-engine et docker-compose
---
- name: "Install Docker Engine"
tags: [docker-engine]
hosts: localhost
vars:
docker_apt_release_channel: stable # stable edge
docker_users: [userlab]
tasks:
- name: "ensure old versions of Docker are not installed"
package:
name: '{{ item }}'
state: absent
loop:
- docker
- docker-engine
- name: "ensure dependencies are installed"
apt:
name:
- apt-transport-https
- ca-certificates
state: present
when: ansible_distribution == 'Ubuntu'
- name: "add Docker apt key"
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
state: present
ignore_errors: True
when: ansible_distribution == 'Ubuntu'
- name: "add Docker repository"
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic {{ docker_apt_release_channel }}"
state: present
update_cache: yes
when: ansible_distribution == 'Ubuntu'
- name: "install Docker"
package:
name: "docker-ce"
state: present
- name: "ensure docker users are added to the docker group"
user:
name: "{{ item }}"
groups: docker
append: yes
loop: "{{ docker_users }}"
- name: "ensure Docker is started and enabled at boot"
service:
name: docker
state: started
enabled: yes
handlers:
- name: docker_restart
become: true
service:
name: docker
state: restarted
- name: "Install Docker Compose"
tags: [docker-compose]
hosts: localhost
vars:
docker_compose_bin: /usr/local/bin/docker-compose
docker_compose_version: latest
docker_compose_as_root: yes
tasks:
- name: check latest docker version
set_fact:
docker_compose_latest_version: "{{ lookup('url', 'https://github.com/docker/compose/releases/latest') | regex_findall('download/([0-9]+[.][0-9]+[.][0-9]+)') | first }}"
when: docker_compose_version == 'latest'
changed_when: false
- name: check installed docker compose version
shell: "{{ docker_compose_bin }} --version | awk -F'[ ,]' '{ print $3; }' | grep {{ docker_compose_latest_version | default(docker_compose_version) }}"
register: docker_compose_version_installed_result
failed_when: false
changed_when: false
- name: store installed docker compose version result
set_fact:
docker_compose_desired_version_installed: "{{ docker_compose_version_installed_result.rc == 0 }}"
- name: install docker-compose
become: '{{ docker_compose_as_root }}'
get_url:
url: 'https://github.com/docker/compose/releases/download/{{ docker_compose_latest_version | default(docker_compose_version) }}/docker-compose-{{ ansible_system }}-{{ ansible_architecture }}'
dest: '{{ docker_compose_bin }}'
force: true
mode: '555'
when: docker_compose_desired_version_installed == false
- https://github.com/Bessonov/ansible-role-docker
- https://github.com/Bessonov/ansible-role-docker-compose
- https://github.com/Bessonov/ansible-role-docker-swarm
- https://github.com/geerlingguy/ansible-role-docker
Dockerfile et docker-compose.yml
Services
- snort: https://github.com/goffinet/Snorter à expérimenter
- openvpn: https://github.com/Nyr/openvpn-install à porter
- bind9: https://github.com/sameersbn/docker-bind avec un vrai domaine
- isc-dhcp + isc-dhcpv6
Blogs
- ghost: https://github.com/goffinet/bash_factories/blob/master/ghost-nginx-letsencrypt-cloudflare_installation.sh
- wordpress:
- https://github.com/goffinet/aws-112018/blob/master/lab-automation-wordpress.md et notamment le script bash le plus abouti à porter : https://github.com/goffinet/aws-112018/blob/master/scripts/script8.sh
- https://docs.docker.com/compose/wordpress/#define-the-project
- https://github.com/scaleway-community/scaleway-wordpress/tree/master/latest
- plone: https://docs.plone.org/manage/docker/docs/index.html
- jekyll: