Skip to content

Instantly share code, notes, and snippets.

@bluethundr
Last active October 3, 2016 19:24
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 bluethundr/e1e4fda84d6fe9bf1e17504c8045655f to your computer and use it in GitHub Desktop.
Save bluethundr/e1e4fda84d6fe9bf1e17504c8045655f to your computer and use it in GitHub Desktop.
[root@salt salt]# salt '*' state.apply
salt.localdomain:
----------
ID: /etc/httpd/extra/httpd-vhosts.conf
Function: file.managed
Result: True
Comment: File /etc/httpd/extra/httpd-vhosts.conf is in the correct state
Started: 19:23:33.175859
Duration: 83.816 ms
Changes:
----------
ID: apache
Function: pkg.installed
Result: False
Comment: Error occurred installing package(s). Additional info follows:
errors:
- Running scope as unit run-20208.scope.
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.metrocast.net
* epel: mirror.sfo12.us.leaseweb.net
* extras: mirror.supremebytes.com
* updates: mirror.san.fastserv.com
No package apache available.
Error: Nothing to do
Started: 19:23:34.555697
Duration: 6991.205 ms
Changes:
----------
ID: apache
Function: service.running
Name: httpd
Result: False
Comment: One or more requisite failed: webserver.apache
Changes:
----------
ID: /var/www/index.html
Function: file.managed
Result: False
Comment: The following requisites were not found:
require:
pkg: httpd
Changes:
Summary for salt.localdomain
------------
Succeeded: 1
Failed: 3
------------
Total states run: 4
Total run time: 7.075 s
ERROR: Minions returned with non-zero exit code
## error using salt states
httpd:
pkg.installed: []
service.running:
- require:
- pkg: httpd
/var/www/index.html: # ID declaration
file: # state declaration
- managed # function
- source: salt://webserver/index.html # function arg
- require: # requisite declaration
- pkg: httpd # requisite reference
## salt state files are here
[root@vendoronsite salt]# ls -l /srv/salt/
total 12
-rw-r--r--. 1 salt salt 3 Oct 3 14:46 index.html
drwxr-xr-x. 4 salt salt 34 Oct 3 14:10 lab
drwxr-xr-x. 4 salt salt 34 Oct 3 14:10 non-prod
-rw-r--r--. 1 salt salt 29 Oct 3 14:14 top.sls
drwxr-xr-x. 2 salt salt 6 Oct 3 15:05 webserver
-rw-r--r--. 1 salt salt 453 Oct 3 15:02 webserver.sls
## file roots in salt master
file_roots:
base:
- /srv/salt/
non-prod:
- /srv/salt/non-prod/services
- /srv/salt/non-prod/states
lab:
- /srv/salt/lab/services
- /srv/salt/lab/states
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment