Hello,

If I repeat someone, please, point me in the right direction.

I'm not the only guy who wants pre_task and post_tasks to work like 
setup/teardown methods and run regardless of any specified tags. Here is 
the discussion: 
https://groups.google.com/forum/#!msg/ansible-project/VxD39ABi1z4/8wrjJn7mh74J

So my proposal is to have a special tag name - * (star) which will force a 
task to run regardless of specified tags. This will help to be more 
verbose, and will only affect tasks which were manually tagged with such 
tag.

Consider the example below:
*aerospike.yml*
---
- hosts: aerospike
  pre_tasks:
    - name: Configure repository
      file: src=aerospike.repo dest=/etc/yum.repos.d/aerospike.repo 
state=file
      tags: "*"
  tasks:
    - name: Install aerospike
      yum: name=aerospike-server state=installed
      tags: deploy
    - name: Configure aerospike
      shell: ./something.sh
      tags: configure

Running `ansible-playbook -i inventory aerospike.yml --tags 'deploy'` will 
affect both pre_tasks and installation task.
It does not mean that you can't skip tasks tagged with star sign - you 
still can specify additional tags and pass them to --skip-tags

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/675e274f-ffdb-49a6-be0d-dbe418d8cea8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to