Page MenuHomeDevCentral

D3480.id.diff
No OneTemporary

D3480.id.diff

diff --git a/pillar/devserver/ports.sls b/pillar/devserver/ports.sls
--- a/pillar/devserver/ports.sls
+++ b/pillar/devserver/ports.sls
@@ -151,3 +151,14 @@
category: www
name: npm
creates: /usr/local/bin/npm
+
+# -------------------------------------------------------------
+# Poudriere
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+poudriere:
+ zfs_pool: arcology
+ tmpfs: wrkdir
+ ports:
+ usr-ports: /usr/ports
+ dereckson-dev: /home/dereckson/dev/freebsd/ports
diff --git a/roles/devserver/init.sls b/roles/devserver/init.sls
--- a/roles/devserver/init.sls
+++ b/roles/devserver/init.sls
@@ -13,5 +13,6 @@
- .pkg
- .userland-software
- .userland-home
+ - .poudriere
- .webserver-home
- .webserver-wwwroot51
diff --git a/roles/devserver/poudriere/config.sls b/roles/devserver/poudriere/config.sls
new file mode 100644
--- /dev/null
+++ b/roles/devserver/poudriere/config.sls
@@ -0,0 +1,19 @@
+# -------------------------------------------------------------
+# Poudriere
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs with context %}
+
+# -------------------------------------------------------------
+# General configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ dirs.etc }}/poudriere.conf:
+ file.managed:
+ - source: salt://roles/devserver/poudriere/files/poudriere.conf
+ - template: jinja
+ - context:
+ poudriere: {{ pillar["poudriere"] }}
diff --git a/roles/devserver/poudriere/content.sls b/roles/devserver/poudriere/content.sls
new file mode 100644
--- /dev/null
+++ b/roles/devserver/poudriere/content.sls
@@ -0,0 +1,67 @@
+#!py
+
+# -------------------------------------------------------------
+# Poudriere :: Jails
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: BSD-2-Clause
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Data helper methods
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
+def get_kernel_version():
+ # "14.1-RELEASE-p5" -> "14.1-RELEASE"
+ return "-".join(__grains__["kernelrelease"].split("-")[0:2])
+
+
+# -------------------------------------------------------------
+# Configuration provider
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
+def provide_port_state(name, path):
+ name = name.replace("-", "_")
+
+ return "poudriere_ports_" + name, {
+ "cmd.run": [
+ {"name": f"poudriere ports -c -m null -M {path} -p {name}"},
+ {"creates": f"/usr/local/etc/poudriere.d/ports/{name}"},
+ ]
+ }
+
+
+def provide_port_states():
+ ports = __pillar__.get("poudriere", {}).get("ports", {})
+
+ return dict([provide_port_state(name, path) for name, path in ports.items()])
+
+
+def run():
+ major = __grains__["osmajorrelease"]
+ version = get_kernel_version()
+ arch = __grains__["cpuarch"]
+
+ # Base jail and ports tree
+ states = {
+ "poudriere_jails_base": {
+ "cmd.run": [
+ {"name": f"poudriere jail -c -j base{major} -v {version} -a {arch}"},
+ {"creates": f"/usr/local/poudriere/jails/base{major}"},
+ ]
+ },
+
+ "poudriere_ports_default": {
+ "cmd.run": [
+ {"name": "poudriere ports -c -m git+https -B main"},
+ {"creates": "/usr/local/poudriere/ports/default"},
+ ]
+ },
+ }
+
+ # Additional block according pillar
+ states.update(provide_port_states())
+
+ return states
diff --git a/roles/devserver/poudriere/files/poudriere.conf b/roles/devserver/poudriere/files/poudriere.conf
new file mode 100644
--- /dev/null
+++ b/roles/devserver/poudriere/files/poudriere.conf
@@ -0,0 +1,35 @@
+# -------------------------------------------------------------
+# Poudriere configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/devserver/poudriere/files/poudriere.conf
+# -------------------------------------------------------------
+#
+# <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>
+
+ZPOOL={{ poudriere.zfs_pool }}
+
+FREEBSD_HOST=https://download.FreeBSD.org
+
+RESOLV_CONF=/etc/resolv.conf
+
+BASEFS=/usr/local/poudriere
+DISTFILES_CACHE=/usr/ports/distfiles
+
+USE_PORTLINT=yes
+
+# -------------------------------------------------------------
+# RAM usage - tmpfs
+#
+# "yes" = "wrkdir" + "data"
+# wrkdir - Use tmpfs(5) for port building WRKDIRPREFIX
+# data - Use tmpfs(5) for poudriere cache/temp build data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+USE_TMPFS={{ poudriere.tmpfs }}
diff --git a/roles/devserver/init.sls b/roles/devserver/poudriere/init.sls
copy from roles/devserver/init.sls
copy to roles/devserver/poudriere/init.sls
--- a/roles/devserver/init.sls
+++ b/roles/devserver/poudriere/init.sls
@@ -1,17 +1,11 @@
# -------------------------------------------------------------
-# Salt — Provision a development server
+# Poudriere
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
-# Created: 2017-10-20
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
include:
- - .datacube
- - .dns
- - .mail
- - .pkg
- - .userland-software
- - .userland-home
- - .webserver-home
- - .webserver-wwwroot51
+ - .software
+ - .config
+ - .content
diff --git a/roles/devserver/init.sls b/roles/devserver/poudriere/software.sls
copy from roles/devserver/init.sls
copy to roles/devserver/poudriere/software.sls
--- a/roles/devserver/init.sls
+++ b/roles/devserver/poudriere/software.sls
@@ -1,17 +1,9 @@
# -------------------------------------------------------------
-# Salt — Provision a development server
+# Poudriere
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
-# Created: 2017-10-20
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-include:
- - .datacube
- - .dns
- - .mail
- - .pkg
- - .userland-software
- - .userland-home
- - .webserver-home
- - .webserver-wwwroot51
+poudriere:
+ pkg.installed
diff --git a/roles/devserver/userland-software/misc.sls b/roles/devserver/userland-software/misc.sls
--- a/roles/devserver/userland-software/misc.sls
+++ b/roles/devserver/userland-software/misc.sls
@@ -69,7 +69,6 @@
- portmaster
- portshaker
- porttools
- - poudriere
- portsearch
portsearch_database:

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 04:25 (17 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2310170
Default Alt Text
D3480.id.diff (7 KB)

Event Timeline