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_functions:
network.ip_addrs:
- interface: {{ GLOBALS.main_interface }}
{% if GLOBALS.is_manager -%}
- interface: {{ pillar.host.mainint }}
{% if grains.role in ['so-eval','so-import','so-manager','so-managersearch','so-standalone'] -%}
x509.get_pem_entries:
- glob_path: '/etc/pki/ca.crt'
{% 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
- systemd.reload
- repo.client
- salt.mine_functions
{% if INSTALLEDSALTVERSION|string != SALTVERSION|string %}
@@ -78,14 +79,6 @@ salt_minion_service_unit_file:
{% 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
salt_minion_service:
service.running:

View File

@@ -649,8 +649,7 @@ configure_minion() {
"log_level_logfile: info"\
"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
sed -i "s/{{ GLOBALS.main_interface }}/$MNIC/" /etc/salt/minion.d/mine_functions.conf
logCmd "salt-call state.apply salt.mine_functions -l info"
{
logCmd "systemctl enable salt-minion";