I have the following playbook and struggling to understand how to pass it the application_name
variable:
---
- name: Initial configuration for a {{ application_name }} server
hosts: all
vars:
- update_apt_cache: yes
vars_files:
- roles/base/defaults/main.yml
tasks:
- debug: msg="reading from group {{ groups }} and application name {{ application_name }}"
The issue is that the first application_name
(in the name
parameter) never works, though the second instance (defined in the task) works fine. How can I get the first instance to work as well? I've tried both defining the variable in the inventory...
[mygroup:vars]
application_name=my_application_name
...and in group_vars
(./group_vars/mygroup/vars.yml
)...
application_name: my_application_name
...but both of these do not fill the name
parameter - only the {{ application_name }}
found in the tasks
section of the playbook.
Is there a way to fill in the first application_name
variable?