Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible always run role

Tags:

ansible

I'm searching for a way to always run a role, regardless of --tags args.

Here is a simple playbook:

- hosts: all
  roles:
    - { role: role1, tags: always },
    - { role: role2, tags: tag1 },
    - { role: role3, tags: tag2 }

I would like only role1 and role2 to run when I launch the following filter (instead of only role2):

ansible-playbook -i hosts deploy.yml --tags tag1

I though it was the default behavior with the special always tag (see http://docs.ansible.com/ansible/playbooks_tags.html#special-tags)

I'm playing with Ansible 1.8.4.

like image 960
pierrefevrier Avatar asked Oct 31 '22 13:10

pierrefevrier


1 Answers

Most probably your Ansible version is the problem.

The always tag was introduced with this pull request, which was merged into the devel branch on February 25. According to the releases, the next released version after that date was Ansible 1.9.0-1.

like image 155
udondan Avatar answered Nov 11 '22 13:11

udondan