Introduce htmlTermination switch for future AppGW integration

This commit is contained in:
Hosung Song 2018-05-03 16:09:02 -07:00
Родитель 02b96ef0a2
Коммит 0c1665a374
5 изменённых файлов: 69 добавлений и 53 удалений

Просмотреть файл

@ -72,6 +72,17 @@
},
"type": "bool"
},
"httpsTermination": {
"allowedValues": [
"VMSS",
"None"
],
"defaultValue": "VMSS",
"metadata": {
"description": "Indicates where https termination occurs. 'VMSS' is for https termination at the VMSS instance VMs (using nginx https proxy). 'None' is for a manually integrated Application Gateway https termination (or any other such facility). 'None' should not be used without a properly configured-and-connected Application Gateway or a corresponding https termination layer."
},
"type": "string"
},
"siteURL": {
"defaultValue": "www.example.org",
"metadata": {
@ -808,6 +819,7 @@
"glusterVmCount": 2,
"glusterVmSku": "[parameters('glusterVmSku')]",
"htmlLocalCopySwitch": "[parameters('htmlLocalCopySwitch')]",
"httpsTermination": "[parameters('httpsTermination')]",
"installGdprPluginsSwitch": "[parameters('installGdprPluginsSwitch')]",
"installO365pluginsSwitch": "[parameters('installO365pluginsSwitch')]",
"installObjectFsSwitch": "[parameters('installObjectFsSwitch')]",

Просмотреть файл

@ -37,7 +37,7 @@
]
},
"protectedSettings":{
"commandToExecute": "[concat('bash ', parameters('moodleCommon').moodleInstallScriptFilename, ' ', parameters('moodleCommon').moodleVersion, ' ', concat(parameters('moodleCommon').gfsNameRoot, '0'), ' ', 'data', ' ', parameters('moodleCommon').siteURL, ' ', parameters('moodleCommon').dbDNS, ' ', parameters('moodleCommon').moodleDbName, ' ', parameters('moodleCommon').moodleDbUser, ' ', parameters('moodleCommon').moodleDbPass, ' ', parameters('moodleCommon').moodleAdminPass, ' ', concat(parameters('moodleCommon').dbLogin, '@', parameters('moodleCommon').dbServerType, '-', parameters('moodleCommon').resourcesPrefix), ' ', parameters('moodleCommon').dbLoginPassword, ' ', parameters('moodleCommon').storageAccountName, ' ', listKeys(variables('storageAccountId'), '2017-06-01').keys[0].value, ' ', parameters('moodleCommon').moodleDbUserAzure, ' ', parameters('moodleCommon').redisDns, ' ', parameters('redisKey'), ' ', parameters('moodleCommon').elasticVm1IP, ' ', parameters('moodleCommon').installO365pluginsSwitch, ' ', parameters('moodleCommon').dbServerType, ' ', parameters('moodleCommon').fileServerType , ' ', parameters('moodleCommon').mssqlDbServiceObjectiveName, ' ', parameters('moodleCommon').mssqlDbEdition, ' ', parameters('moodleCommon').mssqlDbSize, ' ', parameters('moodleCommon').installObjectFsSwitch, ' ', parameters('moodleCommon').installGdprPluginsSwitch, ' ', parameters('moodleCommon').thumbprintSslCert, ' ', parameters('moodleCommon').thumbprintCaCert, ' ', parameters('moodleCommon').searchType, ' ', parameters('azureSearchKey'), ' ', parameters('moodleCommon').azureSearchNameHost)]"
"commandToExecute": "[concat('bash ', parameters('moodleCommon').moodleInstallScriptFilename, ' ', parameters('moodleCommon').moodleVersion, ' ', concat(parameters('moodleCommon').gfsNameRoot, '0'), ' data ', parameters('moodleCommon').siteURL, ' ', parameters('moodleCommon').httpsTermination, ' ', parameters('moodleCommon').dbDNS, ' ', parameters('moodleCommon').moodleDbName, ' ', parameters('moodleCommon').moodleDbUser, ' ', parameters('moodleCommon').moodleDbPass, ' ', parameters('moodleCommon').moodleAdminPass, ' ', concat(parameters('moodleCommon').dbLogin, '@', parameters('moodleCommon').dbServerType, '-', parameters('moodleCommon').resourcesPrefix), ' ', parameters('moodleCommon').dbLoginPassword, ' ', parameters('moodleCommon').storageAccountName, ' ', listKeys(variables('storageAccountId'), '2017-06-01').keys[0].value, ' ', parameters('moodleCommon').moodleDbUserAzure, ' ', parameters('moodleCommon').redisDns, ' ', parameters('redisKey'), ' ', parameters('moodleCommon').elasticVm1IP, ' ', parameters('moodleCommon').installO365pluginsSwitch, ' ', parameters('moodleCommon').dbServerType, ' ', parameters('moodleCommon').fileServerType , ' ', parameters('moodleCommon').mssqlDbServiceObjectiveName, ' ', parameters('moodleCommon').mssqlDbEdition, ' ', parameters('moodleCommon').mssqlDbSize, ' ', parameters('moodleCommon').installObjectFsSwitch, ' ', parameters('moodleCommon').installGdprPluginsSwitch, ' ', parameters('moodleCommon').thumbprintSslCert, ' ', parameters('moodleCommon').thumbprintCaCert, ' ', parameters('moodleCommon').searchType, ' ', parameters('azureSearchKey'), ' ', parameters('moodleCommon').azureSearchNameHost)]"
},
"type": "CustomScript",
"typeHandlerVersion": "2.0"

Просмотреть файл

