I need to collect the content of an environment variable that points to a home directory of an specific app.
The env variable is set for an specific linux user and we already have an ansible script that pulls the content of the variable into a file. Now we are trying to achieve the same as we have environment where ansible is not available.
It’s always been a pain working with environment variables with BigFix. Here is the ansible piece:
- name: we need to get the app home
become_method: sudo
become_flags: "-i"
become_user: svc_app
shell: echo $APP_HOME
register: app_home_tmp
- set_fact:
app_home: "{{ app_home_tmp.stdout }}"
- name: print debug statement
debug:
var: app_home
Here is what I have tried with BigFix but the output file is empty after executing the fixlet:
wait /bin/sh --login -c "sudo -i -u svc_app echo $APP_HOME > /var/opt/BESClient/EData/appversion.txt"