Ansible Script Execution directory change from root path to other path

13 views
Skip to first unread message

venkatesh vanigalla

unread,
Sep 27, 2018, 11:11:47 AM9/27/18
to Ansible Project
How to change ansible script execution directory from /root to other fodler?

John Peters

unread,
Sep 27, 2018, 11:16:09 AM9/27/18
to Ansible Project
- name: Change the working directory to somedir/ before executing the command.
  shell: somescript.sh >> somelog.txt
  args:
    chdir: somedir/

Does this help?  Stolen from: https://docs.ansible.com/ansible/2.5/modules/shell_module.html
Reply all
Reply to author
Forward
0 new messages