Skip to content

Instantly share code, notes, and snippets.

@davidrupp
Created October 26, 2011 14:02
Show Gist options
  • Save davidrupp/1316455 to your computer and use it in GitHub Desktop.
Save davidrupp/1316455 to your computer and use it in GitHub Desktop.
Find the running Pallet nodes in a group, along with their IP addresses
; Get the running nodes and the their ip addresses for the named group
; Need to define:
; service - the pallet.compute service on which the nodes are running
(defn nodes-in-group
[group]
(filter
#(and (.equals group (pallet.compute/group-name %))
(pallet.compute/running? %))
(pallet.compute/nodes service)))
(defn ips-in-group
[group]
(map
#(pallet.compute/primary-ip %)
(nodes-in-group group)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment