# Using environment with import\_tasks

**URL:** <https://forum.ansible.com/t/using-environment-with-import-tasks/33180>\
**Category:** Ansible Developer\
**Created:** [June 15, 2020, 9:24am UTC](https://forum.ansible.com/t/using-environment-with-import-tasks/33180 "2020-06-15T09:24:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vishal\_Kumar](https://avatars.discourse-cdn.com/v4/letter/v/50afbb/32.png) [@Vishal\_Kumar](https://forum.ansible.com/u/Vishal_Kumar)\
**Post date:** [June 15, 2020, 9:24am UTC](https://forum.ansible.com/t/using-environment-with-import-tasks/33180/1 "2020-06-15T09:24:37Z")

</div>

I got a small question regarding ansible regarding import\_tasks and using task specific env variablesPlaybook folder structure

1. common/a.yaml
2. database/sometask.yaml
3. database/sometask1.yaml  
**Content of a.yaml** - name: Some name  
command: “{{ some\_command }}”  
no\_log: True  
environment:  
PASSWORD: “{{ password }}”  
VERB: variable **Content of sometask.yaml**

```auto
tasks:
import_tasks: /common/a.yaml
environment:
 ARGS: " some value" 

```

**Content of sometask1.yaml**

```auto
tasks:
import_tasks: /common/a.yaml
environment:
 ARGS: " some value 1"

```

**_Will the value be substituted like when task executes?_** - name: It does something  
command: “{{ some\_command }}”  
no\_log: True  
environment:  
PASSWORD: “{{ password }}”  
VERB: variable  
ARGS: “some value”- name: It does something as well  
command: “{{ some\_command }}”  
no\_log: True  
environment:  
PASSWORD: “{{ password }}”  
VERB: variable  
ARGS: “some value 1”
