Page MenuHomeDevCentral

No OneTemporary

diff --git a/roles/salt-primary/software/files/autochmod-git.sh b/roles/salt-primary/software/files/autochmod-git.sh
new file mode 100755
index 0000000..b7c4052
--- /dev/null
+++ b/roles/salt-primary/software/files/autochmod-git.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# Sets permissions for a group-shared Git repository
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# If eligible, BSD-2-Clause
+# Source file: roles/salt-primary/software/files/autochmod-git.sh
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+set -e
+
+# -------------------------------------------------------------
+# Ensure user is root
+#
+# Note: POSIX shells don't always define $UID or $EUID.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+if [ "$(id -u)" -ne 0 ]; then
+ echo "This command must be run as root." >&2
+ exit 1
+fi
+
+# -------------------------------------------------------------
+# Git information
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+dir=$(git rev-parse --show-toplevel)
+
+# -------------------------------------------------------------
+# Let's chmod
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+set -x
+
+find "$dir" -print0 -type d | xargs -0 chmod g+xw
+find "$dir" -print0 -type f | xargs -0 chmod g+w
diff --git a/roles/salt-primary/software/init.sls b/roles/salt-primary/software/init.sls
index bd6c2a1..9326e42 100644
--- a/roles/salt-primary/software/init.sls
+++ b/roles/salt-primary/software/init.sls
@@ -1,30 +1,35 @@
# -------------------------------------------------------------
# Salt — Provision a salt primary server
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2018-10-04
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
{% from "map.jinja" import dirs, packages_prefixes with context %}
# -------------------------------------------------------------
# Additional software
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
install_salt_primary_extra_software:
pkg.installed:
- pkgs:
# Jenkins execution module
- {{ packages_prefixes.python3 }}python-jenkins
# For staging-commit-message
- {{ packages_prefixes.python3 }}gitpython
# Pillar
- {{ packages_prefixes.python3 }}salt-tower
# Utilities
- colordiff
{{ dirs.bin }}/staging-commit-message:
file.managed:
- source: salt://roles/salt-primary/software/files/staging-commit-message.py
- mode: 755
+
+{{ dirs.bin }}/autochmod-git:
+ file.managed:
+ - source: salt://roles/salt-primary/software/files/autochmod-git.sh
+ - mode: 755

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 06:36 (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259616
Default Alt Text
(3 KB)

Event Timeline