summaryrefslogtreecommitdiff
path: root/module/acme
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2021-01-06 15:20:40 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2021-01-06 15:21:16 +0100
commite84ef1adb8ff0d3b121ea12b2d3e15fa52eb2f00 (patch)
treeafb7c00c654c122a313acaba8630708a87ae4ffd /module/acme
parent9504c7efb9b57aeacf5e2717a43c3cf178a65aee (diff)
downloadrules-sandbox-e84ef1adb8ff0d3b121ea12b2d3e15fa52eb2f00.tar.gz
rules-sandbox-e84ef1adb8ff0d3b121ea12b2d3e15fa52eb2f00.tar.bz2
rules-sandbox-e84ef1adb8ff0d3b121ea12b2d3e15fa52eb2f00.tar.xz
rules-sandbox-e84ef1adb8ff0d3b121ea12b2d3e15fa52eb2f00.zip
Splitting Main into two runs, Vpn and AcmeApps.
Diffstat (limited to 'module/acme')
-rw-r--r--module/acme/classpath.txt2
-rw-r--r--module/acme/src/main/java/io/trygvis/acme/AcmeAppsMain.java13
-rw-r--r--module/acme/src/main/java/io/trygvis/acme/VpnMain.java6
-rw-r--r--module/acme/src/main/resources/META-INF/kmodule.xml10
4 files changed, 22 insertions, 9 deletions
diff --git a/module/acme/classpath.txt b/module/acme/classpath.txt
index 5d086d8..ed8e5f6 100644
--- a/module/acme/classpath.txt
+++ b/module/acme/classpath.txt
@@ -17,7 +17,7 @@ com.hubspot.jinjava:jinjava:2.5.6:jar
com.thoughtworks.xstream:xstream:1.4.14:jar
com.zaxxer:SparseBitSet:1.2:jar
commons-codec:commons-codec:1.11:jar
-commons-io:commons-io:2.6:jar
+commons-io:commons-io:2.8.0:jar
commons-net:commons-net:2.2:jar
io.trygvis.rules-sandbox:ri-engine:1.0-SNAPSHOT:jar
io.trygvis.rules-sandbox:ri-wireguard:1.0-SNAPSHOT:jar
diff --git a/module/acme/src/main/java/io/trygvis/acme/AcmeAppsMain.java b/module/acme/src/main/java/io/trygvis/acme/AcmeAppsMain.java
new file mode 100644
index 0000000..f21ebc3
--- /dev/null
+++ b/module/acme/src/main/java/io/trygvis/acme/AcmeAppsMain.java
@@ -0,0 +1,13 @@
+package io.trygvis.acme;
+
+import io.trygvis.rules.engine.Engine;
+
+import java.io.IOException;
+
+public class AcmeAppsMain {
+ public static void main(String[] args) throws IOException {
+ try (var engine = new Engine("acme-apps", "acme.yaml")) {
+ engine.io.dump("acme/apps", engine.session.getFactHandles());
+ }
+ }
+}
diff --git a/module/acme/src/main/java/io/trygvis/acme/VpnMain.java b/module/acme/src/main/java/io/trygvis/acme/VpnMain.java
index d5f986d..d6c8061 100644
--- a/module/acme/src/main/java/io/trygvis/acme/VpnMain.java
+++ b/module/acme/src/main/java/io/trygvis/acme/VpnMain.java
@@ -10,10 +10,8 @@ import java.io.IOException;
public class VpnMain {
public static void main(String[] args) throws IOException {
- try (var engine = new Engine("acme.yaml")) {
- engine.io.dump("phase-1", engine.session.getFactHandles());
-
- engine.io.dump("vpn0", engine.session.getFactHandles(), (Object o) ->
+ try (var engine = new Engine("acme-wireguard", "acme.yaml")) {
+ engine.io.dump("acme/wireguard", engine.session.getFactHandles(), (Object o) ->
o.getClass().getName().contains("Wg")
|| o instanceof Machine
|| o instanceof DnsEntry
diff --git a/module/acme/src/main/resources/META-INF/kmodule.xml b/module/acme/src/main/resources/META-INF/kmodule.xml
index 351a25e..da34a59 100644
--- a/module/acme/src/main/resources/META-INF/kmodule.xml
+++ b/module/acme/src/main/resources/META-INF/kmodule.xml
@@ -3,9 +3,11 @@
xmlns="http://www.drools.org/xsd/kmodule"
xsi:schemaLocation="http://www.drools.org/xsd/kmodule https://www.drools.org/xsd/kmodule_7_1.xsd">
- <kbase packages="io.trygvis.acme" default="true"
- includes="engine,wireguard">
- <ksession name="Default" default="true">
- </ksession>
+ <kbase packages="io.trygvis.acme" includes="engine" name="acme-apps">
+ <ksession name="acme-apps" default="true"/>
+ </kbase>
+
+ <kbase packages="io.trygvis.acme" includes="engine,wireguard" name="acme-wireguard">
+ <ksession name="acme-wireguard" default="true"/>
</kbase>
</kmodule>