replace centos

This commit is contained in:
Mike Reeves
2023-02-17 11:26:11 -05:00
parent d8e85cbc28
commit c6919a09da
15 changed files with 29 additions and 35 deletions

View File

@@ -10,7 +10,7 @@ def check():
if path.exists('/var/run/reboot-required'): if path.exists('/var/run/reboot-required'):
retval = 'True' retval = 'True'
elif os == 'CentOS': elif os == 'Rocky':
cmd = 'needs-restarting -r > /dev/null 2>&1' cmd = 'needs-restarting -r > /dev/null 2>&1'
try: try:

View File

@@ -262,7 +262,7 @@
{% do allowed_states.append('redis') %} {% do allowed_states.append('redis') %}
{% endif %} {% endif %}
{% if grains.os == 'CentOS' %} {% if grains.os == 'Rocky' %}
{% if not ISAIRGAP %} {% if not ISAIRGAP %}
{% do allowed_states.append('yum') %} {% do allowed_states.append('yum') %}
{% endif %} {% endif %}

View File

@@ -235,7 +235,7 @@ soversionfile:
{% endif %} {% endif %}
{% if GLOBALS.so_model %} {% if GLOBALS.so_model %}
{% if GLOBALS.os == 'CentOS' %} {% if GLOBALS.os == 'Rocky' %}
# Install Raid tools # Install Raid tools
raidpkgs: raidpkgs:
pkg.installed: pkg.installed:

View File

