I actually ran into this requirement today. For example:
roles:
- { role: network_config, tags: netconf }
Inside that role, I might have a bunch of tasks defined that I want to run
only for a particular tag so ideally I'd like to be able to specify:
ansible-playbook .... -t netconf:ifcfg -t netconf:routes
... to run all tasks tagged with 'ifcfg' or 'routes', or I can choose to
run all tasks in the network_config role:
ansible-playbook .... -t netconf
Can't do that with the current state of Ansible, right?
On Fri, Dec 6, 2013 at 7:41 AM, Michael DeHaan <[email protected]>wrote:
> Yeah you can't just make syntax up and expect it to mean something.
>
> Sounds like you should just use a new play in the PB and simply use host
> groups to select.
>
> -- Michael
>
> On Dec 5, 2013, at 3:35 PM, Brandon Hilkert <[email protected]>
> wrote:
>
> I tried something like this in a task, but it didn't work
>
> tags: "{{ 'production' && 'web' }}"
>
>
> I have a task that uploads some web assets to S3. This is needed for a
> "web" tag, but only for "production". In staging, it's unnecessary, so I
> have tags like "web,production", and "web,staging" and I'd like for them to
> behave differently.
>
> I was trying to avoid making specific tags like "web-production" and
> "web-staging"
>
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
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].
For more options, visit https://groups.google.com/groups/opt_out.