@ -48,7 +48,7 @@
]
},
"protectedSettings":{
"commandToExecute": "[concat('bash ',parameters('moodleCommon').webServerSetupScriptFilename,' ',parameters('moodleCommon').gfsNameRoot,'0', ' ','data', ' ', parameters('moodleCommon').siteURL, ' ', concat('controller-vm-',parameters('moodleCommon').resourcesPrefix), ' ', parameters('moodleCommon').webServerType, ' ', parameters('moodleCommon').fileServerType, ' ', parameters('moodleCommon').storageAccountName, ' ', listKeys(variables('storageAccountId'), '2017-06-01').keys[0].value, ' ', parameters('moodleCommon').ctlrVmName, ' ', parameters('moodleCommon').htmlLocalCopySwitch)]"
"commandToExecute": "[concat('bash ', parameters('moodleCommon').webServerSetupScriptFilename, ' ', concat(parameters('moodleCommon').gfsNameRoot, '0'), ' data ', parameters('moodleCommon').siteURL, ' ', parameters('moodleCommon').httpsTermination, ' ', concat('controller-vm-',parameters('moodleCommon').resourcesPrefix), ' ', parameters('moodleCommon').webServerType, ' ', parameters('moodleCommon').fileServerType, ' ', parameters('moodleCommon').storageAccountName, ' ', listKeys(variables('storageAccountId'), '2017-06-01').keys[0].value, ' ', parameters('moodleCommon').ctlrVmName, ' ', parameters('moodleCommon').htmlLocalCopySwitch)]"
},
"type": "CustomScript",
"typeHandlerVersion": "2.0"

Просмотреть файл

@ -26,37 +26,39 @@
glusterNode=${2}
glusterVolume=${3}
siteFQDN=${4}
dbIP=${5}
moodledbname=${6}
moodledbuser=${7}
moodledbpass=${8}
adminpass=${9}
dbadminlogin=${10}
dbadminpass=${11}
wabsacctname=${12}
wabsacctkey=${13}
azuremoodledbuser=${14}
redisDns=${15}
redisAuth=${16}
elasticVm1IP=${17}
installO365pluginsSwitch=${18}
dbServerType=${19}
fileServerType=${20}
mssqlDbServiceObjectiveName=${21}
mssqlDbEdition=${22}
mssqlDbSize=${23}
installObjectFsSwitch=${24}
installGdprPluginsSwitch=${25}
thumbprintSslCert=${26}
thumbprintCaCert=${27}
searchType=${28}
azureSearchKey=${29}
azureSearchNameHost=${30}
httpsTermination=${5}
dbIP=${6}
moodledbname=${7}
moodledbuser=${8}
moodledbpass=${9}
adminpass=${10}
dbadminlogin=${11}
dbadminpass=${12}
wabsacctname=${13}
wabsacctkey=${14}
azuremoodledbuser=${15}
redisDns=${16}
redisAuth=${17}
elasticVm1IP=${18}
installO365pluginsSwitch=${19}
dbServerType=${20}
fileServerType=${21}
mssqlDbServiceObjectiveName=${22}
mssqlDbEdition=${23}
mssqlDbSize=${24}
installObjectFsSwitch=${25}
installGdprPluginsSwitch=${26}
thumbprintSslCert=${27}
thumbprintCaCert=${28}
searchType=${29}
azureSearchKey=${30}
azureSearchNameHost=${31}
echo $moodleVersion >> /tmp/vars.txt
echo $glusterNode >> /tmp/vars.txt
echo $glusterVolume >> /tmp/vars.txt
echo $siteFQDN >> /tmp/vars.txt
echo $httpsTermination >> /tmp/vars.txt
echo $dbIP >> /tmp/vars.txt
echo $moodledbname >> /tmp/vars.txt
echo $moodledbuser >> /tmp/vars.txt
@ -348,7 +350,7 @@ server {
listen 81 default;
server_name ${siteFQDN};
root /moodle/html/moodle;
index index.php index.html index.htm;
index index.php index.html index.htm;
# Log to syslog
error_log syslog:server=localhost,facility=local1,severity=error,tag=moodle;
@ -379,26 +381,26 @@ server {
try_files \$uri \$uri/index.php?\$query_string;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f \$document_root\$fastcgi_script_name) {
return 404;
}
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_read_timeout 3600;
fastcgi_index index.php;
include fastcgi_params;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f \$document_root\$fastcgi_script_name) {
return 404;
}
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_read_timeout 3600;
fastcgi_index index.php;
include fastcgi_params;
}
}
server {
listen 443 ssl;
root /moodle/html/moodle;
index index.php index.html index.htm;
index index.php index.html index.htm;
ssl on;
ssl_certificate /moodle/certs/nginx.crt;

Просмотреть файл

@ -22,20 +22,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
glusterNode=$1
glusterVolume=$2
siteFQDN=$3
syslogserver=$4
webServerType=$5
fileServerType=$6
storageAccountName=$7
storageAccountKey=$8
nfsVmName=$9
htmlLocalCopySwitch=${10}
glusterNode=${1}
glusterVolume=${2}
siteFQDN=${3}
httpsTermination=${4}
syslogserver=${5}
webServerType=${6}
fileServerType=${7}
storageAccountName=${8}
storageAccountKey=${9}
nfsVmName=${10}
htmlLocalCopySwitch=${11}
echo $glusterNode >> /tmp/vars.txt
echo $glusterVolume >> /tmp/vars.txt
echo $siteFQDN >> /tmp/vars.txt
echo $httpsTermination >> /tmp/vars.txt
echo $syslogserver >> /tmp/vars.txt
echo $webServerType >> /tmp/vars.txt
echo $fileServerType >> /tmp/vars.txt