@@ -6,8 +6,8 @@
# Elastic License 2.0. # Elastic License 2.0.
{# we only want the script to install the workstation if it is CentOS -#} {# we only want the script to install the workstation if it is Rocky -#}
{% if grains.os == 'CentOS' -%} {% if grains.os == 'Rocky' -%}
{# if this is a manager -#} {# if this is a manager -#}
{% if grains.master == grains.id.split('_')|first -%} {% if grains.master == grains.id.split('_')|first -%}
@@ -80,12 +80,12 @@ echo "Since this is not a manager, the pillar values to enable analyst workstati
{#- endif if this is a manager #} {#- endif if this is a manager #}
{% endif -%} {% endif -%}
{#- if not CentOS #} {#- if not Rocky #}
{%- else %} {%- else %}
echo "The Analyst Workstation can only be installed on CentOS. Please view the documentation at $doc_workstation_url." echo "The Analyst Workstation can only be installed on Rocky. Please view the documentation at $doc_workstation_url."
{#- endif grains.os == CentOS #} {#- endif grains.os == Rocky #}
{% endif -%} {% endif -%}
exit 0 exit 0

View File

@@ -14,7 +14,7 @@ mysqlpkgs:
pkg.installed: pkg.installed:
- skip_suggestions: False - skip_suggestions: False
- pkgs: - pkgs:
{% if grains['os'] != 'CentOS' %} {% if grains['os'] != 'Rocky' %}
{% if grains['oscodename'] == 'bionic' %} {% if grains['oscodename'] == 'bionic' %}
- python3-mysqldb - python3-mysqldb
{% elif grains['oscodename'] == 'focal' %} {% elif grains['oscodename'] == 'focal' %}

View File

@@ -1,16 +1,16 @@
{% from 'vars/globals.map.jinja' import GLOBALS %} {% from 'vars/globals.map.jinja' import GLOBALS %}
{% if GLOBALS.os == 'CentOS' %} {% if GLOBALS.os == 'Rocky' %}
{% set REPOPATH = '/etc/yum.repos.d/' %} {% set REPOPATH = '/etc/yum.repos.d/' %}
{% set ABSENTFILES = [ {% set ABSENTFILES = [
'CentOS-Base.repo', 'Rocky-Base.repo',
'CentOS-CR.repo', 'Rocky-CR.repo',
'CentOS-Debuginfo.repo', 'Rocky-Debuginfo.repo',
'CentOS-fasttrack.repo', 'Rocky-fasttrack.repo',
'CentOS-Media.repo', 'Rocky-Media.repo',
'CentOS-Sources.repo', 'Rocky-Sources.repo',
'CentOS-Vault.repo', 'Rocky-Vault.repo',
'CentOS-x86_64-kernel.repo', 'Rocky-x86_64-kernel.repo',
'docker-ce.repo', 'docker-ce.repo',
'epel.repo', 'epel.repo',
'epel-testing.repo', 'epel-testing.repo',

View File

@@ -1,6 +1,6 @@
{% from 'vars/globals.map.jinja' import GLOBALS %} {% from 'vars/globals.map.jinja' import GLOBALS %}
{% if GLOBALS.os != 'CentOS' %} {% if GLOBALS.os != 'Rocky' %}
saltpymodules: saltpymodules:
pkg.installed: pkg.installed:
- pkgs: - pkgs:
@@ -18,9 +18,3 @@ salt_bootstrap:
- name: /usr/sbin/bootstrap-salt.sh - name: /usr/sbin/bootstrap-salt.sh
- source: salt://salt/scripts/bootstrap-salt.sh - source: salt://salt/scripts/bootstrap-salt.sh
- mode: 755 - mode: 755
{% if GLOBALS.os == 'CentOS' %}
remove_salt-2019-2-5.repo:
file.absent:
- name: /etc/yum.repos.d/salt-2019-2-5.repo
{% endif %}

View File

@@ -28,7 +28,7 @@
{% set INSTALLEDSALTVERSION = salt['pkg.version']('salt-minion').split(SPLITCHAR)[0] %} {% set INSTALLEDSALTVERSION = salt['pkg.version']('salt-minion').split(SPLITCHAR)[0] %}
{% if grains.saltversion|string != SALTVERSION|string %} {% if grains.saltversion|string != SALTVERSION|string %}
{% if grains.os|lower in ['centos', 'redhat'] %} {% if grains.os|lower in ['Rocky', 'redhat'] %}
{% set UPGRADECOMMAND = 'yum clean all ; /usr/sbin/bootstrap-salt.sh -s 120 -r -F -x python3 stable ' ~ SALTVERSION %} {% set UPGRADECOMMAND = 'yum clean all ; /usr/sbin/bootstrap-salt.sh -s 120 -r -F -x python3 stable ' ~ SALTVERSION %}
{% elif grains.os|lower == 'ubuntu' %} {% elif grains.os|lower == 'ubuntu' %}
{% set UPGRADECOMMAND = '/usr/sbin/bootstrap-salt.sh -s 120 -r -F -x python3 stable ' ~ SALTVERSION %} {% set UPGRADECOMMAND = '/usr/sbin/bootstrap-salt.sh -s 120 -r -F -x python3 stable ' ~ SALTVERSION %}

View File

@@ -41,7 +41,7 @@ trusttheca:
- name: /etc/ssl/certs/intca.crt - name: /etc/ssl/certs/intca.crt
- text: {{ trusttheca_text }} - text: {{ trusttheca_text }}
{% if grains['os'] != 'CentOS' %} {% if grains['os'] != 'Rocky' %}
# Install packages needed for the sensor # Install packages needed for the sensor
m2cryptopkgs: m2cryptopkgs:
pkg.installed: pkg.installed:

View File

@@ -29,7 +29,7 @@ base:
- salt.minion-state-apply-test - salt.minion-state-apply-test
- salt.minion - salt.minion
'G@os:CentOS and G@saltversion:{{saltversion}}': 'G@os:Rocky and G@saltversion:{{saltversion}}':
- match: compound - match: compound
- yum.packages - yum.packages
@@ -377,10 +377,10 @@ base:
{%- endif %} {%- endif %}
- idh - idh
'J@workstation:gui:enabled:^[Tt][Rr][Uu][Ee]$ and ( G@saltversion:{{saltversion}} and G@os:CentOS )': 'J@workstation:gui:enabled:^[Tt][Rr][Uu][Ee]$ and ( G@saltversion:{{saltversion}} and G@os:Rocky )':
- match: compound - match: compound
- workstation - workstation
'J@workstation:gui:enabled:^[Ff][Aa][Ll][Ss][Ee]$ and ( G@saltversion:{{saltversion}} and G@os:CentOS )': 'J@workstation:gui:enabled:^[Ff][Aa][Ll][Ss][Ee]$ and ( G@saltversion:{{saltversion}} and G@os:Rocky )':
- match: compound - match: compound
- workstation.remove_gui - workstation.remove_gui

View File

@@ -1,7 +1,7 @@
{% from 'vars/globals.map.jinja' import GLOBALS %} {% from 'vars/globals.map.jinja' import GLOBALS %}
{# we only want this state to run it is CentOS #} {# we only want this state to run it is CentOS #}
{% if GLOBALS.os == 'CentOS' %} {% if GLOBALS.os == 'Rocky' %}
xwindows_group: xwindows_group:
pkg.group_installed: pkg.group_installed:

View File

@@ -1,7 +1,7 @@
{% from 'vars/globals.map.jinja' import GLOBALS %} {% from 'vars/globals.map.jinja' import GLOBALS %}
{# we only want this state to run it is CentOS #} {# we only want this state to run it is CentOS #}
{% if GLOBALS.os == 'CentOS' %} {% if GLOBALS.os == 'Rocky' %}
remove_graphical_target: remove_graphical_target:
file.symlink: file.symlink:

View File

@@ -1,7 +1,7 @@
{% from 'vars/globals.map.jinja' import GLOBALS %} {% from 'vars/globals.map.jinja' import GLOBALS %}
{# we only want this state to run it is CentOS #} {# we only want this state to run it is CentOS #}
{% if GLOBALS.os == 'CentOS' %} {% if GLOBALS.os == 'Rocky' %}
{% set global_ca_text = [] %} {% set global_ca_text = [] %}
{% set global_ca_server = [] %} {% set global_ca_server = [] %}

View File

@@ -1,7 +1,7 @@
{% from 'vars/globals.map.jinja' import GLOBALS %} {% from 'vars/globals.map.jinja' import GLOBALS %}
{# we only want this state to run it is CentOS #} {# we only want this state to run it is CentOS #}
{% if GLOBALS.os == 'CentOS' %} {% if GLOBALS.os == 'Rocky' %}
include: include:
- workstation.packages - workstation.packages

View File

@@ -2150,7 +2150,7 @@ set_proxy() {
"}" > /root/.docker/config.json "}" > /root/.docker/config.json
# Set proxy for package manager # Set proxy for package manager
if [[ $is_centos ]]; then if [[ $is_rocky ]]; then
echo "proxy=$so_proxy" >> /etc/yum.conf echo "proxy=$so_proxy" >> /etc/yum.conf
else else
# Set it up so the updates roll through the manager # Set it up so the updates roll through the manager