I have a playbook which has three roles netdata
, netdata_master
, netdata_slaves
:
---
- hosts: netdata_master
become: yes
roles:
- role: netdata
- role: netdata_master
tags: ['netdata_master']
- hosts: netdata_slaves
become: yes
roles:
- role: netdata
- role: netdata_slave
tags: ['netdata_slave']
Inside the netdata
role I have a task which has tag never
and update_netdata
in order to be executed only when I pass the tag update_netdata
:
- name: Generating Netdata prebuilt script
template:
src: kickstart-static64.sh.j2
dest: /tmp/kickstart-static64.sh
mode: 0744
- name: update netdata
shell: /opt/netdata/usr/libexec/netdata/netdata-updater.sh
tags: ['never', 'update_netdata']
The problem is when I execute the ansible playbook with no tags, everything works fine and update netdata
is not executed but when I run the ansible playbook with netdata_slave
tag, the update netdata
task also gets executed.
I'm using ansible 2.9.2
How can I fix this?