This commit is contained in:
root
2019-06-18 23:37:28 -04:00
parent 2a16ef4a63
commit 7d28ba663a
6 changed files with 105 additions and 6 deletions

View File

@@ -68,3 +68,4 @@ set smarttab
" always uses spaces instead of tab characters
set expandtab

View 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;
}
}

View File

@@ -1,4 +1,39 @@
'icinga2':
pkg.installed: []
icinga_packages:
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
View 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: ''

View File

@@ -18,10 +18,6 @@ export PROMPT_COMMAND='history -a'
shopt -s histappend
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)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

View File

@@ -8,3 +8,4 @@
'kpi.keiran.us':
- salt.master
- icinga2
- nginx