Member-only story
Create a directory on Windows-like systems — Ansible module win_file
How to automate the creation of “example” folder in the user Desktop on Windows-like hosts with Ansible Playbook.
4 min readMar 14, 2022
How to create a directory in Windows-like systems with Ansible?
I’m going to show you a live demo and some simple Ansible code.
I’m Luca Berton and welcome to today’s episode of Ansible Pilot
Ansible create a directory
- `
ansible.windows.win_file
` - Creates, touches, or removes files or directories
Today we’re talking about the Ansible module `win_file
`.
The full name is `ansible.windows.win_file
`, which means that is part of the collection of modules to interact with windows machines.
It’s a module pretty stable and out for years.
It creates, touches, or removes files or directories.
For Linux targets, use the `ansible.builtin.file
` module instead