# How to change active directory using ansible

**URL:** <https://forum.ansible.com/t/how-to-change-active-directory-using-ansible/21216>\
**Category:** Ansible Developer\
**Created:** [April 20, 2016, 9:07am UTC](https://forum.ansible.com/t/how-to-change-active-directory-using-ansible/21216 "2016-04-20T09:07:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mick\_st\_john](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Mick\_st\_john](https://forum.ansible.com/u/Mick_st_john)\
**Post date:** [April 20, 2016, 9:07am UTC](https://forum.ansible.com/t/how-to-change-active-directory-using-ansible/21216/1 "2016-04-20T09:07:36Z")

</div>

I am trying to change my active directory to a directory which has a script that I want to run.

Playbook:

---

<div class="post-metadata">

**Author:** ![mark.kusch](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@mark.kusch](https://forum.ansible.com/u/mark.kusch)\
**Post date:** [April 20, 2016, 9:15am UTC](https://forum.ansible.com/t/how-to-change-active-directory-using-ansible/21216/2 "2016-04-20T09:15:11Z")

</div>

- name: run script in other dir  
&nbsp;&nbsp;shell: "sh temp.sh"  
&nbsp;&nbsp;args:  
&nbsp;&nbsp;&nbsp;&nbsp;chdir: /path/to/dest/dir

# kraM
