How to rename folder or file using Ansible.

We can use Ansibile 'command' module to rename file or folder in remote system.

Sample yaml code is given below.

- name: Rename folder1 to folder 2
    command: mv /path-to-folder2 /path-to-folder2

Here we need to replace the corresponding path of folder1 and folder2 respectively.

Leave a Reply

Your email address will not be published. Required fields are marked *