Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@nyopstools2 salt]# salt --version
- salt 2014.1.10 (Hydrogen)
- [root@nyopstools2 salt]# salt 'nybmon1' state.highstate
- nybmon1:
- ----------
- ID: nagios
- Function: pkg.installed
- Result: True
- Comment: All specified packages are already installed.
- Changes:
- ----------
- ID: install-nagios
- Function: cmd.run
- Name: /usr/sbin/usermod -G nagios apache
- cd /usr/local/src
- wget -c http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
- wget -c http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
- tar -xzf nagios-4.0.8.tar.gz
- cd nagios-4.0.8
- ./configure --with-command-group=nagios
- make all
- make install
- make install-config
- make install-commandmode
- mkdir /etc/httpd/certs/
- mkdir /etc/httpd/conf/extra
- Result: False
- Comment: The following requisites were not found:
- require:
- sls: nagios
- Changes:
- ----------
- ID: /etc/httpd/conf/httpd.conf
- Function: file.managed
- Result: False
- Comment: One or more requisite failed
- Changes:
- ----------
- ID: /etc/httpd/conf/mime.types
- Function: file.managed
- Result: False
- Comment: One or more requisite failed
- Changes:
- ----------
- ID: /etc/httpd/conf/extra/httpd-ssl.conf
- Function: file.managed
- Result: False
- Comment: One or more requisite failed
- Changes:
- ----------
- ID: /etc/httpd/certs/Thawte.txt
- Function: file.managed
- Result: False
- Comment: One or more requisite failed
- Changes:
- ----------
- ID: /etc/httpd/certs/nymon1.ops.about.com.cert
- Function: file.managed
- Result: False
- Comment: One or more requisite failed
- Changes:
- ----------
- ID: /etc/httpd/certs/nymon1.ops.about.com.key
- Function: file.managed
- Result: False
- Comment: One or more requisite failed
- Changes:
- Summary
- ------------
- Succeeded: 1
- Failed: 7
- ------------
- Total: 8
- [root@nyopstools2 salt]# cat nagios_monitor.sls
- include:
- - nagios
- install-nagios:
- cmd.run:
- - name: |
- /usr/sbin/usermod -G nagios apache
- cd /usr/local/src
- wget -c http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
- wget -c http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
- tar -xzf nagios-4.0.8.tar.gz
- cd nagios-4.0.8
- ./configure --with-command-group=nagios
- make all
- make install
- make install-config
- make install-commandmode
- mkdir /etc/httpd/certs/
- mkdir /etc/httpd/conf/extra
- - cwd: /usr/local/src
- - shell: /bin/bash
- - timeout: 300
- - unless: test -x /usr/local/nagios/bin/nagios
- - require:
- - sls: nagios
- - require_in:
- - file: /etc/httpd/conf/httpd.conf
- - file: /etc/httpd/conf/mime.types
- - file: /etc/httpd/conf/extra/httpd-ssl.conf
- - file: /etc/httpd/certs/Thawte.txt
- - file: /etc/httpd/certs/nymon1.ops.about.com.cert
- - file: /etc/httpd/certs/nymon1.ops.about.com.key
- /etc/httpd/conf/httpd.conf:
- file.managed:
- - source: salt://apache/httpd.conf
- /etc/httpd/conf/mime.types:
- file.managed:
- - source: salt://apache/mime.types
- /etc/httpd/conf/extra/httpd-ssl.conf:
- file.managed:
- - source: salt://apache/httpd-ssl.conf
- /etc/httpd/certs/Thawte.txt:
- file.managed:
- - source: salt://apache/Thawte.txt
- /etc/httpd/certs/nymon1.ops.about.com.cert:
- file.managed:
- - source: salt://apache/nymon1.ops.about.com.cert
- /etc/httpd/certs/nymon1.ops.about.com.key:
- file.managed:
- - source: salt://apache/nymon1.ops.about.com.key
- [root@nyopstools2 salt]# cat nagios.sls
- nagios:
- pkg.installed:
- - pkgs:
- - httpd
- - php
- - gd
- - gd-devel
- - mod_ssl
- - mod_authz_ldap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement