2016-03-23 7 views
0

Ich habe ein Playbook, das ein PowerShell-Skript ausführt, um ein Octopus Deploy Tentacle zu konfigurieren.Automatische Konfiguration von Octopus Tentacle mit Ansible

Wenn ich dieses PowerShell-Skript auf dem Server ausführen, funktioniert es einwandfrei. Wenn ich Playbook mit dem PowerShell-Skript ausführen, schlägt es auf dem Server fehl.

Was könnte das möglicherweise verursachen? Berechtigungen? Auszeit?

Playbook: 
--- 
- name: Configure Octopus Deploy Tentecle 
    hosts: all 
    tasks: 
    - name: Configure Octopus Deploy Tentecle 
     script: files/octo_autoconfig.ps1 

Powershell-Skript:

& "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" create-instance --instance "Tentacle" --config "C:\Octopus\Tentacle.config" --console; 
& "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" new-certificate --instance "Tentacle" --if-blank --console; 
& "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" configure --instance "Tentacle" --reset-trust --console; 
& "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" configure --instance "Tentacle" --home "C:\Octopus" --app "C:\Octopus\Applications" --port "10933" --noListen "False" --console; 
& "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" configure --instance "Tentacle" --trust "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" --console; 
& "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" service --instance "Tentacle" --install --start --console; 

Fehler ich, wenn ich offen Octopus Tentacle versuchen nach dem Textbuch läuft Octopus config:

System.NullReferenceException: Object reference not set to an instance of an object. 
    at Octopus.Tools.TentacleConfiguration.TentacleManager.TentacleManagerModel.Reload(ApplicationInstanceRecord applicationInstance) in y:\work\refs\heads\master\source\Octopus.Tools\TentacleConfiguration\TentacleManager\TentacleManagerModel.cs:line 131 
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 

Beachten Sie, dass, wenn ich das Powershell-Skript laufen direkt Auf dem Server funktioniert es einwandfrei und konfiguriert den Tentakel. Wenn ich dann das Tentakel entferne und dann das Playbook abspiele funktioniert es. Es ist also so, als ob das Tentakel zuerst direkt auf dem Server konfiguriert werden muss, bevor ein Ansible-Playbook funktionieren kann. Welche Art von Niederlagen den Punkt.

Ich schaute auf die Ereignisanzeige des Servers und es gab ein paar Zugriff verweigert Fehler, wie der folgende.

Gibt es eine Möglichkeit, dieses Skript mit einem bestimmten Admin-Benutzer auszuführen, so dass keine Zugriffsverweigerungsfehler vorliegen?

2016-02-24 15:53:12.2675  1 FATAL System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) 
    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) 
    at Octopus.Shared.Internals.CertificateGeneration.Win32ErrorHelper.ThrowExceptionIfGetLastErrorIsNotZero() in y:\work\refs\heads\master\source\Octopus.Shared\Internals\CertificateGeneration\Win32ErrorHelper.cs:line 13 
    at Octopus.Shared.Internals.CertificateGeneration.CryptContext.Open() in y:\work\refs\heads\master\source\Octopus.Shared\Internals\CertificateGeneration\CryptContext.cs:line 38 
    at Octopus.Shared.Security.CertificateGenerator.Generate(String fullName, Boolean exportable) in y:\work\refs\heads\master\source\Octopus.Shared\Security\CertificateGenerator.cs:line 27 
    at Octopus.Shared.Configuration.TentacleConfiguration.GenerateNewCertificate() in y:\work\refs\heads\master\source\Octopus.Shared\Configuration\TentacleConfiguration.cs:line 188 
    at Octopus.Tentacle.Commands.NewCertificateCommand.Start() in y:\work\refs\heads\master\source\Octopus.Tentacle\Commands\NewCertificateCommand.cs:line 58 
    at Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in y:\work\refs\heads\master\source\Octopus.Shared\Startup\AbstractCommand.cs:line 58 
    at Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown) in y:\work\refs\heads\master\source\Octopus.Shared\Startup\ConsoleHost.cs:line 36 

Antwort

Verwandte Themen