paluh / ansible-augeas

Ansible module for augeas
Other
88 stars 17 forks source link

Add "edit" command #18

Open javiplx opened 8 years ago

javiplx commented 8 years ago

This change adds an "edit" command, which is basically an ins+set. The main changes respect to the use of both commands in sequence is that the node is not inserted if it already exists (so, "edit" is not usable for labels with multiple entries). And it also adds a "comment" flag which search for a comment with the label on it, and insert the new node after it. This means that

command=edit label=remote_user comment=True ...

will insert the node after

# remote_user = ...

if that line exists, and after path if not. I've used this only on .ini files up to now, but should work in the general case.

paluh commented 8 years ago

@javiplx, please give me a few hours (I hope I will find them this evening), so I can read and test your propositions.

javiplx commented 8 years ago

No hurry from my side, as I'm already using it ...

jippi commented 7 years ago

Any news on this?