Fairly new to Ansible so I'm trying to wrap my head around the best way to
handle variables and such.
I've been trying to follow the best practices page, so I have a group_vars
folder with my environments underneath like so:
group_vars/
staging/
vars.yml
I then have a role called "fms" that has a template that uses some of these
variables like so:
common:
license_key: '{{ newrelic.license_key }}'
app_name: {{ newrelic.app_name }}
monitor_mode: {{ newrelic.monitor_mode }}
developer_mode: false
log_level: info
ssl: true
capture_params: {{ newrelic.monitor_mode }}
browser_monitoring:
auto_instrument: false
audit_log:
enabled: false
sidekiq:
capture_params: {{ newrelic.monitor_mode }}
transaction_tracer:
enabled: {{ newrelic.monitor_mode }}
transaction_threshold: apdex_f
record_sql: obfuscated
stack_trace_threshold: 0.500
explain_enabled: true
explain_threshold: 0.5
error_collector:
enabled: {{ newrelic.monitor_mode }}
capture_source: {{ newrelic.monitor_mode }}
ignore_errors: "ActionController::RoutingError,Sinatra::NotFound"
All of the variables here are defined in my vars.yml file and other
templates are working. But when Ansible goes to create this one, I get:
fatal: [fmsapp]: FAILED! => {"changed": false, "failed": true, "msg":
"AnsibleUndefinedVariable:
'dict object' has no attribute 'app_name'"}
I'm using that specific variable just like I used license_key, but
license_key seems to work and app_name doesn't. Is app_name a protected
variable name or something?
Let me know if you have any suggestions.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/12922c13-d277-4d99-86a4-8c21e0c8db0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.