Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3803911
D1549.id3956.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D1549.id3956.diff
View Options
diff --git a/roles/freebsd-repo/init.sls b/roles/freebsd-repo/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/freebsd-repo/init.sls
@@ -0,0 +1,9 @@
+# -------------------------------------------------------------
+# Salt — FreeBSD repository
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .signing-key
diff --git a/roles/freebsd-repo/map.jinja b/roles/freebsd-repo/map.jinja
new file mode 100644
--- /dev/null
+++ b/roles/freebsd-repo/map.jinja
@@ -0,0 +1,10 @@
+# -------------------------------------------------------------
+# Salt — FreeBSD repository
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% set repo = {
+ 'signing_key_dir': '/usr/local/etc/freebsd-pkg-repo/key',
+} %}
diff --git a/roles/freebsd-repo/signing-key/init.sls b/roles/freebsd-repo/signing-key/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/freebsd-repo/signing-key/init.sls
@@ -0,0 +1,36 @@
+# -------------------------------------------------------------
+# Salt — FreeBSD repository
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "roles/freebsd-repo/map.jinja" import repo with context %}
+
+# -------------------------------------------------------------
+# Create key directory
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ repo.signing_key_dir }}:
+ file.directory
+
+# -------------------------------------------------------------
+# Generate a public/private key pair
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+signing_key_generate_private:
+ cmd.run:
+ - name: openssl genrsa -out repo.key 4096
+ - cwd: {{ repo.signing_key_dir }}
+ - creates: {{ repo.signing_key_dir }}/repo.key
+
+signing_key_generate_public:
+ cmd.run:
+ - name: openssl rsa -in repo.key -out repo.pub -pubout
+ - cwd: {{ repo.signing_key_dir }}
+ - creates: {{ repo.signing_key_dir }}/repo.pub
+
+{{ repo.signing_key_dir }}/repo.key:
+ file.managed:
+ replace: False
+ mode: 0400
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 19:20 (21 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2273432
Default Alt Text
D1549.id3956.diff (2 KB)
Attached To
Mode
D1549: Generate FreeBSD packages repository signing key
Attached
Detach File
Event Timeline
Log In to Comment