I have a playbook that sets up a remote box, using sudo=yes. But only a limited set of users will have permission to run this, since it requires root on the remote box.
I'd like to allow less privileged users to run part of this playbook, e.g. tasks with a certain tag. These will do some relatively safe things, like updating the httpd config on the box. So when the root user sets things up, it gives these less privileged users the rights they need to run these tasks.
But what's a good way to set up this playbook so that both sets of users can use it? Currently the whole playbook has sudo=yes, but that prevents the less privileged users from running it at all. Would I need to set sudo=no on the playbook, and then sudo=yes on each task that needs it?
I guess I could copy these safe tasks to a separate playbook, but then they'd be duplicated, which is not ideal.