Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

exclude_paths:
- .ansible/
- .cache/
- .github/

skip_list:
- no-handler
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
4 changes: 4 additions & 0 deletions .github/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- hosts: all
become: true
roles:
- role: docker_install
2 changes: 1 addition & 1 deletion .github/workflows/ansible_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6

- name: install dependencies
run: >
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.swp
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
Ansible: Install Docker Role
============================

This Ansible role installs the Docker CE repository and Docker itself.
This Ansible role installs the Docker CE repository and Docker itself on EL8/9/10.
It will start and enable the service so that the host is ready to run containers.

Supported Linux Distributions
-----------------------------use

This role supports:

- RHEL
- CentOS Stream
- Rocky Linux
- AlmaLinux OS

Version support:

- 10 (experimental)
- 9
- 8 (deprecated)

Example Playbook
----------------
Expand All @@ -14,5 +29,14 @@ Example of how to use the role:
- hosts: all
become: true
roles:
- role: elan.docker_install
- role: docker_install
```

Example `requirements.yml`:
```yaml
---
roles:
- src: https://github.com/virtUOS/docker_install.git
scm: git
version: 0.1.0
```
9 changes: 2 additions & 7 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
galaxy_info:
author: Lars Kiesow
role_name: docker_install
namespace: elan
company: ELAN e.V.
namespace: virtuos
company: Osnabrück University
description: Installs Docker CE on Red Hat based systems
license: BSD-3-Clause
min_ansible_version: 2.9.0
galaxy_tags:
- docker
- system
platforms:
- name: EL
versions:
- '8'
- '9'
dependencies: []
26 changes: 26 additions & 0 deletions tasks/el10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---

- name: Install kernel modules
ansible.builtin.package:
name: kernel-modules-extra
register: _extra_kernel_modules

- name: Reboot after installing kernel modules
ansible.builtin.reboot:
msg: Rebooting after module install
reboot_timeout: 300
post_reboot_delay: 30
when: _extra_kernel_modules.changed

- name: Re-gather facts after reboot
ansible.builtin.setup:
when: _extra_kernel_modules.changed

- name: Load kernel modules for iptables compaatibility on el10
community.general.modprobe:
name: '{{ item }}'
persistent: present
loop:
- xt_addrtype
- nf_nat
- nf_conntrack
5 changes: 4 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---

- name: Load kernel modules on el10
ansible.builtin.include_tasks: el10.yml
when: ansible_distribution_major_version == "10"

- name: Install docker repository
ansible.builtin.get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo
Expand All @@ -16,7 +20,6 @@
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: present

- name: Enable docker
ansible.builtin.service:
Expand Down
Loading