I am want to move specific directories that are located in /home to the /tmp directory.
Folks, it was very easy to do this in ansible version 2.x. However, I am having huge difficulties doing so on version 1.9.2. It keeps complaining that it cannot find the directories.
- hosts: all connection: ssh gather_facts: yes vars: #The user's home dir we want to delete. - user_dir_1: /home/jimbo - user_dir_2: /home/mario - user_dir_3: /home/luiz - trash: /tmp/ tasks: - name: Move home directory to tmp ignore_errors: yes command: mv user_dir_1 trash command: mv user_dir_2 trash command: mv user_dir_3 trash
The error I am getting is:
{"changed": true, "cmd": ["mv", "user_dir_3", "trash"], "delta": "0:00:00.003494", "end": "2016-08-01 14:12:53.951909", "rc": 1, "start": "2016-08-01 14:12:53.948415", "warnings": []}
stderr: mv: cannot stat ‘user_dir_3’: No such file or directory
[link] [comments]