Websoft9Archive / role_common

common role
Other
0 stars 5 forks source link

Cloud you install epel-release,centos-release-scl for Oracle Linux? #25

Closed chendelin1982 closed 2 years ago

chendelin1982 commented 2 years ago
yum install from url?
yum install https://archives.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-13.noarch.rpm
chendelin1982 commented 2 years ago

Tested solution

epel

# recommend
yum install oracle-epel-release-el8
yum install oracle-epel-release-el7

# Option
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

scl install solution

# OL7
yum install oracle-softwarecollection-release-el7

# OL8
yum install scl-utils

why scl-utils is release-scl? refer to here

Other package should install

yum install oracle-software-release-el7
yum install oracle-software-release-el8

Suggest code

- name: Install repo for OracleLinux
  shell:  |
    yum install oracle-epel-release-el{{ansible_distribution_major_version}}
    yum install oracle-software-release-el{{ansible_distribution_major_version}}
  when: ansible_distribution == 'OracleLinux'

- name: Install scl repo for OracleLinux7
  shell:  |
    yum install oracle-softwarecollection-release-el7
  when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == 7

- name: Install scl repo  for OracleLinux8
  shell:  |
    yum install scl-utils
  when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == 8
qiaofeng1227 commented 2 years ago

shell module error on ansible,It's ok by shell. changeto yum module

- name: Install repo for OracleLinux
  shell:  |
    yum install oracle-epel-release-el{{ansible_distribution_major_version}}

- name: Install epel repo for OracleLinux
  yum:
    name: oracle-epel-release-el{{ansible_distribution_major_version}}
  when: ansible_distribution == 'OracleLinux'
qiaofeng1227 commented 2 years ago

codeing as following

- block:
  - name: Install epel repo for OracleLinux
    yum:
      name: oracle-epel-release-el{{ansible_distribution_major_version}}

  - name: Install scl repo for OracleLinux
    yum:
      name: scl-utils
  when: ansible_distribution == 'OracleLinux'