From 5e449924797fbb9a2737d5f75a17ec0ba1ac47be Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:03:07 -0400 Subject: [PATCH 01/22] Create os_Rocky_8.yml --- vars/os_Rocky_8.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 vars/os_Rocky_8.yml diff --git a/vars/os_Rocky_8.yml b/vars/os_Rocky_8.yml new file mode 100644 index 0000000..0d888a6 --- /dev/null +++ b/vars/os_Rocky_8.yml @@ -0,0 +1,28 @@ +--- +docker_unit_after: "multi-user.target" +docker_storage_driver: overlay2 +bootloader_update_command: grub2-mkconfig -o /etc/grub2.cfg +conntrack_module: ip_conntrack + +# Docker version mapping +docker_version_map: + "19.03": + name: 'Docker-CE' + package: + - docker-ce-19.03.13 + - docker-ce-cli-19.03.13 + - containerd.io-1.5.11 + repo: https://download.docker.com/linux/centos/docker-ce.repo + keys: + server: https://download.docker.com/linux/centos/gpg + id: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35 + "20.10": + name: 'Docker-CE' + package: + - docker-ce-20.10.8 + - docker-ce-cli-20.10.8 + - containerd.io-1.5.11 + repo: https://download.docker.com/linux/centos/docker-ce.repo + keys: + server: https://download.docker.com/linux/centos/gpg + id: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35 From e245d7ca0d5ea9edab7fc84b3521b6546b512b8c Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:04:04 -0400 Subject: [PATCH 02/22] Create os_Rocky_9.yml --- vars/os_Rocky_9.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 vars/os_Rocky_9.yml diff --git a/vars/os_Rocky_9.yml b/vars/os_Rocky_9.yml new file mode 100644 index 0000000..0d888a6 --- /dev/null +++ b/vars/os_Rocky_9.yml @@ -0,0 +1,28 @@ +--- +docker_unit_after: "multi-user.target" +docker_storage_driver: overlay2 +bootloader_update_command: grub2-mkconfig -o /etc/grub2.cfg +conntrack_module: ip_conntrack + +# Docker version mapping +docker_version_map: + "19.03": + name: 'Docker-CE' + package: + - docker-ce-19.03.13 + - docker-ce-cli-19.03.13 + - containerd.io-1.5.11 + repo: https://download.docker.com/linux/centos/docker-ce.repo + keys: + server: https://download.docker.com/linux/centos/gpg + id: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35 + "20.10": + name: 'Docker-CE' + package: + - docker-ce-20.10.8 + - docker-ce-cli-20.10.8 + - containerd.io-1.5.11 + repo: https://download.docker.com/linux/centos/docker-ce.repo + keys: + server: https://download.docker.com/linux/centos/gpg + id: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35 From 8970996a493116cf286838b78b5edbb16d74746d Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:10:33 -0400 Subject: [PATCH 03/22] Create main.yml --- tasks/base/Rocky-8/main.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 tasks/base/Rocky-8/main.yml diff --git a/tasks/base/Rocky-8/main.yml b/tasks/base/Rocky-8/main.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tasks/base/Rocky-8/main.yml @@ -0,0 +1 @@ + From ee4c01ebc365b18e18cf00d8433bdbdc7ca8f0b3 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:11:31 -0400 Subject: [PATCH 04/22] Create main.yml --- tasks/base/Rocky-9/main.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 tasks/base/Rocky-9/main.yml diff --git a/tasks/base/Rocky-9/main.yml b/tasks/base/Rocky-9/main.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tasks/base/Rocky-9/main.yml @@ -0,0 +1 @@ + From 9d4ec2571aa3568c54f5affcab1325667f365364 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:12:19 -0400 Subject: [PATCH 05/22] Update main.yml --- tasks/base/Rocky-8/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasks/base/Rocky-8/main.yml b/tasks/base/Rocky-8/main.yml index 8b13789..73e4f26 100644 --- a/tasks/base/Rocky-8/main.yml +++ b/tasks/base/Rocky-8/main.yml @@ -1 +1,12 @@ +--- +- name: Disable firewalld + systemd: + name: firewalld + state: stopped + enabled: no + ignore_errors: true + +- include_tasks: install_dependencies.yml +- include_tasks: install_docker.yml + tags: [install_docker, destructive] From d26be13ec962c2b13cae0f2cf40cec1426fe7191 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:12:45 -0400 Subject: [PATCH 06/22] Update main.yml --- tasks/base/Rocky-9/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasks/base/Rocky-9/main.yml b/tasks/base/Rocky-9/main.yml index 8b13789..73e4f26 100644 --- a/tasks/base/Rocky-9/main.yml +++ b/tasks/base/Rocky-9/main.yml @@ -1 +1,12 @@ +--- +- name: Disable firewalld + systemd: + name: firewalld + state: stopped + enabled: no + ignore_errors: true + +- include_tasks: install_dependencies.yml +- include_tasks: install_docker.yml + tags: [install_docker, destructive] From 921b7e95fd6ee96bacba902d2f5a0045f33e19fd Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:30:31 -0400 Subject: [PATCH 07/22] Create install_dependencies.yml --- tasks/base/Rocky-8/install_dependencies.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 tasks/base/Rocky-8/install_dependencies.yml diff --git a/tasks/base/Rocky-8/install_dependencies.yml b/tasks/base/Rocky-8/install_dependencies.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tasks/base/Rocky-8/install_dependencies.yml @@ -0,0 +1 @@ + From c7c8b69ee98d387779014e53751033d1e282bd1b Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:31:00 -0400 Subject: [PATCH 08/22] Update install_dependencies.yml --- tasks/base/Rocky-8/install_dependencies.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/base/Rocky-8/install_dependencies.yml b/tasks/base/Rocky-8/install_dependencies.yml index 8b13789..c9a6c91 100644 --- a/tasks/base/Rocky-8/install_dependencies.yml +++ b/tasks/base/Rocky-8/install_dependencies.yml @@ -1 +1,8 @@ - +--- +- name: Install base dependencies + package: + name: "{{ item }}" + state: present + with_items: + - lvm2 + - iptables From 4c2e6826d820a65521711f0b8f489755e1476e19 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:31:24 -0400 Subject: [PATCH 09/22] Create install_dependencies.yml --- tasks/base/Rocky-9/install_dependencies.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 tasks/base/Rocky-9/install_dependencies.yml diff --git a/tasks/base/Rocky-9/install_dependencies.yml b/tasks/base/Rocky-9/install_dependencies.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tasks/base/Rocky-9/install_dependencies.yml @@ -0,0 +1 @@ + From a77260b1821829d86ba7b651137a520e1d916964 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:31:41 -0400 Subject: [PATCH 10/22] Update install_dependencies.yml --- tasks/base/Rocky-9/install_dependencies.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/base/Rocky-9/install_dependencies.yml b/tasks/base/Rocky-9/install_dependencies.yml index 8b13789..c9a6c91 100644 --- a/tasks/base/Rocky-9/install_dependencies.yml +++ b/tasks/base/Rocky-9/install_dependencies.yml @@ -1 +1,8 @@ - +--- +- name: Install base dependencies + package: + name: "{{ item }}" + state: present + with_items: + - lvm2 + - iptables From a7faabe8ff027653976cc17041f2adbc3a6809ce Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:32:12 -0400 Subject: [PATCH 11/22] Create install_docker.yml --- tasks/base/Rocky-8/install_docker.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 tasks/base/Rocky-8/install_docker.yml diff --git a/tasks/base/Rocky-8/install_docker.yml b/tasks/base/Rocky-8/install_docker.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tasks/base/Rocky-8/install_docker.yml @@ -0,0 +1 @@ + From 9311642fbcf37225ded015eb86717747095f7578 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:56:18 -0400 Subject: [PATCH 12/22] Update install_dependencies.yml --- tasks/base/Rocky-8/install_dependencies.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasks/base/Rocky-8/install_dependencies.yml b/tasks/base/Rocky-8/install_dependencies.yml index c9a6c91..931bcaf 100644 --- a/tasks/base/Rocky-8/install_dependencies.yml +++ b/tasks/base/Rocky-8/install_dependencies.yml @@ -3,6 +3,11 @@ package: name: "{{ item }}" state: present + # Note: Elastic doc'n calls for sysstat & net-tools, + # but the RedHat-8 version of this file omits them with_items: - lvm2 - iptables + - sysstat + - net-tools + From f5f8cd332ff5576630369d05f9723b637bf17a28 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:05:25 -0400 Subject: [PATCH 13/22] Update install_docker.yml --- tasks/base/Rocky-8/install_docker.yml | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tasks/base/Rocky-8/install_docker.yml b/tasks/base/Rocky-8/install_docker.yml index 8b13789..95768eb 100644 --- a/tasks/base/Rocky-8/install_docker.yml +++ b/tasks/base/Rocky-8/install_docker.yml @@ -1 +1,40 @@ +--- +- name: Remove docker + package: + name: "{{ packages }}" + state: absent + vars: + packages: + - docker + register: remove_packages + retries: 10 + delay: 30 + until: remove_packages is success +- name: disable SELinux + selinux: + state: disabled + +- name: Add Docker GPG Key + rpm_key: + key: "{{ docker_version_map[docker_version]['keys']['server'] }}" + state: present + +- name: Add RHEL8 Extras repository + shell: dnf config-manager --add-repo="{{ docker_version_map[docker_version]['repo'] }}" + register: repo_installed + retries: 10 + delay: 30 + until: repo_installed is success + +- name: Install docker + package: + name: "{{ docker_version_map[docker_version]['package'] }}" + state: present + +- name: Verify that fs.may_detach_mounts is enabled + lineinfile: + path: /etc/sysctl.conf + regexp: '^fs.may_detach_mounts' + line: 'fs.may_detach_mounts = 1' + create: yes From 8efcd852bdbc22add75ba435b0d839c3075b9f2e Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:05:58 -0400 Subject: [PATCH 14/22] Update install_dependencies.yml --- tasks/base/Rocky-8/install_dependencies.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/base/Rocky-8/install_dependencies.yml b/tasks/base/Rocky-8/install_dependencies.yml index 931bcaf..0789d12 100644 --- a/tasks/base/Rocky-8/install_dependencies.yml +++ b/tasks/base/Rocky-8/install_dependencies.yml @@ -10,4 +10,6 @@ - iptables - sysstat - net-tools + # for Rocky 9 + - containernetworking-plugins From f7b9d3ead7dab61caf1ba4c8869d1a23958c0f91 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:06:15 -0400 Subject: [PATCH 15/22] Update install_dependencies.yml --- tasks/base/Rocky-8/install_dependencies.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/base/Rocky-8/install_dependencies.yml b/tasks/base/Rocky-8/install_dependencies.yml index 0789d12..3b2d5d5 100644 --- a/tasks/base/Rocky-8/install_dependencies.yml +++ b/tasks/base/Rocky-8/install_dependencies.yml @@ -11,5 +11,5 @@ - sysstat - net-tools # for Rocky 9 - - containernetworking-plugins + # - containernetworking-plugins From 52d71822387bf3eb60518fdb8df233ec3fefcdcd Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:06:41 -0400 Subject: [PATCH 16/22] Update install_dependencies.yml --- tasks/base/Rocky-8/install_dependencies.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/base/Rocky-8/install_dependencies.yml b/tasks/base/Rocky-8/install_dependencies.yml index 3b2d5d5..68ae850 100644 --- a/tasks/base/Rocky-8/install_dependencies.yml +++ b/tasks/base/Rocky-8/install_dependencies.yml @@ -3,6 +3,7 @@ package: name: "{{ item }}" state: present + # Note: Elastic doc'n calls for sysstat & net-tools, # but the RedHat-8 version of this file omits them with_items: From 6d4ba957dd5432e907a2d177183fd618928d35f6 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:56:25 -0400 Subject: [PATCH 17/22] Update install_docker.yml --- tasks/base/Rocky-8/install_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/base/Rocky-8/install_docker.yml b/tasks/base/Rocky-8/install_docker.yml index 95768eb..fe6a2a5 100644 --- a/tasks/base/Rocky-8/install_docker.yml +++ b/tasks/base/Rocky-8/install_docker.yml @@ -20,7 +20,7 @@ key: "{{ docker_version_map[docker_version]['keys']['server'] }}" state: present -- name: Add RHEL8 Extras repository +- name: Add Rocky8 Extras repository shell: dnf config-manager --add-repo="{{ docker_version_map[docker_version]['repo'] }}" register: repo_installed retries: 10 From 778010dcf2c331062218f90e3266db575fd86298 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:58:36 -0400 Subject: [PATCH 18/22] Update install_docker.yml --- tasks/base/Rocky-8/install_docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/base/Rocky-8/install_docker.yml b/tasks/base/Rocky-8/install_docker.yml index fe6a2a5..416a21d 100644 --- a/tasks/base/Rocky-8/install_docker.yml +++ b/tasks/base/Rocky-8/install_docker.yml @@ -1,4 +1,6 @@ --- +# Note: this code is largely copied from the RedHat-8 version + - name: Remove docker package: name: "{{ packages }}" From 7c441f7a7cbeab2adb90375d57050f48cab5e853 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:04:20 -0400 Subject: [PATCH 19/22] Update main.yml --- meta/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meta/main.yml b/meta/main.yml index 7147124..2e00ee2 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -12,5 +12,8 @@ galaxy_info: - 22.04 - name: SLES versions: + - name: Rocky + versions: + - 8 -dependencies: [] \ No newline at end of file +dependencies: [] From acf7a41900f2e963c9f99dceb5df9299312907c8 Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:11:24 -0400 Subject: [PATCH 20/22] Update install_dependencies.yml --- tasks/base/Rocky-9/install_dependencies.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/base/Rocky-9/install_dependencies.yml b/tasks/base/Rocky-9/install_dependencies.yml index c9a6c91..01c9794 100644 --- a/tasks/base/Rocky-9/install_dependencies.yml +++ b/tasks/base/Rocky-9/install_dependencies.yml @@ -3,6 +3,13 @@ package: name: "{{ item }}" state: present + + # Note: Elastic doc'n calls for sysstat & net-tools, + # but the RedHat-8 version of this file omits them with_items: - lvm2 - iptables + - sysstat + - net-tools + # Elastic doc'n specifically mentions this for Rocky 9 + - containernetworking-plugins From 1b14fedd70f9a34179326eff4947c17cdbd2736e Mon Sep 17 00:00:00 2001 From: davidherst <153688743+davidherst@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:12:41 -0400 Subject: [PATCH 21/22] Create install_docker.yml --- tasks/base/Rocky-9/install_docker.yml | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tasks/base/Rocky-9/install_docker.yml diff --git a/tasks/base/Rocky-9/install_docker.yml b/tasks/base/Rocky-9/install_docker.yml new file mode 100644 index 0000000..8567033 --- /dev/null +++ b/tasks/base/Rocky-9/install_docker.yml @@ -0,0 +1,42 @@ +--- +# Note: this code is largely copied from the RedHat-8 version + +- name: Remove docker + package: + name: "{{ packages }}" + state: absent + vars: + packages: + - docker + register: remove_packages + retries: 10 + delay: 30 + until: remove_packages is success + +- name: disable SELinux + selinux: + state: disabled + +- name: Add Docker GPG Key + rpm_key: + key: "{{ docker_version_map[docker_version]['keys']['server'] }}" + state: present + +- name: Add Rocky9 Extras repository + shell: dnf config-manager --add-repo="{{ docker_version_map[docker_version]['repo'] }}" + register: repo_installed + retries: 10 + delay: 30 + until: repo_installed is success + +- name: Install docker + package: + name: "{{ docker_version_map[docker_version]['package'] }}" + state: present + +- name: Verify that fs.may_detach_mounts is enabled + lineinfile: + path: /etc/sysctl.conf + regexp: '^fs.may_detach_mounts' + line: 'fs.may_detach_mounts = 1' + create: yes From 2bcac82aee59fb54dc2dd1f10a53f6e7a6a276e7 Mon Sep 17 00:00:00 2001 From: David Herst <153688743+davidherst@users.noreply.github.com> Date: Fri, 4 Oct 2024 07:38:22 -0400 Subject: [PATCH 22/22] Update main.yml --- meta/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/main.yml b/meta/main.yml index 2e00ee2..c3e26a9 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -15,5 +15,6 @@ galaxy_info: - name: Rocky versions: - 8 + - 9 dependencies: []