Merge remote-tracking branch 'balazs/master'

This commit is contained in:
Nico Schottelius 2020-05-11 12:34:07 +02:00
commit d4a7734bb5
4 changed files with 33 additions and 13 deletions

View file

@ -6,16 +6,14 @@ case "$__target_host" in
# Copy a cool motd from the type's file directory
__motd --source "$__files/motd"
# __package emacs --state present
__timezone Europe/Zurich
__my_computer
# __my_nginx
__my_nginx
__my_nginx_site woo.com
__my_nginx_site chee.se
require="__my_nginx" __my_nginx_site woo.com
require="__my_nginx" __my_nginx_site chee.se
;;
esac

View file

@ -1,8 +0,0 @@
#!/bin/sh -e
#This is a type for practice, used to learn cdist and configure a laptop.
for pkg in ndisc6 emacs zsh mosh nmap sipcalc;
do __package $pkg --state present;
done

View file

@ -0,0 +1,23 @@
os=$(cat "$__global/explorer/os")
#if grep -q "$something_from_message_in" "$__messages_in"; then
case "${os}" in
alpine|gentoo)
echo /etc/init.d/nginx reload
;;
debian|ubuntu)
echo "/usr/bin/systemctl reload nginx"
;;
esac
#fi
#if grep -q "^__your_type/object/id:conf_file_changed" "$__messages_in"; then
# echo "$reload_command"
#fi
# Testing env -> variables are not shared between the type's manifest and the gencode-remote script
# Maybe the variables are eval-ed on the local host and won't get transferred to the remote host?
#echo "echo \"$reload_command\" >> /tmp/cmd"

View file

@ -1,3 +1,8 @@
os="$(cat "$__global/explorer/os")"
# Note: __service nginx --action reload
domain="$__object_id"
nginx_config_dir="/etc/nginx/conf.d"
@ -15,3 +20,5 @@ server {
}
EOF
# Messaging is not needed because atm I assume that the config file will get overwritten every run, even if the contents are the same.
#echo "conf_file_changed" >> "$__messages_out"