Ok, so looking at the above I’m thinking you don’t need pre_tasks and post_tasks for this.
What you should do is have a role that sets up your keys/repos, call it “repos”, OR just prefix your repo setup before your tasks for installation.
You could then make a role named “update packages” and put it at the end if you want.
roles:
repo_setup # optional
mariadb
update_all
Would that work? I’d probably just set up the repos in the mariadb role if it were me, but I would probably use tasks includes to break things up into multiple files
if the tasks got too long.
Yes, there are other ways i could achieve this - either through additional roles or just by taking the performance penalty of updating the repo database for each role.
I did like the cleanliness of keeping everything related to a role inside its own folder, as i’m looking to open source the role files, so would probably go for the latter.
Would you consider a patch for adding these stages, or are you opposed to the idea ?