learning session, new tipes updated cdist.org

This commit is contained in:
llnu 2020-05-07 12:01:09 +02:00
parent be83fac3ac
commit 1b60734f2d
8 changed files with 69 additions and 0 deletions

View file

@ -11,6 +11,11 @@ case "$__target_host" in
__timezone Europe/Zurich
__my_computer
# __my_nginx
__my_nginx_site woo.com
__my_nginx_site chee.se
;;
esac

View file

@ -0,0 +1,7 @@
__package nginx --state present
#Should I export this variable somehow and use it in an other type?
#nginx_config_dir="/etc/nginx/"

View file

@ -0,0 +1,5 @@
__package nginx --state present
nginx_config_dir="/etc/nginx/"

View file

@ -0,0 +1,17 @@
# This is a default site configuration which will simply return 404, preventing
# chance access to any other virtualhost.
server {
listen 80 default_server;
listen [::]:80 default_server;
# Everything is a 404
# location / {
# return 404;
# }
# You may need this to prevent return 404 recursion.
# location = /404.html {
# internal;
# }
}

View file

@ -0,0 +1,17 @@
# This is a default site configuration which will simply return 404, preventing
# chance access to any other virtualhost.
server {
listen 80 default_server;
listen [::]:80 default_server;
# Everything is a 404
# location / {
# return 404;
# }
# You may need this to prevent return 404 recursion.
# location = /404.html {
# internal;
# }
}

View file

@ -0,0 +1,17 @@
domain="$__object_id"
nginx_config_dir="/etc/nginx/conf.d"
require="__package/nginx" __file $nginx_config_dir/$domain.conf --source - << EOF
server {
server_name $domain;
listen [::]:80 ;
location / {
autoindex on;
root /var/www/html/$domain;
}
}
EOF

View file

@ -0,0 +1 @@
require="__package/nginx" __file $nginx_config_dir/"$__object_id".conf