Support N distributed agents

This is the third main feature of this system. The code needs a bunch of
polish, but it actually all works :)

I've tested this briefly with N <= 3.

Currently you have to build your own etcd cluster. It's quite easy, just
run `etcd` and it will be ready. I usually run it in a throw away /tmp/
dir so that I can blow away the stored data easily.
This commit is contained in:
James Shubin
2016-01-02 19:41:36 -05:00
parent 72a8027b7f
commit d8cbeb56f9
19 changed files with 482 additions and 140 deletions

View File

@@ -5,22 +5,22 @@ types:
- name: noop1
file:
- name: file1
path: /tmp/mgmt/f1
path: "/tmp/mgmt/f1"
content: |
i am f1
state: exists
- name: file2
path: /tmp/mgmt/f2
path: "/tmp/mgmt/f2"
content: |
i am f2
state: exists
- name: file3
path: /tmp/mgmt/f3
path: "/tmp/mgmt/f3"
content: |
i am f3
state: exists
- name: file4
path: /tmp/mgmt/f4
path: "/tmp/mgmt/f4"
content: |
i am f4 and i should not be here
state: absent

View File

@@ -5,7 +5,7 @@ types:
- name: noop1
file:
- name: file1
path: /tmp/mgmt/f1
path: "/tmp/mgmt/f1"
content: |
i am f1
state: exists

View File

@@ -2,43 +2,43 @@
graph: mygraph
types:
noop:
- name: noop1
- name: noop1a
file:
- name: file1
path: /tmp/mgmt/f1
- name: file1a
path: "/tmp/mgmt1/f1a"
content: |
i am f1
state: exists
- name: file2
path: /tmp/mgmt/f2
- name: file2a
path: "/tmp/mgmt1/f2a"
content: |
i am f2
state: exists
- name: '@@file3'
path: /tmp/mgmt/f3
- name: "@@file3a"
path: "/tmp/mgmt1/f3a"
content: |
i am f3, exported from host A
state: exists
- name: '@@file4'
path: /tmp/mgmt/f4
- name: "@@file4a"
path: "/tmp/mgmt1/f4a"
content: |
i am f4, exported from host A
state: exists
collect:
- type: file
pattern: ''
pattern: "/tmp/mgmt1/"
edges:
- name: e1
from:
type: noop
name: noop1
name: noop1a
to:
type: file
name: file1
name: file1a
- name: e2
from:
type: file
name: file1
name: file1a
to:
type: file
name: file2
name: file2a

View File

@@ -2,43 +2,43 @@
graph: mygraph
types:
noop:
- name: noop1
- name: noop1b
file:
- name: file1
path: /tmp/mgmt/f1
- name: file1b
path: "/tmp/mgmt2/f1b"
content: |
i am f1
state: exists
- name: file2
path: /tmp/mgmt/f2
- name: file2b
path: "/tmp/mgmt2/f2b"
content: |
i am f2
state: exists
- name: '@@file3'
path: /tmp/mgmt/f3
- name: "@@file3b"
path: "/tmp/mgmt2/f3b"
content: |
i am f3, exported from host B
state: exists
- name: '@@file4'
path: /tmp/mgmt/f4
- name: "@@file4b"
path: "/tmp/mgmt2/f4b"
content: |
i am f4, exported from host B
state: exists
collect:
- type: file
pattern: ''
pattern: "/tmp/mgmt2/"
edges:
- name: e1
from:
type: noop
name: noop1
name: noop1b
to:
type: file
name: file1
name: file1b
- name: e2
from:
type: file
name: file1
name: file1b
to:
type: file
name: file2
name: file2b

44
examples/graph3c.yaml Normal file
View File

@@ -0,0 +1,44 @@
---
graph: mygraph
types:
noop:
- name: noop1c
file:
- name: file1c
path: "/tmp/mgmt3/f1c"
content: |
i am f1
state: exists
- name: file2c
path: "/tmp/mgmt3/f2c"
content: |
i am f2
state: exists
- name: "@@file3c"
path: "/tmp/mgmt3/f3c"
content: |
i am f3, exported from host C
state: exists
- name: "@@file4c"
path: "/tmp/mgmt3/f4c"
content: |
i am f4, exported from host C
state: exists
collect:
- type: file
pattern: "/tmp/mgmt3/"
edges:
- name: e1
from:
type: noop
name: noop1c
to:
type: file
name: file1c
- name: e2
from:
type: file
name: file1c
to:
type: file
name: file2c

View File

@@ -3,12 +3,12 @@ graph: mygraph
types:
file:
- name: file1
path: /tmp/mgmt/f1
path: "/tmp/mgmt/f1"
content: |
i am f1
state: exists
- name: '@@file3'
path: /tmp/mgmt/f3
- name: "@@file3"
path: "/tmp/mgmt/f3"
content: |
i am f3, exported from host A
state: exists

View File

@@ -3,7 +3,7 @@ graph: mygraph
types:
file:
- name: file1
path: /tmp/mgmt/f1
path: "/tmp/mgmt/f1"
content: |
i am f1
state: exists