Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx: Tag 'role::nginx:servers' no more applied? #2469

Open
mathieumd opened this issue Jan 22, 2024 · 0 comments
Open

Nginx: Tag 'role::nginx:servers' no more applied? #2469

mathieumd opened this issue Jan 22, 2024 · 0 comments

Comments

@mathieumd
Copy link
Contributor

Running a playbook with -t role::nginx:servers won't run the tasks included by include_tasks (by example nginx_servers.yml):

ansible-playbook playbooks/web.yml --diff -l glpi-test01 -t role::nginx:servers
#...
TASK [debops.debops.nginx : Generate nginx conf.d/ files] ****************************************************
included: /home/mathieu/.../debops/debops/roles/nginx/tasks/nginx_configs.yml for glpi-test01

TASK [debops.debops.nginx : Generate nginx server configuration] ****************************************************
included: /home/mathieu/.../debops/debops/roles/nginx/tasks/nginx_servers.yml for glpi-test01

PLAY RECAP ****************************************************
glpi-test01                : ok=5    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Adding apply parameter to tasks seems to fixes the problem:

 - name: Generate nginx server configuration
-  ansible.builtin.include_tasks: 'nginx_servers.yml'
+  ansible.builtin.include_tasks:
+    file: 'nginx_servers.yml'
+    apply:
+      tags: [ 'role::nginx:servers' ]
   tags: [ 'role::nginx:servers' ]
   when: (nginx__deploy_state in ['present', 'config'])

The tasks now get included and played correctly.

It seems that this has changed since Debops moved from include to ansible.builtin.include_tasks, maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant