Skip to content

Commit

Permalink
unixPB: Add Docker support for SLES 12 (#3327)
Browse files Browse the repository at this point in the history
  • Loading branch information
aswinkr77 authored Feb 9, 2024
1 parent 52ed392 commit 7e63014
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,46 +55,46 @@
use: auto # automatic select package manager to use yum, apt and so on
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version | int >= 20)

- name: Install for SLES15 # zypper does not support in package module
- name: Install for SLES # zypper does not support in package module
include_tasks: sles.yml
when:
- ansible_distribution == "SLES" and ansible_distribution_major_version == "15"
- ansible_distribution == "SLES"

################
# Post Install #
################
- name: Add Jenkins user to the docker group for Ubuntu, Debian, SLES12, CentOS7 and RHEL7
- name: Add Jenkins user to the docker group for Ubuntu, Debian, SLES, CentOS7 and RHEL7
user:
name: "{{ Jenkins_Username }}"
groups: docker
append: yes
state: present
when:
- (ansible_distribution == "Ubuntu" or ansible_distribution == "Debian") or (ansible_distribution == "SLES" and ansible_distribution_major_version == "15") or ((ansible_distribution == "RedHat" or ansible_distribution == "CentOS" ) and ansible_distribution_major_version == "7")
- (ansible_distribution == "Ubuntu" or ansible_distribution == "Debian") or (ansible_distribution == "SLES") or ((ansible_distribution == "RedHat" or ansible_distribution == "CentOS" ) and ansible_distribution_major_version == "7")
- ansible_architecture != "riscv64"
tags:
- jenkins

- name: Add Nagios user to the docker group for Ubuntu, Debian, SLES12, CentOS7 and RHEL7
- name: Add Nagios user to the docker group for Ubuntu, Debian, SLES, CentOS7 and RHEL7
user:
name: nagios
groups: docker
append: yes
state: present
when:
- (ansible_distribution == "Ubuntu" or ansible_distribution == "Debian") or (ansible_distribution == "SLES" and ansible_distribution_major_version == "15") or ((ansible_distribution == "RedHat" or ansible_distribution == "CentOS" ) and ansible_distribution_major_version == "7")
- (ansible_distribution == "Ubuntu" or ansible_distribution == "Debian") or (ansible_distribution == "SLES") or ((ansible_distribution == "RedHat" or ansible_distribution == "CentOS" ) and ansible_distribution_major_version == "7")
- ansible_architecture != "riscv64"
- Nagios_Plugins == "Enabled"
tags:
- docker

- name: Enable and Start Docker Service for Ubuntu, Debian, SLES12, CentOS7 and RHEL7
- name: Enable and Start Docker Service for Ubuntu, Debian, SLES, CentOS7 and RHEL7
service:
name: docker
state: started
enabled: yes
when:
- (ansible_distribution == "Ubuntu" or ansible_distribution == "Debian") or (ansible_distribution == "SLES" and ansible_distribution_major_version == "15") or ((ansible_distribution == "RedHat" or ansible_distribution == "CentOS" ) and ansible_distribution_major_version == "7")
- (ansible_distribution == "Ubuntu" or ansible_distribution == "Debian") or (ansible_distribution == "SLES") or ((ansible_distribution == "RedHat" or ansible_distribution == "CentOS" ) and ansible_distribution_major_version == "7")
- ansible_architecture != "riscv64"
tags:
- docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
- name: Add Docker Repo for SLES15
command: zypper ar https://download.docker.com/linux/sles/docker-ce.repo
when:
- ansible_distribution_major_version == "15"
- ansible_architecture == "x86_64" or ansible_architecture == "s390x"

- name: Add security repo for container-selinux
community.general.zypper_repository:
- name: Add security repo for container-selinux for SLES 15
zypper_repository:
repo: https://download.opensuse.org/repositories/security:SELinux/SLE_15_SP3/security:SELinux.repo
state: present
auto_import_keys: yes
when:
- ansible_distribution_major_version == "15"
- ansible_architecture == "x86_64" or ansible_architecture == "s390x"

- name: Install Docker on SLES15
Expand All @@ -22,7 +24,18 @@
- docker-ce-cli
- containerd.io
when:
- ansible_distribution_major_version == "15"
- ansible_architecture == "x86_64" or ansible_architecture == "s390x"
tags:
# TODO: Package installs should not use latest
- skip_ansible_lint

- name: Install docker in SLES 12
package:
update_cache: yes
name: ['containerd', 'runc', 'docker']
state: latest
when:
- ansible_distribution == "SLES"
- ansible_distribution_major_version == "12"
- ansible_architecture != "aarch64" #no docker support for sles 12 aarch64

0 comments on commit 7e63014

Please sign in to comment.