Page MenuHomeDevCentral

D2877.id7330.diff
No OneTemporary

D2877.id7330.diff

diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -51,10 +51,6 @@
The `pillar/ ` folder contains data about Eglide users,
-The repository contains a legacy scripts folder, not handled by Salt,
-and a config/forum for one set of our Discourse configuration.
-They can be migrated to the role/unit structure.
-
Contribute
----------
diff --git a/roles/core/userland-software/files/new-partition.sh b/roles/core/userland-software/files/new-partition.sh
new file mode 100755
--- /dev/null
+++ b/roles/core/userland-software/files/new-partition.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# Add a new partition to a device mapper volume group
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/core/userland-software/files/new-partition.sh
+#
+# Usage:
+# new-partition <device> <volume group>
+# <logical volume name> [mounting point]
+#
+# If the mounting point is omitted, disk is mounted
+# in /<logical volume name>
+#
+# Example:
+# new-partition /dev/sdb1 centos_dwellers wharf /wharf
+#
+# -------------------------------------------------------------
+#
+# <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>
+
+# Parses arguments
+
+if [ $# -lt 3 ] || [ $# -gt 4 ]; then
+ echo 'Usage: new-partition <device> <volume group>'
+ echo ' <logical volume name> [mounting point]'
+ exit 1
+fi
+
+DEVICE=$1
+VG=$2
+LVNAME=$3
+
+if [ $# -eq 4 ]; then
+ MOUNTING_POINT=$4
+else
+ MOUNTING_POINT=/$LVNAME
+fi
+
+# Creates, formats, mounts partion
+
+pvcreate "$DEVICE"
+vgextend "$VG" "$DEVICE"
+lvcreate -l 100%FREE -n "$LVNAME" "$VG"
+mkfs -t xfs "/dev/$VG/$LVNAME"
+echo "/dev/mapper/$VG-$LVNAME $MOUNTING_POINT xfs defaults 1 2" >> /etc/ftab
+mount "$MOUNTING_POINT"
diff --git a/roles/core/userland-software/init.sls b/roles/core/userland-software/init.sls
--- a/roles/core/userland-software/init.sls
+++ b/roles/core/userland-software/init.sls
@@ -145,3 +145,10 @@
file.symlink:
- target: /usr/local/bin/gnu-watch
{% endif %}
+
+{% if grains['os_family'] == 'RedHat' %}
+{{ dirs.bin }}/new-partition:
+ file.managed:
+ - source: salt://roles/core/userland-software/files/new-partition.sh
+ - mode: 755
+{% endif %}
diff --git a/scripts/byTasks/HTTP/check-letsencrypt-certificates b/roles/webserver-core/letsencrypt/files/check-letsencrypt-certificates.py
rename from scripts/byTasks/HTTP/check-letsencrypt-certificates
rename to roles/webserver-core/letsencrypt/files/check-letsencrypt-certificates.py
--- a/scripts/byTasks/HTTP/check-letsencrypt-certificates
+++ b/roles/webserver-core/letsencrypt/files/check-letsencrypt-certificates.py
@@ -10,6 +10,7 @@
# for the mapping directory webserver for each
# certificate to renew.
# License: BSD-2-Clause
+# Source file: roles/webserver-core/letsencrypt/files/check-letsencrypt-certificates.py
# -------------------------------------------------------------
# -------------------------------------------------------------
@@ -36,7 +37,7 @@
dirs = {
"/usr/local/etc/letsencrypt/renewal",
- "/srv/data/letsencrypt/etc/renewal"
+ "/srv/data/letsencrypt/etc/renewal",
}
@@ -59,7 +60,7 @@
def check_certificate(file):
- lines = [line.rstrip('\n') for line in open(file)]
+ lines = [line.rstrip("\n") for line in open(file)]
skip = True
for line in lines:
if not skip:
@@ -69,13 +70,13 @@
def check_mapping_line(line):
- params = line.split(' = ')
+ params = line.split(" = ")
check_mapping(params[0], params[1])
def get_challenge():
chars = string.ascii_letters + string.digits
- return ''.join([random.choice(chars) for _ in range(32)])
+ return "".join([random.choice(chars) for _ in range(32)])
def check_mapping(domain, directory):
@@ -85,14 +86,13 @@
def write_challenge_file(directory, challenge):
- challenge_file = os.path.join(
- directory, ".well-known", "acme-challenge", "qa")
+ challenge_file = os.path.join(directory, ".well-known", "acme-challenge", "qa")
with open(challenge_file, "w") as file:
file.write(challenge)
def check_challenge(domain, challenge):
- url = 'http://' + domain + '/.well-known/acme-challenge/qa'
+ url = "http://" + domain + "/.well-known/acme-challenge/qa"
try:
content = urlopen(url).read()
if not content == challenge:
diff --git a/roles/webserver-core/letsencrypt/software.sls b/roles/webserver-core/letsencrypt/software.sls
--- a/roles/webserver-core/letsencrypt/software.sls
+++ b/roles/webserver-core/letsencrypt/software.sls
@@ -32,3 +32,12 @@
{{ dirs.etc }}/letsencrypt/cli.ini:
file.managed:
- source: salt://roles/webserver-core/letsencrypt/files/cli.ini
+
+# -------------------------------------------------------------
+# Extra utilities
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ dirs.bin }}/check-letsencrypt-certificates:
+ file.managed:
+ - source: roles/webserver-core/letsencrypt/files/check-letsencrypt-certificates.py
+ - mode: 755
diff --git a/scripts/byOS/Fedora/new-partition.sh b/scripts/byOS/Fedora/new-partition.sh
deleted file mode 100755
--- a/scripts/byOS/Fedora/new-partition.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# Adds a new partition to a device mapper volume group
-#
-# Usage ..... new-partition <device> <volume group>
-# <logical volume name> [mounting point]
-# Example ... new-partition /dev/sdb1 centos_dwellers wharf /wharf
-# (or) new-partition /dev/sdb1 centos_dwellers wharf
-#
-# If mounting point is omitted, disk is mounted in /<logical volume name>
-#
-
-# Parses arguments
-
-if [ $# -lt 3 ] || [ $# -gt 4 ]; then
- echo 'Usage: new-partition <device> <volume group>'
- echo ' <logical volume name> [mounting point]'
- exit 1
-fi
-
-DEVICE=$1
-VG=$2
-LVNAME=$3
-
-if [ $# -eq 4 ]; then
- MOUNTING_POINT=$4
-else
- MOUNTING_POINT=/$LVNAME
-fi
-
-pvcreate "$DEVICE"
-vgextend "$VG" "$DEVICE"
-lvcreate -l 100%FREE -n "$LVNAME" "$VG"
-mkfs -t xfs "/dev/$VG/$LVNAME"
-echo "/dev/mapper/$VG-$LVNAME $MOUNTING_POINT xfs defaults 1 2" >> /etc/ftab
-mount "$MOUNTING_POINT"

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 17:58 (4 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2314157
Default Alt Text
D2877.id7330.diff (6 KB)

Event Timeline