Manage environment variables

20 views
Skip to first unread message

Stefano

unread,
Apr 29, 2016, 7:33:02 AM4/29/16
to Ansible Project

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


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

And set with environment into task to build app


- 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?

Reply all
Reply to author
Forward
0 new messages