icinga2
This commit is contained in:
@@ -68,3 +68,4 @@ set smarttab
|
|||||||
|
|
||||||
" always uses spaces instead of tab characters
|
" always uses spaces instead of tab characters
|
||||||
set expandtab
|
set expandtab
|
||||||
|
|
||||||
|
|||||||
23
icinga2/files/icingaweb2.jinja
Normal file
23
icinga2/files/icingaweb2.jinja
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
server {
|
||||||
|
|
||||||
|
server_name icinga.keiran.us;
|
||||||
|
|
||||||
|
rewrite ^/$ http://icinga.keiran.us/icingaweb2 permanent;
|
||||||
|
|
||||||
|
location ~ ^/icingaweb2/index\.php(.*)$ {
|
||||||
|
# fastcgi_pass 127.0.0.1:9000;
|
||||||
|
fastcgi_pass unix:/var/run//php/php7.0-fpm.sock;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME /usr/share/icingaweb2/public/index.php;
|
||||||
|
fastcgi_param ICINGAWEB_CONFIGDIR /etc/icingaweb2;
|
||||||
|
fastcgi_param REMOTE_USER $remote_user;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/icingaweb2(.+)? {
|
||||||
|
alias /usr/share/icingaweb2/public;
|
||||||
|
index index.php;
|
||||||
|
try_files $1 $uri $uri/ /icingaweb2/index.php$is_args$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,39 @@
|
|||||||
|
|
||||||
'icinga2':
|
icinga_packages:
|
||||||
pkg.installed: []
|
pkg.installed:
|
||||||
|
- pkgs:
|
||||||
|
- icinga2
|
||||||
|
- icingaweb2
|
||||||
|
|
||||||
|
apache2:
|
||||||
|
service.dead:
|
||||||
|
- enable: False
|
||||||
|
- require_by:
|
||||||
|
- pkg: nginx
|
||||||
|
file.absent:
|
||||||
|
- name: /etc/apache2
|
||||||
|
|
||||||
|
icingaweb2_vhost:
|
||||||
|
file.managed:
|
||||||
|
- name: /etc/nginx/sites-enabled/icingaweb2
|
||||||
|
- source: 'salt://icinga2/files/icingaweb2.jinja'
|
||||||
|
- template: jinja
|
||||||
|
- user: root
|
||||||
|
- group: root
|
||||||
|
- require:
|
||||||
|
- pkg: nginx
|
||||||
|
- watch_by:
|
||||||
|
- service: nginx
|
||||||
|
|
||||||
|
# icingacli setup config directory
|
||||||
|
# icingacli setup token create
|
||||||
|
# icingacli setup token show
|
||||||
|
# visit /icingaweb2/setup
|
||||||
|
|
||||||
|
icingaweb2_enable:
|
||||||
|
file.symlink:
|
||||||
|
- name: /etc/nginx/sites-enabled/icingaweb2
|
||||||
|
- target: /etc/nginx/sites-available/icingaweb2
|
||||||
|
- watch_by:
|
||||||
|
- service: nginx
|
||||||
|
|
||||||
|
|||||||
43
nginx/init.sls
Normal file
43
nginx/init.sls
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
nginx:
|
||||||
|
pkg.installed:
|
||||||
|
- name: nginx-light
|
||||||
|
service.running:
|
||||||
|
- enable: True
|
||||||
|
- reload: True
|
||||||
|
|
||||||
|
{% if salt.pillar.get('use_php', True) %}
|
||||||
|
|
||||||
|
{% set timezone = salt.timezone.get_zone() %}
|
||||||
|
|
||||||
|
php-fpm:
|
||||||
|
pkg.installed: []
|
||||||
|
service.running:
|
||||||
|
- name: php7.0-fpm
|
||||||
|
- enable: True
|
||||||
|
- watch:
|
||||||
|
- file: php_cgi.fixpathinfo=1
|
||||||
|
- file: php_date.timezone={{ timezone }}
|
||||||
|
|
||||||
|
php_cgi.fixpathinfo=1:
|
||||||
|
file.uncomment:
|
||||||
|
- name: /etc/php/7.0/fpm/php.ini
|
||||||
|
- char: ;
|
||||||
|
- regex: cgi\.fix\_pathinfo\=1
|
||||||
|
|
||||||
|
php_date.timezone={{ timezone }}:
|
||||||
|
file.replace:
|
||||||
|
- name: /etc/php/7.0/fpm/php.ini
|
||||||
|
- append_if_not_found: True
|
||||||
|
- pattern: \;date\.timezone.*
|
||||||
|
- repl: date.timezone = {{ timezone }}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
/var/www/html/index.html:
|
||||||
|
file.managed:
|
||||||
|
- user: root
|
||||||
|
- group: root
|
||||||
|
- mode: 644
|
||||||
|
- contents: ''
|
||||||
|
|
||||||
@@ -18,10 +18,6 @@ export PROMPT_COMMAND='history -a'
|
|||||||
shopt -s histappend
|
shopt -s histappend
|
||||||
shopt -s checkwinsize
|
shopt -s checkwinsize
|
||||||
|
|
||||||
# If set, the pattern "**" used in a pathname expansion context will
|
|
||||||
# match all files and zero or more directories and subdirectories.
|
|
||||||
#shopt -s globstar
|
|
||||||
|
|
||||||
# make less more friendly for non-text input files, see lesspipe(1)
|
# make less more friendly for non-text input files, see lesspipe(1)
|
||||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user