filmov
tv
Ansible Conditionals - Create Directory If Not Exists | Create only if tomcat not exists | PlayBook
Показать описание
To get the details of a file or directory in a Linux system, we can use the Ansible stat module. It works similar to the Linux ‘stat’ command. Of course, the module provides much more detail than whether a file exists or not. We can know when the file was last modified, what all permissions the invoking user has about the file, whether it is a directory etc.
If you just need to check the status of the file to create a new file, then you should use the file module. It will create a file or directory only if the file does not exist. I will show you an example below
If you just need to check the status of the file to create a new file, then you should use the file module. It will create a file or directory only if the file does not exist. I will show you an example below