The complexity and issues with augeas don’t seem to fit in with the intentions (IMO) of Ansbile.
I’m assuming that you are manipulating the file across different tasks? As a quick suggestion are you able to separate the logic for this config manipulation into a separate role? or playbook to include?
yes, https://github.com/paluh/ansible-augeas is the module I was targeting and testing. I was planning to use to for custom modifications of some configuration files, but instead of that I decided to go over with templates - whenever I need a change, I will make it in the certain template and replicate it with a task to the servers.
Anyway, ansible-augeas is pretty interesting module, and I will be happy if one day I have the chance to work with it.