re-core.repl

Repl Driven re-core

add

(add base & args)
Add existing system instances:
(add (kvm-size 1 512) :ubuntu-16.04-desktop "furby" :foo); we specify an os

by-type

(by-type t)
Get instances by type:
(reload (by-type :redis))

clear

(clear)(clear f opts)(clear f on opts)
Clear model only (VM won't be deleted):
(clear) ; clear all systems (both runnging and non running)
(clear (by-type :redis)) ; clear systems with redis type
(clear identity :types) ; clear all types

create

(create base & args)
A function for creating instances, System instances:
  (create kvm-small :redis) ; kvm instance that run redis
  (create kvm-small :redis 5) ; creating 5 in one go
  (create kvm-small :redis "furry") ; with custom hostname (default generated from type)
  (create kvm-small vol-128G :redis) ; 128G Volume
  (create kvm-small :redis (os :ubuntu-16.04-dekstop)) ; custom os type
Type instances:
  (create puppet default-src :redis "redis type") ; using default src directory
  (create puppet (src "/home/foo/redis-sandbox") :redis "redis type") ; using local src directory
  (create puppet (args "--hiera_config" "hiera.yml" "manifests/default.pp") :redis "redis type") ; with args

destroy

(destroy)(destroy f)(destroy f opts)
Destroy instances (both clear and remove VM):
(destroy) ; remove all instances (both running and non running)
(destroy ip) ; remove running instances only
(destroy (matching "Fstr")) ; remove all instances with an id containing Fstr
(destroy ip {:force true}) ; remove running instances only without confirmation

detect

(detect f opts)
Detect systems information automaticly

fill

(fill f ks v)
fill systems information from provided ks v pair
(fill identity [:machine :os] :ubuntu-18.04)

halt

(halt)(halt f)
Halt instances:
(halt) ; halt all running (have ip)

hostname

(hostname name)
Match instances by hostname matching:
(provision (hostname "foo"))

hosts

(hosts)(hosts f k)
Convert systems into re-mote hosts:
(hosts) ; all systems using ip address
(cpu-persist (hosts ip :hostname))) ; use re-gent addresses by grabbing hostname
(hosts (by-type :redis) :hostname) ; all redis instances using hostname

ip

(ip [_ {:keys [machine], :as m}])
Pick systems with an ip (they are running):
(stop ip)

list

(list)(list f)(list f on)
List available instances:
(list) ; list all systems
(list ip) ; list all systems that have an ip (running)
(list identity :types) ; list all types

match-kv

(match-kv ks v)
Match instances by kv pair:
(provision (match-kv [:machine :os] :ubuntu-18.04))

matching

(matching part)
Match instances by partial id matching (ala git):
(provision (matching "A17_"))

provision

(provision)(provision f)
Provision VM:
(provision) ; run provision on all running instances
(provision (fn [{:keys [type]] (= type :redis))) ; provision using filter fn

reload

(reload)(reload f)
Reload (stop destroy and up):
(reload) ; reload all running instances
(reload (by-type :redis)) ; reload all redis instances

spice-into

(spice-into)(spice-into f)
Open remote spice connection to KVM instances (using remmina spice):
(spice-into (by-type :desktop))

ssh-into

(ssh-into)(ssh-into f)
SSH into instances (open a terminal window):
(ssh-into)

start

(start)(start f)
Start instances:
(start) ; start all without ip (stopped)
(start (by-type :redis)) ; start all redis types

sync

(sync hyp)(sync hyp opts)
Sync existing instances into re-core systems:
(sync :digital-ocean)
(sync :kvm :active true) ; using options
(sync :aws :filter (fn [m] ...)) ; using a filtering function
(sync :physical {:pivot rosetta  :network "192.168.1.0/24" :user "re-ops"}) ; nmap based sync 

systems

types

with-ids

(with-ids & ids)
Pick systems using unique ids:
(provision (with-ids "Bar" "Foo"))