All Projects → haxorof → ansible-role-docker-ce

haxorof / ansible-role-docker-ce

Licence: MIT license
Ansible role to install Docker CE on AlmaLinux/Rocky/CentOS/Fedora/RHEL(Redhat)/Ubuntu/Debian/Mint/Raspbian

Programming Languages

shell
77523 projects
Jinja
831 projects

Projects that are alternatives of or similar to ansible-role-docker-ce

Openvpn Install
OpenVPN road warrior installer for Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS and Fedora
Stars: ✭ 14,199 (+19350.68%)
Mutual labels:  debian, fedora, centos, rockylinux, almalinux
packer-kvm
Create VM templates with Packer for usage with Libvirt/KVM virtualization : CentOS 7, CentOS 8, CentOS 8 Stream, Alma Linux, Rocky Linux, Bionic (Ubuntu 1804), Focal (Ubuntu 2004), Debian 11 (stable), Kali Linux, Fedora 33 and Fedora 34.
Stars: ✭ 99 (+35.62%)
Mutual labels:  debian, fedora, centos, rockylinux, almalinux
wsl-distrod
Distrod is a meta-distro for WSL 2 which installs Ubuntu, Arch, Debian, Gentoo, etc. with systemd in a minute for you. Distrod also has built-in auto-start feature on Windows startup and port forwarding ability.
Stars: ✭ 1,637 (+2142.47%)
Mutual labels:  debian, fedora, centos, rockylinux, almalinux
distrobox
Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
Stars: ✭ 4,371 (+5887.67%)
Mutual labels:  fedora, centos, rockylinux, almalinux
Ansible Role Security
Ansible Role - Security
Stars: ✭ 398 (+445.21%)
Mutual labels:  debian, fedora, centos, rhel
ansible-kafka
Ansible role for installing and configuring Apache Kafka on RedHat and Debian platforms.
Stars: ✭ 56 (-23.29%)
Mutual labels:  debian, centos, ansible-role, rhel
ansible-role-daemonize
Ansible Role - Daemonize.
Stars: ✭ 14 (-80.82%)
Mutual labels:  debian, fedora, centos, rhel
Ansible Role Apache
Ansible Role - Apache 2.x.
Stars: ✭ 341 (+367.12%)
Mutual labels:  debian, fedora, centos, rhel
Robox
The tools needed to robotically create/configure/provision a large number of operating systems, for a variety of hypervisors, using packer.
Stars: ✭ 303 (+315.07%)
Mutual labels:  debian, fedora, centos, rhel
darknet.py
darknet.py is a network application with no dependencies other than Python and Tor, useful to anonymize the traffic of linux servers and workstations.
Stars: ✭ 71 (-2.74%)
Mutual labels:  debian, fedora, centos, rhel
Ansible Role Firewall
Ansible Role - iptables Firewall configuration.
Stars: ✭ 343 (+369.86%)
Mutual labels:  debian, fedora, centos, rhel
Fpm Within Docker
Leverage fpm inside pre-baked docker images in order to build and test native DEB and RPM packages.
Stars: ✭ 80 (+9.59%)
Mutual labels:  debian, fedora, centos, rhel
Anlinux Resources
Image and Script for LinuxOnAndroid App
Stars: ✭ 135 (+84.93%)
Mutual labels:  debian, fedora, centos
Anlinux Adfree
AnLinux, Ad free version.
Stars: ✭ 127 (+73.97%)
Mutual labels:  debian, fedora, centos
vagrant-templates
Vagrantfiles for self-contained development/test environments.
Stars: ✭ 28 (-61.64%)
Mutual labels:  debian, fedora, centos
Serverfarmer
Manage multiple servers with different operating systems, configurations, requirements etc. for many separate customers in an outsourcing model.
Stars: ✭ 122 (+67.12%)
Mutual labels:  debian, centos, rhel
Kvm Install Vm
Bash script to build local virtual machines using KVM/libvirt and cloud-init.
Stars: ✭ 248 (+239.73%)
Mutual labels:  debian, fedora, centos
Democratic Csi
csi storage for container orchestration systems
Stars: ✭ 120 (+64.38%)
Mutual labels:  debian, centos, rhel
s2i-ruby-container
Ruby container images based on Red Hat Software Collections and intended for OpenShift and general usage, that provide a platform for building and running Ruby applications. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
Stars: ✭ 55 (-24.66%)
Mutual labels:  fedora, centos, rhel
installer-linux
💾 SinusBot Installer for Debian, Ubuntu and CentOS - Installs the SinusBot with a single command.
Stars: ✭ 28 (-61.64%)
Mutual labels:  debian, fedora, centos

Ansible Role for Docker CE (Community Edition)

IMPORTANT! Even if this role does not list support for some distribution versions it might still work.

Ansible Role GitHub tag Ansible Quality Downloads License: MIT Build Status

This Ansible role installs and configures Docker CE (Community Edition) on several different Linux distributions. The goal is to let the user of this role to just care about how Docker shall be installed and configured and hide the differences that exists in the different distributions.

Features

  • One way to install and configure Docker CE across supported Linux distributions.
  • Support install of Docker SDK and Docker Compose.
  • Best effort support of installations of Docker plugins.
  • Best effort uninstall of Docker CE and related configuration
  • Do tweaks etc to avoid buggy or non-working configurations in some supported distributions.
  • Ease handling of setting up Docker according to Center of Internet Security (CIS) documentation.

