Apparently I need the concept of method or specific action on a role and I don't how to implement it.
Consider a service with associated data changing in time on a remote host. I need to perform three distinct actions on this service. 1. install or update to code and configuration 2. backup the associated data 3. restore the associated data from the backup All three actions can be implemented by ansible. But I don't see how to pack them in one role. This is because (as I understood) invoking a role executes only one action defined in roles/X/tasks/main.yml. That's Ok for Install let say. But how could I add the set of tasks to do a backup or a restore ? I thought we could use tags for that, but the problem is that by default (without specifying a tag on the playbook invocation) the special tag 'all' is used which result in executing all tasks. This would be a mess if the install, backup and restore tasks are all called if the user forgot to specify a tag. One thing that could save my day is if it was possible to define a default tag different from 'all' in the ansible configuration ? I could the define the default tag ass 'install' or 'install,config' that will ensure that the tasks tagged as 'backup' or 'restore' are not executed. I couldn't find such an option in the ansible configure documentation. Otherwise is there a solution with the existing code ? -- 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/6c590af1-0bf2-4dfd-b948-4f0b2f1f4205%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
