I am working to automate our deployment process with ansible but am running
into a permissions issue. I have a playbook that uses the raw module to
call a deploy.ps1 file that is on a remote windows server. This deploy.ps1
file does some work and then calls an install.ps1 command using the
following syntax "Invoke-Command -ComputerName $server -filepath
$from\install.ps1 -argumentlist $version,$siteName" The problem is
install.ps1 needs to be run as administrator in order to work (it makes
some changes to IIS). I can run deploy.ps1 (and install.ps1) from an
administrator powershell window but they fail when I run them from a
non-admin powershell window.
Is there a way to tell the raw command to run the powershell as admin?
Copied below is the error message.
"stderr": "[localhost] Connecting to remote server localhost failed with
the following \r\nerror message : Access is denied. For more information,
see the \r\nabout_Remote_Troubleshooting Help topic.\r\n + CategoryInfo
: OpenError: (localhost:String) [], PSRemotingTran \r\n
sportException\r\n + FullyQualifiedErrorId :
AccessDenied,PSSessionStateBroken\r\n",
"stdout": "\nDeploying EdgeTestTool version:532 to servers:
localhost\n\tCopying files to localhost\n\nFile copy complete. Starting
install\n\tInstalling on remote server localhost in site Default Web
Site\nC:\\surescripts\\edge\\532\\archive\\EdgeTestTool.Web\\obj\\x64\\Debug\\Package\\PackageTmp,
532, Default Web Site\r\n\nDone Deploying EdgeTestTool version:532 to
servers: localhost\n\n",
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/50ec8962-9196-4fcc-a7f7-7892c3513065%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.