I have a shell script which just changes directory (here directory path is given).
shell file
#!/bin/bash
p="dir/file/create"
cd "$p"
exec bash
Ansible playbook
---
- hosts: localhost
gather_facts: true
become: true
become_user: oracle
become_flags: 'content-ansible'
tasks:
- name: changing dir now..
command: sh /dir/file/create/vars.sh
I want to run a shell script to change directory path in ANSIBLE and run subsequent shell file(#2) in the directory (again shell script).
Ansible playbook completes but I never am able to get into a directory and execute the shell script(#2).