diff --git a/Saltfile b/Saltfile new file mode 100644 index 0000000..2316656 --- /dev/null +++ b/Saltfile @@ -0,0 +1,5 @@ +salt-ssh: + roster_file: ./conf/roster + config_dir: ./conf + ssh_log_file: ./logs/salt-ssh-log.log + ssh_priv: agent-forwarding diff --git a/conf/master b/conf/master new file mode 100644 index 0000000..69b2ff4 --- /dev/null +++ b/conf/master @@ -0,0 +1,14 @@ +pki_dir: "/home/mfalck/Work/salt_replicate/.pki" + +cachedir: "/home/mfalck/Work/salt_replicate/.cache" + +fileserver_backend: + - roots + +file_roots: + base: + - /home/mfalck/Work/salt_replicate/salt/ + +pillar_roots: + base: + - /home/mfalck/Work/salt_replicate/pillar/ diff --git a/conf/roster b/conf/roster new file mode 100644 index 0000000..b6685e7 --- /dev/null +++ b/conf/roster @@ -0,0 +1,4 @@ +salt-master: + host: 172.28.123.100 + user: vagrant + sudo: True diff --git a/gistfile1.txt b/gistfile1.txt deleted file mode 100644 index 30d74d2..0000000 --- a/gistfile1.txt +++ /dev/null @@ -1 +0,0 @@ -test \ No newline at end of file diff --git a/pillar/base.sls b/pillar/base.sls new file mode 100644 index 0000000..6cd7bf4 --- /dev/null +++ b/pillar/base.sls @@ -0,0 +1,2 @@ +mine_functions: + network.ip_addrs: [] diff --git a/pillar/top.sls b/pillar/top.sls new file mode 100644 index 0000000..9e69fc0 --- /dev/null +++ b/pillar/top.sls @@ -0,0 +1,3 @@ +base: + '*': + - base diff --git a/salt/test_get.sls b/salt/test_get.sls new file mode 100644 index 0000000..24bbab6 --- /dev/null +++ b/salt/test_get.sls @@ -0,0 +1,3 @@ +{{ salt['grains.get']('os') }}-dummy: + cmd.run: + - name: "uname -a" diff --git a/salt/test_mine.sls b/salt/test_mine.sls new file mode 100644 index 0000000..5465a5d --- /dev/null +++ b/salt/test_mine.sls @@ -0,0 +1,7 @@ +{%- set mine_ips = salt['mine.get']('*', 'network.ip_addrs') %} + +{%- for host, ip_addrs in mine_ips.items() %} +{{ host }}-dummy: + cmd.run: + - name: "ip route get {{ ip_addrs|first }}" +{%- endfor %} diff --git a/salt/top.sls b/salt/top.sls new file mode 100644 index 0000000..520bcc1 --- /dev/null +++ b/salt/top.sls @@ -0,0 +1,4 @@ +base: + '*': + - test_mine + - test_get