diff --git a/data/demo_init.sh b/data/demo_init.sh deleted file mode 100644 index a08f32c..0000000 --- a/data/demo_init.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -AgentConfigBase64='%AGENT_CONFIG_BASE64%' - -mkdir /etc/murano - -echo $AgentConfigBase64 | base64 -d > /etc/murano/agent.config - -/etc/init.d/murano-agent restart - diff --git a/data/init.ps1 b/data/init.ps1 deleted file mode 100644 index 9fbba22..0000000 --- a/data/init.ps1 +++ /dev/null @@ -1,68 +0,0 @@ -#ps1 - -$WindowsAgentConfigBase64 = '%AGENT_CONFIG_BASE64%' -$WindowsAgentConfigFile = "C:\Murano\Agent\WindowsAgent.exe.config" -$WindowsAgentLogFile = "C:\Murano\Agent\log.txt" - -$NewComputerName = '%INTERNAL_HOSTNAME%' -$MuranoFileShare = '\\%MURANO_SERVER_ADDRESS%\share' - -$CaRootCertBase64 = "%CA_ROOT_CERT_BASE64%" -$CaRootCertFile = "C:\Murano\ca.cert" - -$RestartRequired = $false - -Import-Module CoreFunctions -Initialize-Logger 'CloudBase-Init' 'C:\Murano\PowerShell.log' - -$ErrorActionPreference = 'Stop' - -trap { - Write-LogError '' - Write-LogError $_ -EntireObject - Write-LogError '' - exit 1 -} - -Write-Log "Importing CA certificate ..." -if ($CaRootCertBase64 -eq '') { - Write-Log "Importing CA certificate ... skipped" -} -else { - ConvertFrom-Base64String -Base64String $CaRootCertBase64 -Path $CaRootCertFile - $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $CaRootCertFile - $store = New-Object System.Security.Cryptography.X509Certificates.X509Store("AuthRoot","LocalMachine") - $store.Open("MaxAllowed") - $store.Add($cert) - $store.Close() - Write-Log "Importing CA certificate ... done" -} - -Write-Log "Updating Murano Windows Agent." -Stop-Service "Murano Agent" -Backup-File $WindowsAgentConfigFile -Remove-Item $WindowsAgentConfigFile -Force -Remove-Item $WindowsAgentLogFile -Force -ConvertFrom-Base64String -Base64String $WindowsAgentConfigBase64 -Path $WindowsAgentConfigFile -Exec sc.exe 'config','"Murano Agent"','start=','delayed-auto' -Write-Log "Service has been updated." - -Write-Log "Adding environment variable 'MuranoFileShare' = '$MuranoFileShare' ..." -[Environment]::SetEnvironmentVariable('MuranoFileShare', $MuranoFileShare, [EnvironmentVariableTarget]::Machine) -Write-Log "Environment variable added." - -Write-Log "Renaming computer to '$NewComputerName' ..." -$null = Rename-Computer -NewName $NewComputerName -Force - -Write-Log "New name assigned, restart required." -$RestartRequired = $true - - -Write-Log 'All done!' -if ( $RestartRequired ) { - Write-Log "Restarting computer ..." - Restart-Computer -Force -} -else { - Start-Service 'Murano Agent' -} diff --git a/data/templates/agent-config/Default.template b/data/templates/agent-config/Default.template deleted file mode 100644 index 33881c9..0000000 --- a/data/templates/agent-config/Default.template +++ /dev/null @@ -1,36 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/data/templates/agent-config/Demo.template b/data/templates/agent-config/Demo.template deleted file mode 100644 index 8fec1df..0000000 --- a/data/templates/agent-config/Demo.template +++ /dev/null @@ -1,8 +0,0 @@ -RABBITMQ_HOST = "%RABBITMQ_HOST%" -RABBITMQ_PORT = "%RABBITMQ_PORT%" -RABBITMQ_USERNAME = "%RABBITMQ_USER%" -RABBITMQ_PASSWORD = "%RABBITMQ_PASSWORD%" -RABBITMQ_VHOST = "%RABBITMQ_VHOST%" -RABBITMQ_INPUT_QUEUE = "%RABBITMQ_INPUT_QUEUE%" -RESULT_QUEUE = "%RESULT_QUEUE%" -RABBITMQ_RESULT_ROUTING_KEY = "%RESULT_QUEUE%" diff --git a/etc/init-scripts/linux_init.sh b/etc/init-scripts/linux_init.sh index e9f8ffd..9667f4b 100644 --- a/etc/init-scripts/linux_init.sh +++ b/etc/init-scripts/linux_init.sh @@ -1,6 +1,11 @@ #!/bin/sh -AgentConfigBase64='%AGENT_CONFIG_BASE64%' service murano-agent stop -echo $AgentConfigBase64 | base64 -d > /etc/murano-agent.conf + +AgentConfigBase64='%AGENT_CONFIG_BASE64%' + +mkdir /etc/murano +echo $AgentConfigBase64 | base64 -d > /etc/murano/agent.conf +chmod 664 /etc/murano/agent.conf + service murano-agent start