From f5ddb084b6f850f23652432a85fe60254f3169c3 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Wed, 21 Apr 2021 18:22:44 -0400 Subject: [PATCH] create salt.helper-packages state, use it to install the patch package --- salt/common/init.sls | 2 -- salt/salt/helper-packages.sls | 3 +++ salt/salt/minion.sls | 1 + salt/salt/python3-influxdb.sls | 15 ++++++++++++--- 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 salt/salt/helper-packages.sls diff --git a/salt/common/init.sls b/salt/common/init.sls index 6d2a9aea7..cb6039756 100644 --- a/salt/common/init.sls +++ b/salt/common/init.sls @@ -95,7 +95,6 @@ commonpkgs: - python3-mysqldb - python3-packaging - git - - patch heldpackages: pkg.installed: @@ -135,7 +134,6 @@ commonpkgs: - lvm2 - openssl - git - - patch heldpackages: pkg.installed: diff --git a/salt/salt/helper-packages.sls b/salt/salt/helper-packages.sls new file mode 100644 index 000000000..93ad76a22 --- /dev/null +++ b/salt/salt/helper-packages.sls @@ -0,0 +1,3 @@ +patch_package: + pkg.installed: + - name: patch \ No newline at end of file diff --git a/salt/salt/minion.sls b/salt/salt/minion.sls index 41f9bfaf2..0dc8760cb 100644 --- a/salt/salt/minion.sls +++ b/salt/salt/minion.sls @@ -7,6 +7,7 @@ include: - salt + - salt.helper_packages - systemd.reload {% if INSTALLEDSALTVERSION|string != SALTVERSION|string %} diff --git a/salt/salt/python3-influxdb.sls b/salt/salt/python3-influxdb.sls index 36347cb95..b939c3380 100644 --- a/salt/salt/python3-influxdb.sls +++ b/salt/salt/python3-influxdb.sls @@ -2,6 +2,9 @@ {% from "salt/map.jinja" import SALT_MODULE_CODE_PATH with context %} {% from "salt/map.jinja" import PYTHON3INFLUX with context %} +include: + - salt.helper-packages + python3_influxdb: pkg.installed: - name: {{ PYTHON3INFLUX }} @@ -11,17 +14,23 @@ influxdb_continuous_query.present_patch: file.patch: - name: {{ SALT_STATE_CODE_PATH }}/influxdb_continuous_query.py - source: salt://salt/files/influxdb_continuous_query.py.patch - - pkg: python3_influxdb + - require: + - pkg: python3_influxdb + - pkg: patch_package #https://github.com/saltstack/salt/issues/59761 influxdb_retention_policy.present_patch: file.patch: - name: {{ SALT_STATE_CODE_PATH }}/influxdb_retention_policy.py - source: salt://salt/files/influxdb_retention_policy.py.patch - - pkg: python3_influxdb + - require: + - pkg: python3_influxdb + - pkg: patch_package influxdbmod.py_shard_duration_patch: file.patch: - name: {{ SALT_MODULE_CODE_PATH }}/influxdbmod.py - source: salt://salt/files/influxdbmod.py.patch - - pkg: python3_influxdb \ No newline at end of file + - require: + - pkg: python3_influxdb + - pkg: patch_package \ No newline at end of file