change how mine_functions.conf is managed during setup

This commit is contained in:
m0duspwnens
2023-09-29 16:17:19 -04:00
parent 1e327c143c
commit 8690304dff
4 changed files with 9 additions and 12 deletions

View File

@@ -1,8 +1,8 @@
mine_interval: 35 mine_interval: 35
mine_functions: mine_functions:
network.ip_addrs: network.ip_addrs:
- interface: {{ GLOBALS.main_interface }} - interface: {{ pillar.host.mainint }}
{% if GLOBALS.is_manager -%} {% if grains.role in ['so-eval','so-import','so-manager','so-managersearch','so-standalone'] -%}
x509.get_pem_entries: x509.get_pem_entries:
- glob_path: '/etc/pki/ca.crt' - glob_path: '/etc/pki/ca.crt'
{% endif -%} {% endif -%}

View File

@@ -0,0 +1,5 @@
mine_functions:
file.managed:
- name: /etc/salt/minion.d/mine_functions.conf
- source: salt://salt/etc/minion.d/mine_functions.conf.jinja
- template: jinja

View File

@@ -12,6 +12,7 @@ include:
- salt - salt
- systemd.reload - systemd.reload
- repo.client - repo.client
- salt.mine_functions
{% if INSTALLEDSALTVERSION|string != SALTVERSION|string %} {% if INSTALLEDSALTVERSION|string != SALTVERSION|string %}
@@ -78,14 +79,6 @@ salt_minion_service_unit_file:
{% endif %} {% endif %}
mine_functions:
file.managed:
- name: /etc/salt/minion.d/mine_functions.conf
- source: salt://salt/etc/minion.d/mine_functions.conf.jinja
- template: jinja
- defaults:
GLOBALS: {{ GLOBALS }}
# this has to be outside the if statement above since there are <requisite>_in calls to this state # this has to be outside the if statement above since there are <requisite>_in calls to this state
salt_minion_service: salt_minion_service:
service.running: service.running:

View File

@@ -649,8 +649,7 @@ configure_minion() {
"log_level_logfile: info"\ "log_level_logfile: info"\
"log_file: /opt/so/log/salt/minion" >> "$minion_config" "log_file: /opt/so/log/salt/minion" >> "$minion_config"
cp -f ../salt/salt/etc/minion.d/mine_functions.conf.jinja /etc/salt/minion.d/mine_functions.conf logCmd "salt-call state.apply salt.mine_functions -l info"
sed -i "s/{{ GLOBALS.main_interface }}/$MNIC/" /etc/salt/minion.d/mine_functions.conf
{ {
logCmd "systemctl enable salt-minion"; logCmd "systemctl enable salt-minion";