From 79da5575bd7dd813043817d6f4927084ce00a633 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Thu, 14 Sep 2023 16:48:38 +0200 Subject: [PATCH] added python state --- states/python/defaults.yaml | 3 +++ states/python/init.sls | 4 ++++ states/python/map.jinja | 7 +++++++ 3 files changed, 14 insertions(+) create mode 100644 states/python/defaults.yaml create mode 100644 states/python/init.sls create mode 100644 states/python/map.jinja diff --git a/states/python/defaults.yaml b/states/python/defaults.yaml new file mode 100644 index 0000000..e697190 --- /dev/null +++ b/states/python/defaults.yaml @@ -0,0 +1,3 @@ +--- +python: + warning_file: /usr/lib/python3.11/EXTERNALLY-MANAGED diff --git a/states/python/init.sls b/states/python/init.sls new file mode 100644 index 0000000..ae9bdc9 --- /dev/null +++ b/states/python/init.sls @@ -0,0 +1,4 @@ +{%- from "python/map.jinja" import python with context %} +python-externally-managed: + file.absent: + - name: {{ python.warning_file }} diff --git a/states/python/map.jinja b/states/python/map.jinja new file mode 100644 index 0000000..6817b51 --- /dev/null +++ b/states/python/map.jinja @@ -0,0 +1,7 @@ +{%- import_yaml "python/defaults.yaml" as default_settings -%} + +{%- set defaults = salt['grains.filter_by'](default_settings, + default='python') +-%} + +{%- set python = salt['pillar.get']('python', default=defaults, merge=True) -%}