idealista / nginx_role

Ansible role to install nginx http and reverse proxy server
7 stars 2 forks source link

Copy servers templates fails when is defined as relative path #25

Open dortegau opened 7 years ago

dortegau commented 7 years ago

When I define the template paths as follows:

nginx_extra_servers_template_path: '../../templates'

instead of:

nginx_extra_servers_template_path: "{{ playbook_dir }}/templates"

It fails because the task "NGINX | Remove old servers available" removes the file and cannot be linked after in "NGINX | Enable servers templates":

TASK [nginx : NGINX | Remove old servers available] ****************************
changed: [confluence.vm] => (item=confluence)

TASK [nginx : NGINX | Enable servers templates] ********************************
 [WARNING]: Unable to find '/Users/dortega/workspace/confluence-
playbook/files/nginx/servers' in expected paths.

failed: [confluence.vm] (item=/Users/dortega/workspace/confluence-playbook/roles/nginx/../../templates/confluence) => {"failed": true, "item": "/Users/dortega/workspace/confluence-playbook/roles/nginx/../../templates/confluence", "msg": "src file does not exist, use \"force=yes\" if you really want to create the link: /etc/nginx/sites-available/confluence", "path": "/etc/nginx/sites-enabled/confluence", "src": "/etc/nginx/sites-available/confluence", "state": "absent"}
    to retry, use: --limit @/Users/dortega/workspace/confluence-playbook/main.retry
Pablohn26 commented 2 years ago

Which ansible-core version did you use?

Cannot reproduce this error with ansible-core 2.11.6.

Maybe it is a bug of an old version