From 5f432e16c9256e28cb80c6bcad65527002f381d3 Mon Sep 17 00:00:00 2001 From: LinuxSquare <7436714-OfficialLinuxSquare@users.noreply.gitlab.com> Date: Sat, 30 Sep 2023 11:38:03 +0200 Subject: [PATCH] Move motd to candy-state, edit salt-minion config --- .gitignore | 1 + system/base.sls | 14 +------------- system/candy.sls | 12 ++++++++++++ system/files/{base_motd.jinja => candy_motd.jinja} | 0 system/files/salt_minion | 5 ++++- system/init.sls | 1 + 6 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 .gitignore create mode 100644 system/candy.sls rename system/files/{base_motd.jinja => candy_motd.jinja} (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..95fd796 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +system/files/systemupdate.sh \ No newline at end of file diff --git a/system/base.sls b/system/base.sls index 1ceaf93..b8f50fa 100644 --- a/system/base.sls +++ b/system/base.sls @@ -7,6 +7,7 @@ system_base_pkgs: - jq - vim - git + - findmnt system_base_bin_dir: file.directory: @@ -35,17 +36,4 @@ system_base_os-release: OS_VERSION: {{ salt['cmd.shell']('date "+%Y%m"') }} - user: root - group: root - - mode: '0644' - -system_base_motd: - file.managed: - - name: /etc/motd - - source: salt://{{ tpldir }}/files/base_motd.jinja - - template: jinja - - context: - OS_NAME: {{ salt['cmd.shell']('grep -E ^PRETTY_NAME /etc/os-release | cut -d= -f2') }} - OS_VERSION: {{ salt['cmd.shell']('grep -E ^VERSION_ID /etc/os-release | cut -d= -f2') }} - OS_ISSUE_URL: {{ salt['cmd.shell']('grep -E ^BUG_REPORT_URL /etc/os-release | cut -d= -f2') }} - - user: root - - group: root - mode: '0644' \ No newline at end of file diff --git a/system/candy.sls b/system/candy.sls new file mode 100644 index 0000000..9bf39df --- /dev/null +++ b/system/candy.sls @@ -0,0 +1,12 @@ +system_candy_motd: + file.managed: + - name: /etc/motd + - source: salt://{{ tpldir }}/files/candy_motd.jinja + - template: jinja + - context: + OS_NAME: {{ salt['cmd.shell']('grep -E ^PRETTY_NAME /etc/os-release | cut -d= -f2') }} + OS_VERSION: {{ salt['cmd.shell']('grep -E ^VERSION_ID /etc/os-release | cut -d= -f2') }} + OS_ISSUE_URL: {{ salt['cmd.shell']('grep -E ^BUG_REPORT_URL /etc/os-release | cut -d= -f2') }} + - user: root + - group: root + - mode: '0644' \ No newline at end of file diff --git a/system/files/base_motd.jinja b/system/files/candy_motd.jinja similarity index 100% rename from system/files/base_motd.jinja rename to system/files/candy_motd.jinja diff --git a/system/files/salt_minion b/system/files/salt_minion index 351b866..2d8963c 100644 --- a/system/files/salt_minion +++ b/system/files/salt_minion @@ -1,7 +1,10 @@ --- +state_verbose: False file_client: local file_roots: base: - /srv/salt -state_verbose: false +pillar_roots: + base: + - /srv/pillar ... diff --git a/system/init.sls b/system/init.sls index b0613a1..e7930e6 100644 --- a/system/init.sls +++ b/system/init.sls @@ -7,3 +7,4 @@ include: - .user - .shell - .salt + - .candy \ No newline at end of file