Skip to content

Commit

Permalink
UnixPB: Extend support of few docker related tasks to lastest OS vers…
Browse files Browse the repository at this point in the history
…ions (adoptium#3569)
  • Loading branch information
aswinkr77 authored May 23, 2024
1 parent 74b6b3c commit eaa77a3
Showing 1 changed file with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
################
# Pre Install #
################
- name: Prepare for RHEL/CentOS 7/8
- name: Prepare for RHEL/CentOS 7/8/9
include_tasks: rhel.yml
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS"
Expand All @@ -31,15 +31,15 @@
when:
- ansible_distribution == "Ubuntu"

- name: Prepare for Debian / Raspbian
- name: Prepare for Debian/Raspbian
include_tasks: debian.yml
when:
- ansible_distribution == "Debian"

##################
# Install Docker #
##################
- name: Install docker based on OS (Ubuntu, RHEL/CentOS 7/8, Debian)
- name: Install docker based on OS (Ubuntu, RHEL/CentOS 7/8/9, Debian)
package:
name:
- docker-ce
Expand Down Expand Up @@ -71,35 +71,33 @@
################
# Post Install #
################
- name: Add Jenkins user to the docker group for Ubuntu, Debian, SLES, CentOS7 and RHEL7
- name: Add Jenkins user to the docker group for Ubuntu, Debian, SLES, CentOS/RHEL 7/8/9
user:
name: "{{ Jenkins_Username }}"
groups: docker
append: yes
state: present
when:
- (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")
tags:
- jenkins
when: ((ansible_distribution == "RedHat" or ansible_distribution == "CentOS") and (ansible_distribution_major_version >= "7")) or
ansible_distribution == "Ubuntu" or ansible_distribution == "Debian" or ansible_distribution == "SLES"
tags: jenkins

- name: Add Nagios user to the docker group for Ubuntu, Debian, SLES, CentOS7 and RHEL7
- name: Add Nagios user to the docker group for Ubuntu, Debian, SLES, CentOS/RHEL 7/8/9
user:
name: nagios
groups: docker
append: yes
state: present
when:
- (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_distribution == "RedHat" or ansible_distribution == "CentOS") and (ansible_distribution_major_version >= "7")) or
ansible_distribution == "Ubuntu" or ansible_distribution == "Debian" or ansible_distribution == "SLES"
- Nagios_Plugins == "Enabled"
tags:
- docker
tags: docker

- name: Enable and Start Docker Service for Ubuntu, Debian, SLES, CentOS7 and RHEL7
- name: Enable and Start Docker Service for Ubuntu, Debian, SLES, CentOS/RHEL 7/8/9
service:
name: docker
state: started
enabled: yes
when:
- (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")
tags:
- docker
when: ((ansible_distribution == "RedHat" or ansible_distribution == "CentOS") and (ansible_distribution_major_version >= "7")) or
ansible_distribution == "Ubuntu" or ansible_distribution == "Debian" or ansible_distribution == "SLES"
tags: docker

0 comments on commit eaa77a3

Please sign in to comment.