Skip to content

Instantly share code, notes, and snippets.

@UtahDave
Created June 26, 2014 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UtahDave/5234e366c7e032b2af56 to your computer and use it in GitHub Desktop.
Save UtahDave/5234e366c7e032b2af56 to your computer and use it in GitHub Desktop.
Scenario 1 dev and prod are subdirectories of herlo
root@dasalt:/srv/salt/herlo# sudo salt-call state.top dev/devtop.sls
[INFO ] Executing command 'hostname' in directory '/root'
<-- snip -->
[INFO ] Completed state [nano] at time 15:39:31.434129
local:
----------
ID: nano
Function: pkg.installed
Result: True
Comment: The following packages were installed/updated: nano.
Started: 15:39:12.513171
Duration: 920 ms
Changes:
----------
nano:
----------
new:
2.2.6-1ubuntu1
old:
Summary
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
root@dasalt:/srv/salt/herlo# tree
.
├── dev
│   ├── devtop.sls
│   └── nano.sls
├── empty.sls
├── prod
│   ├── nonano.sls
│   └── prodtop.sls
└── top.sls
file_roots inside /etc/salt/minion
file_roots:
base:
- /srv/salt/herlo
dev:
- /srv/salt/herlo/dev
prod:
- /srv/salt/herlo/prod
root@dasalt:/srv/salt/herlo# sudo salt-call state.top prod/prodtop.sls
[INFO ] Executing command 'hostname' in directory '/root'
<-- snip -->
[INFO ] Completed state [nano] at time 15:44:29.683450
local:
----------
ID: nano
Function: pkg.purged
Result: True
Comment: All targeted packages were purged.
Started: 15:44:21.911724
Duration: 771 ms
Changes:
----------
installed:
----------
nano:
----------
new:
old:
2.2.6-1ubuntu1
removed:
----------
Summary
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment