Skip to content
Snippets Groups Projects
Commit 3c9ce297 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Begin changes to centralize conf (refs #19005).

parent b9718404
No related branches found
No related tags found
No related merge requests found
Showing
with 78 additions and 92 deletions
...@@ -5,9 +5,9 @@ echo -e " ...@@ -5,9 +5,9 @@ echo -e "
${RED}Customer parameters will be applied after rebooting. Note that you won't be able to login to the machine after this operation !${NC}" ${RED}Customer parameters will be applied after rebooting. Note that you won't be able to login to the machine after this operation !${NC}"
# set customer IP (/etc/network/interfaces) # set customer IP (/etc/network/interfaces)
sed -i "s@192\.168\.40\.10.*@${CUST_IP}@" /etc/network/interfaces sed -i "s@192\.168\.40\.10.*@${NETWORK_IP}@" /etc/network/interfaces
sed -i "s@255\.255\.252\..*@${CUST_NETMASK}@" /etc/network/interfaces sed -i "s@255\.255\.252\..*@${NETWORK_MASK}@" /etc/network/interfaces
sed -i "s@192\.168\.40\..*@${CUST_GATEWAY}@" /etc/network/interfaces sed -i "s@192\.168\.40\..*@${NETWORK_GATEWAY}@" /etc/network/interfaces
# backup-server specific # backup-server specific
if ( test -f /usr/sbin/burp ) if ( test -f /usr/sbin/burp )
...@@ -19,22 +19,22 @@ newaliases ...@@ -19,22 +19,22 @@ newaliases
fi fi
# set customer DNS # set customer DNS
echo "nameserver ${CUST_NS1}" > /etc/resolv.conf echo "nameserver ${NETWORK_DNS1}" > /etc/resolv.conf
echo "nameserver ${CUST_NS2}" >> /etc/resolv.conf echo "nameserver ${NETWORK_DNS2}" >> /etc/resolv.conf
# set customer NTP # set customer NTP
sed -i "s@^server .*@@" /etc/ntp.conf sed -i "s@^server .*@@" /etc/ntp.conf
echo "" >> /etc/ntp.conf echo "" >> /etc/ntp.conf
echo "server ${CUST_NTP1}" >> /etc/ntp.conf echo "server ${NTP_SERVER1}" >> /etc/ntp.conf
if ( ! test -z ${CUST_NTP2} ) if ( ! test -z ${NTP_SERVER2} )
then then
echo "server ${CUST_NTP2}" >> /etc/ntp.conf echo "server ${NTP_SERVER2}" >> /etc/ntp.conf
fi fi
if ( ! test -z ${CUST_NTP3} ) if ( ! test -z ${NTP_SERVER3} )
then then
echo "server ${CUST_NTP3}" >> /etc/ntp.conf echo "server ${NTP_SERVER3}" >> /etc/ntp.conf
fi fi
service ntp restart service ntp restart
...@@ -119,20 +119,13 @@ echo "#DEFAULT_FROM_EMAIL = '${DEFAULT_FROM_EMAIL}'" >> /home/skyreach/htdocs/sk ...@@ -119,20 +119,13 @@ echo "#DEFAULT_FROM_EMAIL = '${DEFAULT_FROM_EMAIL}'" >> /home/skyreach/htdocs/sk
fi fi
# set locale # set locale
if [ ${CUST_LOCALE} != 'FR' ]
then
echo -e "${CYAN}You will now change the locales.${NC}" echo -e "${CYAN}You will now change the locales.${NC}"
locale-gen en_GB
locale-gen en_GB.UTF-8 locale-gen en_GB.UTF-8
dpkg-reconfigure locales dpkg-reconfigure locales
#~dpkg-reconfigure console-data
dpkg-reconfigure keyboard-configuration
update-locale LANG=en_GB.UTF-8 LANGUAGE=en_GB.UTF-8 LC_ALL=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 update-locale LANG=en_GB.UTF-8 LANGUAGE=en_GB.UTF-8 LC_ALL=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
fi #dpkg-reconfigure console-data
#dpkg-reconfigure keyboard-configuration
# set TZ # set TZ
if [ ${CUST_TZ} != 'FR' ]
then
echo -e "${CYAN}You will now change the time zone.${NC}" echo -e "${CYAN}You will now change the time zone.${NC}"
dpkg-reconfigure tzdata dpkg-reconfigure tzdata
fi
...@@ -6,7 +6,7 @@ echo "SOURCES.LIST" > /root/deployment.results ...@@ -6,7 +6,7 @@ echo "SOURCES.LIST" > /root/deployment.results
cat /etc/apt/sources.list | grep ^deb >> /root/deployment.results cat /etc/apt/sources.list | grep ^deb >> /root/deployment.results
echo "" >> /root/deployment.results echo "" >> /root/deployment.results
echo "SOURCES.LIST - PANEL" >> /root/deployment.results echo "SOURCES.LIST - SKYREACH_HOST" >> /root/deployment.results
cat /etc/apt/sources.list.d/skyreach.list >> /root/deployment.results cat /etc/apt/sources.list.d/skyreach.list >> /root/deployment.results
echo "" >> /root/deployment.results echo "" >> /root/deployment.results
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
source /root/envsetup/envsetup.conf source /root/envsetup/envsetup.conf
# set SMTP # set SMTP
if ( ! test -z ${CUST_SMTP} ) if ( ! test -z ${SMTP_SERVER} )
then then
sed -i "s@relayhost = .*@relayhost = ${CUST_SMTP}@" /etc/postfix/main.cf sed -i "s@relayhost = .*@relayhost = ${SMTP_SERVER}@" /etc/postfix/main.cf
fi fi
...@@ -13,7 +13,7 @@ def setup(interactive=True): ...@@ -13,7 +13,7 @@ def setup(interactive=True):
# NTP # NTP
'echo "Replacing /etc/ntp.conf"', 'echo "Replacing /etc/ntp.conf"',
dict(line='write', template='%s/ntp.conf' % dir_path, target='/etc/ntp.conf', params=( dict(line='write', template='%s/ntp.conf' % dir_path, target='/etc/ntp.conf', params=(
('{{ system_ntp }}', utils.get_conf('system_ntp', 'ntp.ubuntu.com')), ('{{ NTP_SERVER1 }}', utils.get_conf('NTP_SERVER1', 'ntp.ubuntu.com')),
)), )),
] ]
# Create / update ubicast account # Create / update ubicast account
......
...@@ -22,7 +22,7 @@ server 2.ubuntu.pool.ntp.org ...@@ -22,7 +22,7 @@ server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org server 3.ubuntu.pool.ntp.org
# Use Ubuntu's ntp server as a fallback. # Use Ubuntu's ntp server as a fallback.
server {{ system_ntp }} server {{ NTP_SERVER1 }}
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for # Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions> # details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
......
...@@ -14,11 +14,11 @@ nameserver 192.168.40.6 ...@@ -14,11 +14,11 @@ nameserver 192.168.40.6
EOF EOF
# set ubicast account pwd # set ubicast account pwd
echo -e "${UBICAST_PASSWD}\n${UBICAST_PASSWD}" | (passwd -q ubicast) echo -e "${SHELL_UBICAST_PWD}\n${SHELL_UBICAST_PWD}" | (passwd -q ubicast)
# create admin account # create admin account
useradd -m admin --shell /bin/bash useradd -m admin --shell /bin/bash
echo -e "${SHELL_PWD}\n${SHELL_PWD}" | (passwd -q admin) echo -e "${SHELL_ADMIN_PWD}\n${SHELL_ADMIN_PWD}" | (passwd -q admin)
usermod -aG sudo admin usermod -aG sudo admin
# migrate to Ubuntu 16.04 / apply sources.list # migrate to Ubuntu 16.04 / apply sources.list
...@@ -38,15 +38,15 @@ apt-get update && apt-get install -y aptitude && aptitude upgrade -y ...@@ -38,15 +38,15 @@ apt-get update && apt-get install -y aptitude && aptitude upgrade -y
aptitude install -y apt-transport-https pwgen ntpdate aptitude install -y apt-transport-https pwgen ntpdate
# modify sources.list to use ubicast cache # modify sources.list to use ubicast cache
grep ${CACHE} /etc/apt/sources.list grep ${APT_CACHE_HOST} /etc/apt/sources.list
if [ $? = 1 ] if [ $? = 1 ]
then then
sed -i "s@http://@http://${CACHE}/@" /etc/apt/sources.list sed -i "s@http://@http://${APT_CACHE_HOST}/@" /etc/apt/sources.list
fi fi
# APT panel # APT panel
wget -q https://${PANEL}/media/public.gpg -O- | sudo apt-key add - wget -q https://${SKYREACH_HOST}/media/public.gpg -O- | sudo apt-key add -
echo "deb https://${PANEL} packaging/apt/${API}/" > /etc/apt/sources.list.d/skyreach.list echo "deb https://${SKYREACH_HOST} packaging/apt/${SKYREACH_API_KEY}/" > /etc/apt/sources.list.d/skyreach.list
aptitude update aptitude update
# unattended-upgrades # unattended-upgrades
......
...@@ -2,44 +2,42 @@ ...@@ -2,44 +2,42 @@
source /root/envsetup/envsetup.conf source /root/envsetup/envsetup.conf
# Conf setup # Conf setup
sed -i "s@^system_ntp = .*@system_ntp = '${NTP}'@" /root/envsetup/conf.py sed -i "s@^NTP_SERVER1 = .*@NTP_SERVER1 = '${NTP}'@" /root/envsetup/conf.py
sed -i "s@^system_smtp = .*@system_smtp = '${CUST_SMTP}'@" /root/envsetup/conf.py sed -i "s@^SMTP_SERVER = .*@SMTP_SERVER = '${SMTP_SERVER}'@" /root/envsetup/conf.py
sed -i "s@^mysql_root_pwd = .*@mysql_root_pwd = '${MYSQLD_PWD}'@" /root/envsetup/conf.py sed -i "s@^MYSQL_ROOT_PWD = .*@MYSQL_ROOT_PWD = '${MYSQL_ROOT_PWD}'@" /root/envsetup/conf.py
# Wowza # Wowza
sed -i "s@^wowza_server_name = .*@wowza_server_name = '${WOWZA}'@" /root/envsetup/conf.py sed -i "s@^wowza_server_name = .*@wowza_server_name = '${WOWZA}'@" /root/envsetup/conf.py
sed -i "s@^wowza_manager_pwd = .*@wowza_manager_pwd = '${WOWZA_MANAGER_PWD}'@" /root/envsetup/conf.py sed -i "s@^WOWZA_MANAGER_PWD = .*@WOWZA_MANAGER_PWD = '${WOWZA_MANAGER_PWD}'@" /root/envsetup/conf.py
sed -i "s@^wowza_license = .*@wowza_license = '${WOWZA_LICENSE}'@" /root/envsetup/conf.py sed -i "s@^WOWZA_LICENSE = .*@WOWZA_LICENSE = '${WOWZA_LICENSE}'@" /root/envsetup/conf.py
sed -i "s@^wowza_live_pwd = .*@wowza_live_pwd = '${WOWZA_LIVE_PASSWD}'@" /root/envsetup/conf.py sed -i "s@^WOWZA_LIVE_PWD = .*@WOWZA_LIVE_PWD = '${WOWZA_LIVE_PWD}'@" /root/envsetup/conf.py
# MS # MS
sed -i "s@^ms_server_name = .*@ms_server_name = '${MS}'@" /root/envsetup/conf.py sed -i "s@^MS_SERVER_NAME = .*@MS_SERVER_NAME = '${MS_SERVER_NAME}'@" /root/envsetup/conf.py
sed -i "s@^ms_superuser_pwd = .*@ms_superuser_pwd = '${SUPERUSER_PWD}'@" /root/envsetup/conf.py sed -i "s@^MS_SUPERUSER_PWD = .*@MS_SUPERUSER_PWD = '${SUPERUSER_PWD}'@" /root/envsetup/conf.py
sed -i "s@^ms_admin_pwd = .*@ms_admin_pwd = '${ADMIN_PWD}'@" /root/envsetup/conf.py sed -i "s@^MS_ADMIN_PWD = .*@MS_ADMIN_PWD = '${ADMIN_PWD}'@" /root/envsetup/conf.py
if [ "${MS_ID}" = "" ]; then if [ "${MS_ID}" = "" ]; then
MS_ID=$(echo "$(hostname)_msuser") MS_ID=$(echo "$(hostname)_msuser")
fi fi
if [ "${MS_API}" = "" ]; then if [ "${MS_API_KEY}" = "" ]; then
MS_API=$(echo "s$(pwgen 4)-$(pwgen 5)-$(pwgen 5)-$(pwgen 5)-$(pwgen 5)") MS_API_KEY=$(echo "s$(pwgen 4)-$(pwgen 5)-$(pwgen 5)-$(pwgen 5)-$(pwgen 5)")
# respect API pattern # respect API pattern
MS_API=$(echo $MS_API | sed "s@[iloILO]@$((${RANDOM} / 10000))@g") MS_API_KEY=$(echo $MS_API_KEY | sed "s@[iloILO]@$((${RANDOM} / 10000))@g")
fi fi
if [ "${MS_SECRET}" = "" ]; then if [ "${MS_SECRET}" = "" ]; then
MS_SECRET=$(echo "$(pwgen 40)") MS_SECRET=$(echo "$(pwgen 40)")
fi fi
sed -i "s@^ms_id = .*@ms_id = '${MS_ID}'@" /root/envsetup/conf.py sed -i "s@^MS_ID = .*@MS_ID = '${MS_ID}'@" /root/envsetup/conf.py
sed -i "s@^ms_api_key = .*@ms_api_key = '${MS_API}'@" /root/envsetup/conf.py sed -i "s@^MS_API_KEY = .*@MS_API_KEY = '${MS_API_KEY}'@" /root/envsetup/conf.py
sed -i "s@^ms_secret = .*@ms_secret = '${MS_SECRET}'@" /root/envsetup/conf.py sed -i "s@^MS_SECRET = .*@MS_SECRET = '${MS_SECRET}'@" /root/envsetup/conf.py
# SK # SK
sed -i "s@^skyreach_server_name = .*@skyreach_server_name = '${CM}'@" /root/envsetup/conf.py sed -i "s@^CM_SERVER_NAME = .*@CM_SERVER_NAME = '${CM}'@" /root/envsetup/conf.py
sed -i "s@^skyreach_superuser_pwd = .*@skyreach_superuser_pwd = '${CM_SUPERUSER_PWD}'@" /root/envsetup/conf.py sed -i "s@^CM_SUPERUSER_PWD = .*@CM_SUPERUSER_PWD = '${CM_SUPERUSER_PWD}'@" /root/envsetup/conf.py
sed -i "s@^skyreach_admin_pwd = .*@skyreach_admin_pwd = '${CM_ADMIN_PWD}'@" /root/envsetup/conf.py sed -i "s@^CM_ADMIN_PWD = .*@CM_ADMIN_PWD = '${CM_ADMIN_PWD}'@" /root/envsetup/conf.py
# Monitor # Monitor
sed -i "s@^monitor_server_name = .*@monitor_server_name = '${MONITOR}'@" /root/envsetup/conf.py sed -i "s@^MONITOR_SERVER_NAME = .*@MONITOR_SERVER_NAME = '${MONITOR}'@" /root/envsetup/conf.py
sed -i "s@^monitor_superuser_pwd = .*@monitor_superuser_pwd = '${MONITOR_SUPERUSER_PWD}'@" /root/envsetup/conf.py sed -i "s@^MONITOR_SUPERUSER_PWD = .*@MONITOR_SUPERUSER_PWD = '${MONITOR_SUPERUSER_PWD}'@" /root/envsetup/conf.py
sed -i "s@^monitor_admin_pwd = .*@monitor_admin_pwd = '${MONITOR_ADMIN_PWD}'@" /root/envsetup/conf.py sed -i "s@^MONITOR_ADMIN_PWD = .*@MONITOR_ADMIN_PWD = '${MONITOR_ADMIN_PWD}'@" /root/envsetup/conf.py
# Worker # Worker
sed -i "s@^celerity_signing_key = .*@celerity_signing_key = '${CELERIY_SIGNING_KEY}'@" /root/envsetup/conf.py sed -i "s@^CELERITY_SIGNING_KEY = .*@CELERITY_SIGNING_KEY = '${CELERITY_SIGNING_KEY}'@" /root/envsetup/conf.py
# IP for whitelist # IP for whitelist
if [ "${IS_WORKER}" = "1" ]; then CELERITY_WORKER_IP=$(ip addr show | grep inet | grep -v 127 | grep -v ":" | awk -F " " '{print$2}' | awk -F "/" '{print$1}')
WORKER_IP=$(ip addr show | grep inet | grep -v 127 | grep -v ":" | awk -F " " '{print$2}' | awk -F "/" '{print$1}') sed -i "s@^CELERITY_CELERITY_WORKER_IP = .*@CELERITY_CELERITY_WORKER_IP = '${CELERITY_WORKER_IP}'@" /root/envsetup/conf.py
fi
sed -i "s@^celerity_worker_ip = .*@celerity_worker_ip = '${WORKER_IP}'@" /root/envsetup/conf.py
...@@ -13,11 +13,11 @@ def setup(interactive=True): ...@@ -13,11 +13,11 @@ def setup(interactive=True):
'cp "%s/override.conf" "/etc/systemd/system/mysql.service.d/override.conf"' % dir_path, 'cp "%s/override.conf" "/etc/systemd/system/mysql.service.d/override.conf"' % dir_path,
'/etc/init.d/mysql restart', '/etc/init.d/mysql restart',
] ]
mysql_root_pwd = utils.get_conf('mysql_root_pwd') MYSQL_ROOT_PWD = utils.get_conf('MYSQL_ROOT_PWD')
if mysql_root_pwd: if MYSQL_ROOT_PWD:
# Set password if any # Set password if any
cmds.append('mysqladmin -u root password "%s"' % mysql_root_pwd) cmds.append('mysqladmin -u root password "%s"' % MYSQL_ROOT_PWD)
utils.run_commands(cmds) utils.run_commands(cmds)
if not mysql_root_pwd: if not MYSQL_ROOT_PWD:
utils.log('No root password was set in the configuration file.\nUse the following command to change it:\n mysqladmin -u root password <pwd>') utils.log('No root password was set in the configuration file.\nUse the following command to change it:\n mysqladmin -u root password <pwd>')
...@@ -18,7 +18,7 @@ contacts alert ...@@ -18,7 +18,7 @@ contacts alert
contact.alert.command mail -a "From:sysadmin <sysadmin@ubicast.eu>" -s "[munin] Alert on ${var:host}" sysadmin@ubicast.eu contact.alert.command mail -a "From:sysadmin <sysadmin@ubicast.eu>" -s "[munin] Alert on ${var:host}" sysadmin@ubicast.eu
contact.alert.always_send warning critical contact.alert.always_send warning critical
[${MS}] [${MS_SERVER_NAME}]
address 127.0.0.1 address 127.0.0.1
use_node_name yes use_node_name yes
memory.free.warning 512000000: memory.free.warning 512000000:
......
...@@ -19,7 +19,7 @@ def setup(interactive=True): ...@@ -19,7 +19,7 @@ def setup(interactive=True):
'echo "Replacing /etc/postfix/main.cf"', 'echo "Replacing /etc/postfix/main.cf"',
dict(line='write', template='%s/main.cf' % dir_path, target='/etc/postfix/main.cf', params=( dict(line='write', template='%s/main.cf' % dir_path, target='/etc/postfix/main.cf', params=(
('{{ hostname }}', hostname), ('{{ hostname }}', hostname),
('{{ smtp }}', utils.get_conf('system_smtp', '')), ('{{ smtp }}', utils.get_conf('SMTP_SERVER', '')),
)), )),
'echo "%s" > /etc/mailname' % hostname, 'echo "%s" > /etc/mailname' % hostname,
'rgrep root /etc/aliases || echo "root: sysadmin@ubicast.eu" >> /etc/aliases', 'rgrep root /etc/aliases || echo "root: sysadmin@ubicast.eu" >> /etc/aliases',
......
...@@ -7,10 +7,5 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y python3-mediaserver ...@@ -7,10 +7,5 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y python3-mediaserver
# session ms # session ms
msinstaller.py msuser msinstaller.py msuser
# disabling integrated worker if needed
if [ ${IS_WORKER} = "0" ]; then
apt-get remove -y celerity-workers
fi
# mv MS_deploy.sh to /var/tmp # mv MS_deploy.sh to /var/tmp
mv MS_deploy.sh /var/tmp/MS_deploy.sh mv MS_deploy.sh /var/tmp/MS_deploy.sh
...@@ -19,15 +19,15 @@ def setup(interactive=True): ...@@ -19,15 +19,15 @@ def setup(interactive=True):
'[ -f "/tmp/%(name)s" ] || wget -q "https://www.ubicast.eu/media/downloads/packages/%(name)s" -O "/tmp/%(name)s"' % {'name': wowza_setup_name}, '[ -f "/tmp/%(name)s" ] || wget -q "https://www.ubicast.eu/media/downloads/packages/%(name)s" -O "/tmp/%(name)s"' % {'name': wowza_setup_name},
'dpkg -i "/tmp/%s"' % wowza_setup_name, 'dpkg -i "/tmp/%s"' % wowza_setup_name,
# Configure Wowza # Configure Wowza
'echo "%s" > /usr/local/WowzaStreamingEngine/conf/Server.license' % utils.get_conf('wowza_license'), 'echo "%s" > /usr/local/WowzaStreamingEngine/conf/Server.license' % utils.get_conf('WOWZA_LICENSE'),
'echo "ubicast %s admin" > /usr/local/WowzaStreamingEngine/conf/admin.password' % utils.get_conf('wowza_manager_pwd'), 'echo "ubicast %s admin" > /usr/local/WowzaStreamingEngine/conf/admin.password' % utils.get_conf('WOWZA_MANAGER_PWD'),
'update-rc.d WowzaStreamingEngine defaults', 'update-rc.d WowzaStreamingEngine defaults',
'update-rc.d WowzaStreamingEngineManager defaults', 'update-rc.d WowzaStreamingEngineManager defaults',
'chmod +x /usr/local/WowzaStreamingEngine/logs', 'chmod +x /usr/local/WowzaStreamingEngine/logs',
'cp -R /usr/local/WowzaStreamingEngine/examples/LiveVideoStreaming/conf/live /usr/local/WowzaStreamingEngine/conf/', 'cp -R /usr/local/WowzaStreamingEngine/examples/LiveVideoStreaming/conf/live /usr/local/WowzaStreamingEngine/conf/',
'mkdir -p /usr/local/WowzaStreamingEngine/applications/live', 'mkdir -p /usr/local/WowzaStreamingEngine/applications/live',
dict(line='write', template='%s/live-application.xml' % dir_path, target='/usr/local/WowzaStreamingEngine/conf/live/Application.xml', backup=True, params=( dict(line='write', template='%s/live-application.xml' % dir_path, target='/usr/local/WowzaStreamingEngine/conf/live/Application.xml', backup=True, params=(
('{{ live_pwd }}', utils.get_conf('wowza_live_pwd')), ('{{ live_pwd }}', utils.get_conf('WOWZA_LIVE_PWD')),
)), )),
'/etc/init.d/WowzaStreamingEngine restart', '/etc/init.d/WowzaStreamingEngine restart',
'/etc/init.d/WowzaStreamingEngineManager restart', '/etc/init.d/WowzaStreamingEngineManager restart',
......
#!/bin/bash #!/bin/bash
source /root/envsetup/envsetup.conf source /root/envsetup/envsetup.conf
#APT_CACHE_PASSWD=$(cat ${CONF} | egrep ^APT_CACHE_PASSWD | head -1 | awk -F "=" '{print$2}') #APT_CACHER_PWD=$(cat ${CONF} | egrep ^APT_CACHER_PWD | head -1 | awk -F "=" '{print$2}')
APT_CACHE_PASSWD=$(pwgen 12) APT_CACHER_PWD=$(pwgen 12)
# installation cm # installation cm
aptitude install -y campus-manager aptitude install -y campus-manager
...@@ -10,7 +10,7 @@ aptitude install -y campus-manager ...@@ -10,7 +10,7 @@ aptitude install -y campus-manager
# installation cache local # installation cache local
aptitude install -y apt-cacher-ng aptitude install -y apt-cacher-ng
# secure it # secure it
echo "AdminAuth: ${APT_CACHE_USER}:${APT_CACHE_PASSWD}" >> /etc/apt-cacher-ng/security.conf echo "AdminAuth: ${APT_CACHER_USER}:${APT_CACHER_PWD}" >> /etc/apt-cacher-ng/security.conf
service apt-cacher-ng restart service apt-cacher-ng restart
# proxy # proxy
...@@ -29,7 +29,7 @@ fi ...@@ -29,7 +29,7 @@ fi
# configure nginx # configure nginx
python3 /root/envsetup/envsetup.py 7 python3 /root/envsetup/envsetup.py 7
# devrait être inutile mais pb constaté avec jenkins # devrait être inutile mais pb constaté avec jenkins
sed -i "s@server_name skyreach;@server_name ${CM};@" /etc/nginx/sites-available/skyreach.conf sed -i "s@server_name skyreach;@server_name ${CM_SERVER_NAME};@" /etc/nginx/sites-available/skyreach.conf
#~mv /etc/nginx/sites-enabled/skyreach.conf.tmp /etc/nginx/sites-enabled/skyreach.conf #~mv /etc/nginx/sites-enabled/skyreach.conf.tmp /etc/nginx/sites-enabled/skyreach.conf
service nginx restart service nginx restart
......
...@@ -13,7 +13,7 @@ def setup(interactive=True): ...@@ -13,7 +13,7 @@ def setup(interactive=True):
if ftpmsuploader and ftpstorage and ftpadmin: if ftpmsuploader and ftpstorage and ftpadmin:
cmds.append('mkdir -p /etc/hca') cmds.append('mkdir -p /etc/hca')
cmds.append(dict(line='write', template='%s/http.ini' % dir_path, target='/etc/hca/http.ini', params=( cmds.append(dict(line='write', template='%s/http.ini' % dir_path, target='/etc/hca/http.ini', params=(
('{{ ms_server_name }}', utils.get_conf('ms_server_name', 'mediaserver')), ('{{ MS_SERVER_NAME }}', utils.get_conf('MS_SERVER_NAME', 'mediaserver')),
('{{ ftp_server_name }}', utils.get_conf('ftp_server_name', 'videos')), ('{{ ftp_server_name }}', utils.get_conf('ftp_server_name', 'videos')),
('{{ ftp_storage_pwd }}', ftpstorage), ('{{ ftp_storage_pwd }}', ftpstorage),
('{{ ftp_msuploader_pwd }}', ftpmsuploader), ('{{ ftp_msuploader_pwd }}', ftpmsuploader),
...@@ -22,11 +22,11 @@ def setup(interactive=True): ...@@ -22,11 +22,11 @@ def setup(interactive=True):
else: else:
print('Configuration of HCA http.ini file skipped (no FTP passwords in config).') print('Configuration of HCA http.ini file skipped (no FTP passwords in config).')
# rtmp.ini # rtmp.ini
streaming_pwd = utils.get_conf('wowza_live_pwd') streaming_pwd = utils.get_conf('WOWZA_LIVE_PWD')
if streaming_pwd: if streaming_pwd:
cmds.append('mkdir -p /etc/hca') cmds.append('mkdir -p /etc/hca')
cmds.append(dict(line='write', template='%s/rtmp.ini' % dir_path, target='/etc/hca/rtmp.ini', params=( cmds.append(dict(line='write', template='%s/rtmp.ini' % dir_path, target='/etc/hca/rtmp.ini', params=(
('{{ ms_server_name }}', utils.get_conf('ms_server_name', 'mediaserver')), ('{{ MS_SERVER_NAME }}', utils.get_conf('MS_SERVER_NAME', 'mediaserver')),
('{{ streaming_pwd }}', streaming_pwd), ('{{ streaming_pwd }}', streaming_pwd),
))) )))
else: else:
......
...@@ -9,7 +9,7 @@ user = "ftpstorage" ...@@ -9,7 +9,7 @@ user = "ftpstorage"
password = "{{ ftp_storage_pwd }}" password = "{{ ftp_storage_pwd }}"
#[rtmp] #[rtmp]
#server = "rtmp://{{ ms_server_name }}/vod" #server = "rtmp://{{ MS_SERVER_NAME }}/vod"
#pattern = "%(video_path)s" #pattern = "%(video_path)s"
#[hls] #[hls]
......
port=1935 port=1935
server="{{ ms_server_name }}" server="{{ MS_SERVER_NAME }}"
app="live/_definst_?doPublish={{ streaming_pwd }}" app="live/_definst_?doPublish={{ streaming_pwd }}"
enable_hls="yes" enable_hls="yes"
hls_uri_template="https://{{ ms_server_name }}/streaming/%(stream_id)s/Playlist.m3u8" hls_uri_template="https://{{ MS_SERVER_NAME }}/streaming/%(stream_id)s/Playlist.m3u8"
...@@ -8,10 +8,10 @@ def setup(interactive=True): ...@@ -8,10 +8,10 @@ def setup(interactive=True):
cmds = [ cmds = [
'apt-get install --yes celerity-server', 'apt-get install --yes celerity-server',
dict(line='write', template='%s/celerity-config.py' % dir_path, target='/etc/celerity/config.py', params=( dict(line='write', template='%s/celerity-config.py' % dir_path, target='/etc/celerity/config.py', params=(
('{{ signing_key }}', utils.get_conf('celerity_signing_key', 'undefined')), ('{{ signing_key }}', utils.get_conf('CELERITY_SIGNING_KEY', 'undefined')),
('{{ ms_server_name }}', utils.get_conf('ms_server_name', 'undefined')), ('{{ MS_SERVER_NAME }}', utils.get_conf('MS_SERVER_NAME', 'undefined')),
('{{ ms_id }}', utils.get_conf('ms_id', 'ms_id')), ('{{ MS_ID }}', utils.get_conf('MS_ID', 'MS_ID')),
('{{ ms_api_key }}', utils.get_conf('ms_api_key', 'ms_api_key')), ('{{ MS_API_KEY }}', utils.get_conf('MS_API_KEY', 'MS_API_KEY')),
)), )),
'service celerity-server restart', 'service celerity-server restart',
] ]
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SIGNING_KEY = '{{ signing_key }}' SIGNING_KEY = '{{ signing_key }}'
SERVER_URL = 'https://{{ ms_server_name }}:6200' SERVER_URL = 'https://{{ MS_SERVER_NAME }}:6200'
# MediaServer interactions # MediaServer interactions
MEDIASERVERS = { MEDIASERVERS = {
'{{ ms_id }}': {'url': 'https://{{ ms_server_name }}', 'api_key': '{{ ms_api_key }}'}, '{{ MS_ID }}': {'url': 'https://{{ MS_SERVER_NAME }}', 'api_key': '{{ MS_API_KEY }}'},
} }
...@@ -8,10 +8,10 @@ def setup(interactive=True): ...@@ -8,10 +8,10 @@ def setup(interactive=True):
cmds = [ cmds = [
'apt-get install --yes celerity-workers', 'apt-get install --yes celerity-workers',
dict(line='write', template='%s/celerity-config.py' % dir_path, target='/etc/celerity/config.py', params=( dict(line='write', template='%s/celerity-config.py' % dir_path, target='/etc/celerity/config.py', params=(
('{{ signing_key }}', utils.get_conf('celerity_signing_key', 'undefined')), ('{{ signing_key }}', utils.get_conf('CELERITY_SIGNING_KEY', 'undefined')),
('{{ ms_server_name }}', utils.get_conf('ms_server_name', 'undefined')), ('{{ MS_SERVER_NAME }}', utils.get_conf('MS_SERVER_NAME', 'undefined')),
('{{ ms_id }}', utils.get_conf('ms_id', 'ms_id')), ('{{ MS_ID }}', utils.get_conf('MS_ID', 'MS_ID')),
('{{ ms_api_key }}', utils.get_conf('ms_api_key', 'ms_api_key')), ('{{ MS_API_KEY }}', utils.get_conf('MS_API_KEY', 'MS_API_KEY')),
)), )),
'service celerity-workers restart', 'service celerity-workers restart',
] ]
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SIGNING_KEY = '{{ signing_key }}' SIGNING_KEY = '{{ signing_key }}'
SERVER_URL = 'https://{{ ms_server_name }}:6200' SERVER_URL = 'https://{{ MS_SERVER_NAME }}:6200'
# MediaServer interactions # MediaServer interactions
MEDIASERVERS = { MEDIASERVERS = {
'{{ ms_id }}': {'url': 'https://{{ ms_server_name }}', 'api_key': '{{ ms_api_key }}'}, '{{ MS_ID }}': {'url': 'https://{{ MS_SERVER_NAME }}', 'api_key': '{{ MS_API_KEY }}'},
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment