Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update pallet version.

  • Loading branch information...
commit d870a3421d7d3a4b83970872547984a919ec7638 1 parent 084cfff
@sundbp sundbp authored
Showing with 23 additions and 27 deletions.
  1. +6 −10 project.clj
  2. +17 −17 src/ovs_crate/ovs.clj
View
16 project.clj
@@ -5,18 +5,14 @@
:url "http://boardintelligence.mit-license.org"}
:dependencies [[org.clojure/clojure "1.4.0"]
- [org.cloudhoist/pallet "0.8.0-alpha.8"]
+ [com.palletops/pallet "0.8.0-beta.5"]
[ch.qos.logback/logback-classic "1.0.7"]]
- :dev-dependencies [[org.cloudhoist/pallet "0.8.0-alpha.8" :type "test-jar"]
- [org.cloudhoist/pallet-lein "0.5.2"]]
+ :dev-dependencies [[com.palletops/pallet "0.8.0-beta.5" :type "test-jar"]
+ [com.palletops/pallet-lein "0.6.0-beta.7"]]
:profiles {:dev
- {:dependencies [[org.cloudhoist/pallet "0.8.0-alpha.8" :classifier "tests"]]
- :plugins [[org.cloudhoist/pallet-lein "0.5.2"]]}}
+ {:dependencies [[com.palletops/pallet "0.8.0-beta.5" :classifier "tests"]]
+ :plugins [[com.palletops/pallet-lein "0.6.0-beta.7"]]}}
- :local-repo-classpath true
-
- :repositories
- {"sonatype-snapshots" "https://oss.sonatype.org/content/repositories/snapshots"
- "sonatype" "https://oss.sonatype.org/content/repositories/releases/"})
+ :local-repo-classpath true)
View
34 src/ovs_crate/ovs.clj
@@ -37,7 +37,7 @@
[]
(actions/exec-checked-script
"Remove ebtables package, not needed"
- (aptitude --assume-yes purge ebtables)))
+ ("aptitude --assume-yes purge ebtables")))
(defplan install-etc-network-interfaces
"Install our custom /etc/network/interfaces."
@@ -49,7 +49,7 @@
:literal true)
(actions/exec-checked-script
"Restart networking"
- (service networking restart))))
+ ("service networking restart"))))
(defplan create-bridge
"Create a single OVS bridge"
@@ -57,7 +57,7 @@
(let [bridge-name (:name bridge-config)]
(actions/exec-checked-script
"Delete and recreate bridge"
- (ovs-vsctl -- --may-exist add-br ~bridge-name))))
+ ("ovs-vsctl -- --may-exist add-br" ~bridge-name))))
(defplan connect-host-interfaces
"Connect host interfaces to OVS bridge"
@@ -67,7 +67,7 @@
(doseq [iface interfaces]
(actions/exec-checked-script
"Attch host interface to bridge"
- (ovs-vsctl -- --may-exist add-port ~bridge-name ~iface -- set interface ~iface type=internal)))))
+ ("ovs-vsctl -- --may-exist add-port" ~bridge-name ~iface "-- set interface" ~iface "type=internal")))))
(defplan add-gre-port
"Add a GRE port for a given bridge to a given remote ip."
@@ -78,9 +78,9 @@
options (format "options:remote_ip=%s options:psk=\"%s\"" remote-ip psk)]
(actions/exec-checked-script
"Add GRE port"
- (ovs-vsctl -- --if-exists del-port ~bridge-name ~port-name)
- (ovs-vsctl add-port ~bridge-name ~port-name
- -- set interface ~port-name type=ipsec_gre ~options))))
+ ("ovs-vsctl -- --if-exists del-port" ~bridge-name ~port-name)
+ ("ovs-vsctl add-port" ~bridge-name ~port-name
+ "-- set interface" ~port-name "type=ipsec_gre" ~options))))
(defplan create-gre-connections
"Create all GRE connections for a given bridge"
@@ -89,8 +89,8 @@
gre-connections (:gre-connections bridge-config)]
(actions/exec-checked-script
"Delete all GRE connections"
- (doseq [port @(ovs-vsctl list-ports ~bridge-name | grep gre)]
- (ovs-vsctl del-port ~bridge-name @port)))
+ (doseq [port @("ovs-vsctl list-ports" ~bridge-name "| grep gre")]
+ ("ovs-vsctl del-port" ~bridge-name @port)))
(doseq [gre-vec (map vector (iterate inc 0) gre-connections)]
(add-gre-port bridge-name gre-vec))))
@@ -99,9 +99,9 @@
[]
(actions/exec-checked-script
"Ensure IP forwarding is on"
- (echo "1 > /proc/sys/net/ipv4/ip_forward")
- (if (= @(grep "^net.ipv4.ip_forward=1" "/etc/sysctl.conf") "")
- (echo "\"net.ipv4.ip_forward=1\" >> /etc/sysctl.conf"))))
+ ("echo 1 > /proc/sys/net/ipv4/ip_forward")
+ (if (= @("grep" "^net.ipv4.ip_forward=1" "/etc/sysctl.conf") "")
+ ("echo" "\"net.ipv4.ip_forward=1\" >> /etc/sysctl.conf"))))
(defplan setup-forwarding
"Setup host to forward traffic from a given bridge and associated network."
@@ -113,9 +113,9 @@
(actions/exec-checked-script
"Add iptable rules for forwarding"
;; TODO: We need to check if rules already exist before adding them!
- (iptables -t nat -A POSTROUTING -o ~via -j MASQUERADE)
- (iptables -I INPUT 1 -i ~from -j ACCEPT)
- (iptables -A FORWARD -i ~from -s ~source -j ACCEPT)))))
+ ("iptables -t nat -A POSTROUTING -o" ~via "-j MASQUERADE")
+ ("iptables -I INPUT 1 -i" ~from "-j ACCEPT")
+ ("iptables -A FORWARD -i" ~from "-s" ~source "-j ACCEPT")))))
(defplan setup-bridge
"Perform all server side setup for a given OVS bridge."
@@ -149,8 +149,8 @@
[]
(actions/exec-checked-script
"Reboot via an at job"
- (pipe (echo "reboot")
- (at -M "now + 1 minutes"))))
+ (pipe ("echo reboot")
+ ("at -M now + 1 minutes"))))
(defplan recreate-all-gre-connections
"Utility function to update all GRE connections on all bridges for a given host."
Please sign in to comment.
Something went wrong with that request. Please try again.