Page MenuHomeDevCentral

D1549.id3960.diff
No OneTemporary

D1549.id3960.diff

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,41 @@
+# -------------------------------------------------------------
+# 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:
+ - makedirs: True
+ - user: builder
+
+# -------------------------------------------------------------
+# 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
+ - runas: builder
+
+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
+ - runas: builder
+
+{{ repo.signing_key_dir }}/repo.key:
+ file.managed:
+ - replace: False
+ - mode: 0400
+ - user: builder

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 06:33 (10 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259613
Default Alt Text
D1549.id3960.diff (2 KB)

Event Timeline