Supported Distributions

  • AlmaLinux
  • CentOS
  • CentOS Stream1
  • Debian
  • Fedora
  • Linux Mint1 (based on Ubuntu).
  • Raspbian (based on Debian)
  • RHEL1
  • Rocky Linux
  • Ubuntu

1 NB: Docker does not officially support completely or partly Docker CE on this distribution and some features might/will not work.

Changelog

See changelog here

Ansible Compatibility

  • 2.10 or later

For this role to support multiple Ansible versions it is not possible to avoid all Ansible deprecation warnings. Read Ansible documentation if you want to disable deprecation warnings.

This role tries to support the latest and previous major release of Ansible version. For supported Ansible versions see here

Requirements

No additional requirements.

Role Variables

Variables related to this role are listed here

Dependencies

None.

Example Playbook

Following sub sections show different kind of examples to illustrate what this role supports.

Simplest

- hosts: docker
  roles:
    - role: haxorof.docker_ce

Configure Docker daemon to use proxy

- hosts: docker
  vars:
    docker_daemon_envs:
      HTTP_PROXY: http://localhost:3128/
      NO_PROXY: localhost,127.0.0.1,docker-registry.somecorporation.com
  roles:
    - haxorof.docker_ce

Ensure Ansible can use Docker modules after install

- hosts: test-host
  vars:
    docker_sdk: true
    docker_compose: true
  roles:
    - haxorof.docker_ce
  post_tasks:
    - name: Test hello container
      become: yes
      docker_container:
        name: hello
        image: hello-world

    - name: Test hello service
      become: yes
      docker_service:
        project_name: hello
        definition:
          version: '3'
          services:
            hello:
              image: "hello-world"

On the road to CIS security compliant Docker engine installation

This minimal example below show what kind of role configuration that is required to pass the Docker bench checks. However this configuration setup devicemapper in a certain way which will create logical volumes for the containers. Simplest is to have at least 3 GB of free space available in the partition. Since Docker v17.06 it is possible to just set the storage option dm.directlvm_device to make Docker create the necessary volumes:

- hosts: docker
  vars:
    docker_plugins:
      - type: authz
        alias: opa-docker-authz
        name: openpolicyagent/opa-docker-authz-v2:0.4
        args: opa-args="-policy-file /opa/policies/authz.rego"
    docker_enable_audit: yes
    docker_daemon_config:
      icc: false
      log-driver: journald
      userns-remap: default
      live-restore: true
      userland-proxy: false
      no-new-privileges: true
  roles:
    - haxorof.docker_ce

Because the configuration above requires Linux user namespaces to be enabled then additional GRUB arguments might be needed. Example below show one example what changes that might be needed and reboot of the host is required for the changes to take full affect.

# https://success.docker.com/article/user-namespace-runtime-error

- hosts: docker
  roles:
    - role: jtyr.grub_cmdline
      vars:
        grub_cmdline_add_args:
          - namespace.unpriv_enable=1
          - user_namespace.enable=1
      become: yes
  tasks:
    - name: set user.max_user_namespaces
      sysctl:
        name: user.max_user_namespaces
        value: 15000
        sysctl_set: yes
        state: present
        reload: yes
      become: yes

For a more complete working example on CentOS 7 have a look here.

Automated test matrix

Here is the latest test results of the automated test which is located in the tests directory:

Note! All distributions listed in test matrix below does not provided the latest released Docker CE version.

Last run: 2022-04-17 (Latest possible Docker CE release 20.10.14, Run with Ansible 4.10.0)

Test Suites

Suite ID Comment
s-1 t_config
s-2 t_channel Fail sometime since it might not be any nightly Docker CE build available
s-3 t_postinstall
s-4 t_devicemapper_config
s-5 t_auditd

Test Matrix

Symbol Definition
✔️ All tests passed
At least one test failed
No test done / Not yet tested
# s-1 s-2 s-3 s-4 s-5 updated
almalinux/8 ✔️ ✔️ ✔️ ✔️ 2022-04-17
centos/7 ✔️ ✔️ ✔️ ✔️ ✔️ 2022-04-17
centos/stream8 ✔️ ✔️ ✔️ ✔️ 2022-04-17
generic/debian10 ✔️ ✔️ ✔️ ✔️ 2022-04-17
generic/debian11 ✔️ ✔️ ✔️ ✔️ 2022-04-17
generic/fedora34 ✔️ ✔️ ✔️ ✔️ 2022-04-17
generic/fedora35 ✔️ ✔️ ✔️ ✔️ 2022-04-17
generic/rocky8 ✔️ ✔️ ✔️ ✔️ 2022-04-17
generic/ubuntu1804 ✔️ ✔️ ✔️ ✔️ ✔️ 2022-04-17
generic/ubuntu2004 ✔️ ✔️ ✔️ ✔️ 2022-04-17
generic/ubuntu2104 ✔️ ✔️ ✔️ ✔️ 2022-04-17
rhel/7 ✔️ ✔️ ✔️ ✔️ ✔️ 2021-06-19
rhel/8 ✔️ ✔️ ✔️ ✔️ 2021-06-19

License

This is an open source project under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].