Answer the question
In order to leave comments, you need to log in
Variables in Ansible template?
Hello. Tell me about ansible.
There is a simple playbook, it installs nginx then copies the configuration files to the server and the certificate files.
There is a template file nginx.conf.j2 (located in playbooks/templates), but when it is copied, the variables {{ server_name }} {{ cerf_file }} {{ key_file }} are not replaced in it with the values that are in the playbook file . If these variables {{}} are replaced in this file and the paths to the certificate files are specified, then everything works, the site rises.
Why is there no replacement in this file when copying? What is done wrong? In the playbook file, the values of the variables are applied.
Answer the question
In order to leave comments, you need to log in
You used copy and you needed template to deliver nginx.conf
https://docs.ansible.com/ansible/latest/modules/te...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question