O haya
2015-07-30 17:34:24 UTC
Hi,
I have started trying to replicate some of the things that we are currently
doing with Chef, but with Ansible. One of these is installing Microsoft
Sharepoint (on Windows 2008 R2).
In Chef, I do this using some Powershell scripting, so I am trying to do
that with Ansible.
I am using this simple Playbook which I found and modified to run a
Powershell script:
---
# This playbook tests the script module on Windows hosts
- name: Run powershell script
hosts: windows
gather_facts: false
tasks:
- name: Run powershell script
script: scripts/install.ps1
The install.ps1 looks something like:
dism /Online /quiet /Enable-Feature ...
cd c:\Sharepoint2007SP2files
echo "About to run setup.exe..." >> c:/install-SHAREPOINT2007FULL.log
Start-Process ./setup.exe -ArgumentList ... -Wait >>
c:/install-SHAREPOINT2007FULL.log
echo "About to CD..." >> c:/install-SHAREPOINT2007FULL.log
cd "C:/Program Files/Common Files/Microsoft Shared/Web Server
Extensions/12/BIN/"
echo "About to run psconfig.exe..." >> c:/install-SHAREPOINT2007FULL.log
Start-Process -FilePath ./psconfig.exe -ArgumentList ... -Wait >>
c:/install-SHAREPOINT2007FULL.log
echo "ALL DONE!!" >> c:/install-SHAREPOINT2007FULL.log
When I try to run the Playbook using Ansible, I get this:
PLAY [Run powershell script]
**************************************************
TASK: [Run powershell script]
*************************************************
changed: [ansibleclient1.whatever.com]
PLAY RECAP
********************************************************************
ansibleclient1.whatever.com : ok=1 changed=1 unreachable=0 failed=0
And that completes almost immediately, and when I look at that log file, I
see the output messages, but it looks like the actual installation steps
that are supposed to run under "Start-Process" are not being invoked at
all. I can tell this is the case because files that are supposed to be
created during the Setup.exe and psconfig.exe runs are not being created.
I ran the same Powershell script "manually" and it works
correctly/completely.
Does anyone know why these commands are being skipped when this Powershell
script is run under Ansible?
Thanks,
Jim
I have started trying to replicate some of the things that we are currently
doing with Chef, but with Ansible. One of these is installing Microsoft
Sharepoint (on Windows 2008 R2).
In Chef, I do this using some Powershell scripting, so I am trying to do
that with Ansible.
I am using this simple Playbook which I found and modified to run a
Powershell script:
---
# This playbook tests the script module on Windows hosts
- name: Run powershell script
hosts: windows
gather_facts: false
tasks:
- name: Run powershell script
script: scripts/install.ps1
The install.ps1 looks something like:
dism /Online /quiet /Enable-Feature ...
cd c:\Sharepoint2007SP2files
echo "About to run setup.exe..." >> c:/install-SHAREPOINT2007FULL.log
Start-Process ./setup.exe -ArgumentList ... -Wait >>
c:/install-SHAREPOINT2007FULL.log
echo "About to CD..." >> c:/install-SHAREPOINT2007FULL.log
cd "C:/Program Files/Common Files/Microsoft Shared/Web Server
Extensions/12/BIN/"
echo "About to run psconfig.exe..." >> c:/install-SHAREPOINT2007FULL.log
Start-Process -FilePath ./psconfig.exe -ArgumentList ... -Wait >>
c:/install-SHAREPOINT2007FULL.log
echo "ALL DONE!!" >> c:/install-SHAREPOINT2007FULL.log
When I try to run the Playbook using Ansible, I get this:
PLAY [Run powershell script]
**************************************************
TASK: [Run powershell script]
*************************************************
changed: [ansibleclient1.whatever.com]
PLAY RECAP
********************************************************************
ansibleclient1.whatever.com : ok=1 changed=1 unreachable=0 failed=0
And that completes almost immediately, and when I look at that log file, I
see the output messages, but it looks like the actual installation steps
that are supposed to run under "Start-Process" are not being invoked at
all. I can tell this is the case because files that are supposed to be
created during the Setup.exe and psconfig.exe runs are not being created.
I ran the same Powershell script "manually" and it works
correctly/completely.
Does anyone know why these commands are being skipped when this Powershell
script is run under Ansible?
Thanks,
Jim
--
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 ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/83842f47-32b5-4f3e-9561-636c1793c863%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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 ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/83842f47-32b5-4f3e-9561-636c1793c863%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.