diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-06 12:12:39 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-06 12:12:39 +0100 |
commit | b40cab15f4d01a4e8455e5808ca82e40ff291a92 (patch) | |
tree | 91ca5f2c2cd812776662d58de12a094b8278093b /module/ri-engine/src/main | |
parent | b8699860653e593271e50c8ba1b73f66fcb6287c (diff) | |
download | rules-sandbox-b40cab15f4d01a4e8455e5808ca82e40ff291a92.tar.gz rules-sandbox-b40cab15f4d01a4e8455e5808ca82e40ff291a92.tar.bz2 rules-sandbox-b40cab15f4d01a4e8455e5808ca82e40ff291a92.tar.xz rules-sandbox-b40cab15f4d01a4e8455e5808ca82e40ff291a92.zip |
Renaming VPN stuff to wireguard.
Diffstat (limited to 'module/ri-engine/src/main')
-rw-r--r-- | module/ri-engine/src/main/java/io/trygvis/rules/network/IpCalc.java (renamed from module/ri-engine/src/main/java/io/trygvis/rules/acme/IpCalc.java) | 18 | ||||
-rw-r--r-- | module/ri-engine/src/main/resources/io/trygvis/rules/acme/acme.drl | 10 |
2 files changed, 4 insertions, 24 deletions
diff --git a/module/ri-engine/src/main/java/io/trygvis/rules/acme/IpCalc.java b/module/ri-engine/src/main/java/io/trygvis/rules/network/IpCalc.java index 5369d62..e40e169 100644 --- a/module/ri-engine/src/main/java/io/trygvis/rules/acme/IpCalc.java +++ b/module/ri-engine/src/main/java/io/trygvis/rules/network/IpCalc.java @@ -1,26 +1,10 @@ -package io.trygvis.rules.acme; +package io.trygvis.rules.network; -import io.trygvis.rules.network.Ipv4Cidr; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.ArrayList; -import java.util.List; import java.util.regex.Pattern; public class IpCalc { private static final Pattern pattern = Pattern.compile("([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})/([0-9]{1,3})"); - public static class FirstLast { - public final int first; - public final int last; - - public FirstLast(int first, int last) { - this.first = first; - this.last = last; - } - } - public static Ipv4Cidr cidr(String cidr) { var matcher = pattern.matcher(cidr); if (!matcher.matches()) { diff --git a/module/ri-engine/src/main/resources/io/trygvis/rules/acme/acme.drl b/module/ri-engine/src/main/resources/io/trygvis/rules/acme/acme.drl index 0465343..7d53763 100644 --- a/module/ri-engine/src/main/resources/io/trygvis/rules/acme/acme.drl +++ b/module/ri-engine/src/main/resources/io/trygvis/rules/acme/acme.drl @@ -4,16 +4,13 @@ import io.trygvis.rules.machine.Machine; import io.trygvis.rules.dba.Cluster; import io.trygvis.rules.dba.Container; +dialect "mvel" + declare AcmeServer name : String machine : Machine end -//declare MachinePublicName -// machine : Machine -// fqdn : String -//end - rule "Ops" when $ops: AcmeOps() @@ -56,7 +53,6 @@ when $m : Machine(fqdn == null) $s : AcmeServer(machine == $m) then - var fqdn = "%s.machine.acme.com".formatted($s.machine.name); - $s.machine.fqdn = fqdn; + $s.machine.fqdn = "%s.machine.acme.com".formatted($s.machine.name); update($s.machine) end |