# Manage environment variables

**URL:** <https://forum.ansible.com/t/manage-environment-variables/21313>\
**Category:** Ansible Project\
**Created:** [April 29, 2016, 11:33am UTC](https://forum.ansible.com/t/manage-environment-variables/21313 "2016-04-29T11:33:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefano](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Stefano](https://forum.ansible.com/u/Stefano)\
**Post date:** [April 29, 2016, 11:33am UTC](https://forum.ansible.com/t/manage-environment-variables/21313/1 "2016-04-29T11:33:02Z")

</div>

I need set the environment variable to build some app at startup, i use `vars` in the playbook file:

```auto

---
- hosts: all
  sudo: yes
  vars:
    build_env:
      VAR1: value1
      VAR2: value2
      VAR3: value3
 

```

And set with `environment` into task to build app

```auto
- name: Build app
  environment: "{{build_env}}"
  command: "{{ item }} chdir={{app1}}"
  with_items:
  - npm install
  - bower
  - gulp
 

```

Also i need add the same variables to `/etc/environment` but i would not replicate the variables in another task, any idea?
