From c6919a09da31eb1574876b8b02be30c3cf5c4c0f Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Fri, 17 Feb 2023 11:26:11 -0500 Subject: [PATCH] replace centos --- salt/_modules/needs_restarting.py | 2 +- salt/allowed_states.map.jinja | 2 +- salt/common/init.sls | 2 +- salt/common/tools/sbin/so-analyst-install | 10 +++++----- salt/mysql/init.sls | 2 +- salt/repo/client/map.jinja | 18 +++++++++--------- salt/salt/init.sls | 8 +------- salt/salt/map.jinja | 2 +- salt/ssl/init.sls | 2 +- salt/top.sls | 6 +++--- salt/workstation/packages.sls | 2 +- salt/workstation/remove_gui.sls | 2 +- salt/workstation/trusted-ca.sls | 2 +- salt/workstation/xwindows.sls | 2 +- setup/so-functions | 2 +- 15 files changed, 29 insertions(+), 35 deletions(-) diff --git a/salt/_modules/needs_restarting.py b/salt/_modules/needs_restarting.py index 5afb6f02a..8f5b50242 100644 --- a/salt/_modules/needs_restarting.py +++ b/salt/_modules/needs_restarting.py @@ -10,7 +10,7 @@ def check(): if path.exists('/var/run/reboot-required'): retval = 'True' - elif os == 'CentOS': + elif os == 'Rocky': cmd = 'needs-restarting -r > /dev/null 2>&1' try: diff --git a/salt/allowed_states.map.jinja b/salt/allowed_states.map.jinja index 823b7b647..38f790053 100644 --- a/salt/allowed_states.map.jinja +++ b/salt/allowed_states.map.jinja @@ -262,7 +262,7 @@ {% do allowed_states.append('redis') %} {% endif %} - {% if grains.os == 'CentOS' %} + {% if grains.os == 'Rocky' %} {% if not ISAIRGAP %} {% do allowed_states.append('yum') %} {% endif %} diff --git a/salt/common/init.sls b/salt/common/init.sls index ea943ce4b..21c4ce369 100644 --- a/salt/common/init.sls +++ b/salt/common/init.sls @@ -235,7 +235,7 @@ soversionfile: {% endif %} {% if GLOBALS.so_model %} - {% if GLOBALS.os == 'CentOS' %} + {% if GLOBALS.os == 'Rocky' %} # Install Raid tools raidpkgs: pkg.installed: diff --git a/salt/common/tools/sbin/so-analyst-install b/salt/common/tools/sbin/so-analyst-install index f4eef07fa..4949989b0 100755 --- a/salt/common/tools/sbin/so-analyst-install +++ b/salt/common/tools/sbin/so-analyst-install @@ -6,8 +6,8 @@ # Elastic License 2.0. -{# we only want the script to install the workstation if it is CentOS -#} -{% if grains.os == 'CentOS' -%} +{# we only want the script to install the workstation if it is Rocky -#} +{% if grains.os == 'Rocky' -%} {# if this is a manager -#} {% 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 not CentOS #} +{#- if not Rocky #} {%- 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 -%} exit 0 diff --git a/salt/mysql/init.sls b/salt/mysql/init.sls index b2c4a2119..7287eb00d 100644 --- a/salt/mysql/init.sls +++ b/salt/mysql/init.sls @@ -14,7 +14,7 @@ mysqlpkgs: pkg.installed: - skip_suggestions: False - pkgs: - {% if grains['os'] != 'CentOS' %} + {% if grains['os'] != 'Rocky' %} {% if grains['oscodename'] == 'bionic' %} - python3-mysqldb {% elif grains['oscodename'] == 'focal' %} diff --git a/salt/repo/client/map.jinja b/salt/repo/client/map.jinja index abf824aeb..1e5d9351f 100644 --- a/salt/repo/client/map.jinja +++ b/salt/repo/client/map.jinja @@ -1,16 +1,16 @@ {% from 'vars/globals.map.jinja' import GLOBALS %} -{% if GLOBALS.os == 'CentOS' %} +{% if GLOBALS.os == 'Rocky' %} {% set REPOPATH = '/etc/yum.repos.d/' %} {% set ABSENTFILES = [ - 'CentOS-Base.repo', - 'CentOS-CR.repo', - 'CentOS-Debuginfo.repo', - 'CentOS-fasttrack.repo', - 'CentOS-Media.repo', - 'CentOS-Sources.repo', - 'CentOS-Vault.repo', - 'CentOS-x86_64-kernel.repo', + 'Rocky-Base.repo', + 'Rocky-CR.repo', + 'Rocky-Debuginfo.repo', + 'Rocky-fasttrack.repo', + 'Rocky-Media.repo', + 'Rocky-Sources.repo', + 'Rocky-Vault.repo', + 'Rocky-x86_64-kernel.repo', 'docker-ce.repo', 'epel.repo', 'epel-testing.repo', diff --git a/salt/salt/init.sls b/salt/salt/init.sls index 7a553ac51..da66e100e 100644 --- a/salt/salt/init.sls +++ b/salt/salt/init.sls @@ -1,6 +1,6 @@ {% from 'vars/globals.map.jinja' import GLOBALS %} -{% if GLOBALS.os != 'CentOS' %} +{% if GLOBALS.os != 'Rocky' %} saltpymodules: pkg.installed: - pkgs: @@ -18,9 +18,3 @@ salt_bootstrap: - name: /usr/sbin/bootstrap-salt.sh - source: salt://salt/scripts/bootstrap-salt.sh - 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 %} diff --git a/salt/salt/map.jinja b/salt/salt/map.jinja index 389a95607..d9f206fed 100644 --- a/salt/salt/map.jinja +++ b/salt/salt/map.jinja @@ -28,7 +28,7 @@ {% set INSTALLEDSALTVERSION = salt['pkg.version']('salt-minion').split(SPLITCHAR)[0] %} {% 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 %} {% elif grains.os|lower == 'ubuntu' %} {% set UPGRADECOMMAND = '/usr/sbin/bootstrap-salt.sh -s 120 -r -F -x python3 stable ' ~ SALTVERSION %} diff --git a/salt/ssl/init.sls b/salt/ssl/init.sls index 855a4a3ea..c251a706a 100644 --- a/salt/ssl/init.sls +++ b/salt/ssl/init.sls @@ -41,7 +41,7 @@ trusttheca: - name: /etc/ssl/certs/intca.crt - text: {{ trusttheca_text }} -{% if grains['os'] != 'CentOS' %} +{% if grains['os'] != 'Rocky' %} # Install packages needed for the sensor m2cryptopkgs: pkg.installed: diff --git a/salt/top.sls b/salt/top.sls index 4b8531f4d..f0b60deb5 100644 --- a/salt/top.sls +++ b/salt/top.sls @@ -29,7 +29,7 @@ base: - salt.minion-state-apply-test - salt.minion - 'G@os:CentOS and G@saltversion:{{saltversion}}': + 'G@os:Rocky and G@saltversion:{{saltversion}}': - match: compound - yum.packages @@ -377,10 +377,10 @@ base: {%- endif %} - 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 - 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 - workstation.remove_gui diff --git a/salt/workstation/packages.sls b/salt/workstation/packages.sls index b63762a2c..6b9b9c689 100644 --- a/salt/workstation/packages.sls +++ b/salt/workstation/packages.sls @@ -1,7 +1,7 @@ {% from 'vars/globals.map.jinja' import GLOBALS %} {# we only want this state to run it is CentOS #} -{% if GLOBALS.os == 'CentOS' %} +{% if GLOBALS.os == 'Rocky' %} xwindows_group: pkg.group_installed: diff --git a/salt/workstation/remove_gui.sls b/salt/workstation/remove_gui.sls index 0eefc9462..363b8c433 100644 --- a/salt/workstation/remove_gui.sls +++ b/salt/workstation/remove_gui.sls @@ -1,7 +1,7 @@ {% from 'vars/globals.map.jinja' import GLOBALS %} {# we only want this state to run it is CentOS #} -{% if GLOBALS.os == 'CentOS' %} +{% if GLOBALS.os == 'Rocky' %} remove_graphical_target: file.symlink: diff --git a/salt/workstation/trusted-ca.sls b/salt/workstation/trusted-ca.sls index fcdf7cffc..a8d48c046 100644 --- a/salt/workstation/trusted-ca.sls +++ b/salt/workstation/trusted-ca.sls @@ -1,7 +1,7 @@ {% from 'vars/globals.map.jinja' import GLOBALS %} {# 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_server = [] %} diff --git a/salt/workstation/xwindows.sls b/salt/workstation/xwindows.sls index bcd543868..d8fb53976 100644 --- a/salt/workstation/xwindows.sls +++ b/salt/workstation/xwindows.sls @@ -1,7 +1,7 @@ {% from 'vars/globals.map.jinja' import GLOBALS %} {# we only want this state to run it is CentOS #} -{% if GLOBALS.os == 'CentOS' %} +{% if GLOBALS.os == 'Rocky' %} include: - workstation.packages diff --git a/setup/so-functions b/setup/so-functions index 84d61a63c..085621acd 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -2150,7 +2150,7 @@ set_proxy() { "}" > /root/.docker/config.json # Set proxy for package manager - if [[ $is_centos ]]; then + if [[ $is_rocky ]]; then echo "proxy=$so_proxy" >> /etc/yum.conf else # Set it up so the updates roll through the manager