summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscottb <sydtech@gmail.com>2016-06-09 11:31:46 -0700
committerGitHub <noreply@github.com>2016-06-09 11:31:46 -0700
commite5d04fd6bd1ddcdfbd9315263d149abeaaa71910 (patch)
tree5ce573631e23ca623e9c4d82e2f4e75583a36ae1
parent5bba9180522cc2866ee9e5de72540cdb6716fe4d (diff)
parent6615824f4d12ccb964b712128f20c5dc3d6b55a0 (diff)
downloadansible-e5d04fd6bd1ddcdfbd9315263d149abeaaa71910.tar.gz
Merge pull request #16023 from jhawkesworth/add_fetch_to_windows_modules
[WIP]: A few ideas for updating the windows introduction.
-rw-r--r--docsite/rst/intro_windows.rst16
1 files changed, 13 insertions, 3 deletions
diff --git a/docsite/rst/intro_windows.rst b/docsite/rst/intro_windows.rst
index e99311f393..862fea0c78 100644
--- a/docsite/rst/intro_windows.rst
+++ b/docsite/rst/intro_windows.rst
@@ -258,7 +258,7 @@ In particular, the "script" module can be used to run arbitrary PowerShell scrip
tasks:
- script: foo.ps1 --argument --other-argument
-Note there are a few other Ansible modules that don't start with "win" that also function, including "slurp", "raw", and "setup" (which is how fact gathering works).
+Note there are a few other Ansible modules that don't start with "win" that also function, including "fetch", "slurp", "raw", and "setup" (which is how fact gathering works).
.. _developers_developers_developers:
@@ -339,6 +339,16 @@ Running common DOS commands like 'del", 'move', or 'copy" is unlikely to work on
- name: Move file on remote Windows Server from one location to another
raw: CMD /C "MOVE /Y C:\teststuff\myfile.conf C:\builds\smtp.conf"
+You may wind up with a more readable playbook by using powershell equivalents of DOS commands. For example to achieve the same effect as the example above you could use::
+
+ - name: another raw module example demonstrating powershell one liner
+ hosts: windows
+ tasks:
+ - name: Move file on remote Windows Server from one location to another
+ raw: Move-Item C:\teststuff\myfile.conf C:\builds\smtp.conf
+
+Bear in mind that using C(raw) will allways report changed and it is your responsiblity to ensure powershell will need to handle idempotency as appropriate (the move examples above are inherently not idempotent), so where possible use (or write) a module.
+
And for a final example, here's how to use the win_stat module to test for file existence. Note that the data returned by the win_stat module is slightly different than what is provided by the Linux equivalent::
- name: test stat module
@@ -358,14 +368,14 @@ And for a final example, here's how to use the win_stat module to test for file
- "stat_file.stat.size > 0"
- "stat_file.stat.md5"
-Again, recall that the Windows modules are all listed in the Windows category of modules, with the exception that the "raw", "script", and "fetch" modules are also available. These modules do not start with a "win" prefix.
+Again, recall that the Windows modules are all listed in the Windows category of modules, with the exception that the "raw", "script", "slurp" and "fetch" modules are also available. These modules do not start with a "win" prefix.
.. _windows_contributions:
Windows Contributions
`````````````````````
-Windows support in Ansible is still very new, and contributions are quite welcome, whether this is in the
+Windows support in Ansible is still relatively new, and contributions are quite welcome, whether this is in the
form of new modules, tweaks to existing modules, documentation, or something else. Please stop by the ansible-devel mailing list if you would like to get involved and say hi.
.. seealso::