I've been playing around with ansible and with WinRM to manage windows servers and have been slightly successful with it to run basic commands.
However when i try to run an exe file from within the powershell script, it fails.
The same powershell script when i run from windows directly, it runs perfectly without any errors. The only error it throws out is an Access Denied error which would link to permissions, however being the Administrator, it should have full permissions no?
The powershell script i try to run is:
The error Ansible throws out is:
And looking at the summary log file it shows:
The exception help link doesn't go anywhere either when I click on it.
I tried passing the credentials as well with Start-Process but that doesn't work either as I'm probably using it wrong since i have to pass the configuration file in as a parameter.
I've run the following ansible script on the Windows Host: https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1
And I know it's working fine as I can run other scripts which include, downloading files from S3 and auto-joining to a domain.
Has anyone successfully installed an exe file in windows via ansible? Any help will awesome, as maybe I might even have over-looked something simple?
However when i try to run an exe file from within the powershell script, it fails.
The same powershell script when i run from windows directly, it runs perfectly without any errors. The only error it throws out is an Access Denied error which would link to permissions, however being the Administrator, it should have full permissions no?
The powershell script i try to run is:
Write-Host "Installing SQL Server" C:\software-downloads\SQL\setup.exe /ConfigurationFile=C:\software-downloads\ConfigurationFile.ini
The error Ansible throws out is:
The following error occurred: There was an error generating the XML document. Error result: -2068774911 Result facility code: 1201 Result error code: 1 Please review the summary.txt log for further details
And looking at the summary log file it shows:
Overall summary:
Final result: Failed: see details below
Exit code (Decimal): -2068774911
Exit facility code: 1201
Exit error code: 1
Exit message: There was an error generating the XML document.
Start time: 2016-06-24 06:47:55
End time: 2016-06-24 06:48:15
Requested action: Install
Exception help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.4100.1&EvtType=0xE0C083E6%400xF80B8030&EvtType=0xE0C083E6%400xF80B8030
Exception summary:
The following is an exception stack listing the exceptions in outermost to innermost order
Inner exceptions are being indented
Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException
Message:
There was an error generating the XML document.
HResult : 0x84b10001
FacilityCode : 1201 (4b1)
ErrorCode : 1 (0001)
Data:
DisableWatson = true
Stack:
at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)
at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(Object objectToSerialize)
at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.CalculateSettings(IEnumerable`1 settingIds)
at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.CalculateAllSettings(Boolean chainerSettingOnly)
at Microsoft.SqlServer.Configuration.SetupExtension.FinalCalculateSettingsAction.ExecuteAction(String actionId)
at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.<>c__DisplayClasse.<ExecuteActionWithRetryHelper>b__b()
at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(ActionWorker workerDelegate)
Inner exception type: System.InvalidOperationException
Message:
There was an error generating the XML document.
HResult : 0x80131509
Stack:
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o)
at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)
Inner exception type: System.Security.Cryptography.CryptographicException
Message:
Access is denied.
HResult : 0x80070005
Stack:
at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)
at Microsoft.SqlServer.Common.SqlSecureString.WriteXml(XmlWriter writer)
at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterAgentConfigurationPublic.Write6_AgentConfigurationPublic(String n, String ns, AgentConfigurationPublic o, Boolean isNullable, Boolean needType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterAgentConfigurationPublic.Write7_AgentConfigurationPublic(Object o)The exception help link doesn't go anywhere either when I click on it.
I tried passing the credentials as well with Start-Process but that doesn't work either as I'm probably using it wrong since i have to pass the configuration file in as a parameter.
I've run the following ansible script on the Windows Host: https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1
And I know it's working fine as I can run other scripts which include, downloading files from S3 and auto-joining to a domain.
Has anyone successfully installed an exe file in windows via ansible? Any help will awesome, as maybe I might even have over-looked something simple?