changes for workstation

This commit is contained in:
m0duspwnens
2022-03-28 15:34:15 -04:00
parent 293de159db
commit 0ddfaf8d74
8 changed files with 41 additions and 4 deletions

View File

@@ -131,3 +131,6 @@ base:
{% endif %}
- global
- minions.{{ grains.id }}
'*_workstation':
- minions.{{ grains.id }}

View File

@@ -217,6 +217,8 @@
'schedule',
'docker_clean'
],
'so-workstation': [
],
}, grain='role') %}
{% if FILEBEAT and grains.role in ['so-helixsensor', 'so-eval', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-import', 'so-receiver'] %}

View File

@@ -367,7 +367,7 @@ run_check_net_err() {
exit $exit_code
fi
}
set_cron_service_name() {
set_cron_service_name() {
if [[ "$OS" == "centos" ]]; then
cron_service_name="crond"
else

View File

@@ -43,7 +43,7 @@ repair_yumdb:
crsynckeys:
file.recurse:
- name: /etc/pki/rpm_gpg
- name: /etc/pki/rpm-gpg
- source: salt://repo/client/files/centos/keys/
{% if not ISAIRGAP %}

View File

@@ -66,7 +66,7 @@ set_log_levels:
salt_minion_service_unit_file:
file.managed:
- name: /etc/systemd/system/multi-user.target.wants/salt-minion.service
- name: /usr/lib/systemd/system/salt-minion.service
- source: salt://salt/service/salt-minion.service.jinja
- template: jinja
- defaults:

View File

@@ -35,12 +35,15 @@ base:
'* and G@saltversion:{{saltversion}}':
- match: compound
- salt.minion
- common
- patch.os.schedule
- motd
- salt.minion-check
- salt.lasthighstate
'not *_workstation and G@saltversion:{{saltversion}}':
- match: compound
- common
'*_helixsensor and G@saltversion:{{saltversion}}':
- match: compound
- salt.master
@@ -507,3 +510,7 @@ base:
- docker_clean
- filebeat
- idh
'*_workstation and G@saltversion:{{saltversion}}':
- match: compound
- workstation

View File

@@ -1,2 +1,3 @@
include:
- workstation.xwindows
- workstation.trusted-ca

View File

@@ -0,0 +1,24 @@
{% set global_ca_text = [] %}
{% set global_ca_server = [] %}
{% set manager = salt['grains.get']('master') %}
{% set x509dict = salt['mine.get'](manager | lower~'*', 'x509.get_pem_entries') %}
{% for host in x509dict %}
{% if host.split('_')|last in ['manager', 'managersearch', 'standalone', 'import'] %}
{% do global_ca_text.append(x509dict[host].get('/etc/pki/ca.crt')|replace('\n', '')) %}
{% do global_ca_server.append(host) %}
{% endif %}
{% endfor %}
{% set trusttheca_text = global_ca_text[0] %}
{% set ca_server = global_ca_server[0] %}
trusted_ca:
x509.pem_managed:
- name: /etc/pki/ca-trust/source/anchors/ca.crt
- text: {{ trusttheca_text }}
update_ca_certs:
cmd.run:
- name: update-ca-trust
- onchanges:
- x509: trusted_ca