Page MenuHomeDevCentral

D2446.diff
No OneTemporary

D2446.diff

diff --git a/roles/dpkg-repo/init.sls b/roles/dpkg-repo/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/dpkg-repo/init.sls
@@ -0,0 +1,9 @@
+# -------------------------------------------------------------
+# Salt — Debian repository
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .repo
diff --git a/roles/dpkg-repo/map.jinja b/roles/dpkg-repo/map.jinja
new file mode 100644
--- /dev/null
+++ b/roles/dpkg-repo/map.jinja
@@ -0,0 +1,14 @@
+# -------------------------------------------------------------
+# Salt — Debian repository
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% set repo = {
+ 'repo_dir': '/var/repo/dpkg/',
+ 'repo_package': 'dpkg-dev'
+},
+ packages_deb = {
+ 'woof_20091227-2.1': 'http://ftp.fr.debian.org/debian/pool/main/w/woof/woof_20091227-2.1_all.deb',
+} %}
diff --git a/roles/dpkg-repo/repo/files/Makefile b/roles/dpkg-repo/repo/files/Makefile
new file mode 100644
--- /dev/null
+++ b/roles/dpkg-repo/repo/files/Makefile
@@ -0,0 +1,32 @@
+# -------------------------------------------------------------
+# FreeBSD repository
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/freebsd-repo/repo/files/Makefile
+# -------------------------------------------------------------
+#
+# <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>
+
+METADATA=digests.txz meta.txz packagesite.txz
+
+# -------------------------------------------------------------
+# Main targets
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+all: build-repo
+
+clean:
+ rm -f $(METADATA)
+
+# -------------------------------------------------------------
+# Build targets
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+build-repo:
+ pkg repo . signing_command: sign-freebsd-repo
diff --git a/roles/dpkg-repo/repo/files/sign-freebsd-repo.sh.jinja b/roles/dpkg-repo/repo/files/sign-freebsd-repo.sh.jinja
new file mode 100644
--- /dev/null
+++ b/roles/dpkg-repo/repo/files/sign-freebsd-repo.sh.jinja
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# FreeBSD repository
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source: man 8 pkg-repo
+# Source file: roles/freebsd-repo/repo/files/sign-freebsd-repo.sh.jinja
+# -------------------------------------------------------------
+#
+# <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>
+
+KEY_DIR={{ keydir }}
+
+read -t 2 sum
+[ -z "$sum" ] && exit 1
+echo SIGNATURE
+echo -n "$sum" | /usr/bin/openssl dgst -sign "$KEY_DIR/repo.key" -sha256 -binary
+echo
+echo CERT
+cat "$KEY_DIR/repo.pub"
+echo END
diff --git a/roles/dpkg-repo/repo/init.sls b/roles/dpkg-repo/repo/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/dpkg-repo/repo/init.sls
@@ -0,0 +1,46 @@
+# -------------------------------------------------------------
+# Salt — Dpkg repository
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "roles/debian-repo/map.jinja" import repo with context %}
+
+# -------------------------------------------------------------
+# Install repository utilities
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ repo.package }}:
+ pkg.installed
+
+# -------------------------------------------------------------
+# Create repository directory
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ repo.repo_dir }}:
+ file.directory:
+ - makedirs: True
+ - user: builder
+
+# -------------------------------------------------------------
+# Download deb packages to host
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% from "roles/debian-repo/map.jinja" import packages_deb with context %}
+
+{% for package, url in packages_deb.iteritems() %}
+{{ package }}:
+ cmd.run:
+ - name: curl -L {{ url }} -o {{ repo.repo_dir ~ package }}
+ - creates: {{ repo.repo_dir ~ package }}
+{% endfor %}
+
+# -------------------------------------------------------------
+# Download deb packages to host
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+scan_packages:
+ cmd.run:
+ - name: dpkg-scanpackages {{ repo.repo_dir }} /dev/null > {{ repo.repo_dir ~ 'Release' }}
+
diff --git a/top.sls b/top.sls
--- a/top.sls
+++ b/top.sls
@@ -37,5 +37,6 @@
'eglide':
- roles/webserver-core
- roles/shellserver
+ - roles/dpkg-repo
'equatower':
- roles/paas-docker

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 00:03 (17 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2256473
Default Alt Text
D2446.diff (5 KB)

Event Timeline