March 2019
Intermediate to advanced
412 pages
9h 49m
English
If you were running Ansible against a Linux server, and wanted to create a directory and then copy a file into it, you would use the file and copy Ansible modules, in a playbook that looks something like the following:
---- name: Linux file example playbook hosts: all gather_facts: false tasks: - name: Create temporary directory file: path: /tmp/mastery state: directory - name: Copy across a test file copy: src: mastery.txt dest: /tmp/mastery/mastery.txt
However, on Windows, this playbook would fail to run, as the file and copy modules are not compatible with WinRM. As a result, an equivalent playbook to perform the same task, but on Windows, would look like this:
---- name: Windows file example playbook hosts: all ...
Read now
Unlock full access