Member-only story
Create a text file — Ansible module copy
How to create a simple text file? I’m going to show you a live demo with some simple Ansible code.
How to create a simple text file?
I’m going to show you a live demo with some simple Ansible code.
I’m Luca Berton and welcome to today’s episode of Ansible Pilot.
Ansible create a text file
Today we’re talking about Ansible module copy.
The full name is ansible.builtin.copy which means is part of the collection of modules “builtin” with ansible and shipped with it.
This module is pretty stable and out for years.
The purpose is to copy files to remote locations but it’s also capable to create some simple text files.
If you need a more complex configuration it’s better to rely on the template module.
Parameters
- dest path — destination file
- content string — text
- mode/owner/group — permission
- setype/seuser/selevel — SELinux