On 30. des. 2016 19:36, [email protected] wrote:
I am sure this is not the right way to code and it could be combined into 1
lineinfile option using with_items. But, for now, I want to try this
separately and see if I could. If with_items is the right way, please let
me know and I can change it. But, here is the situation though. When I run
this code, it is updating the stanza which is at the end (updating gpgcheck
in [centosplus] stanza). I understand it is trying to find the last
instance of "gpgcheck" and updating the value. But, I want only these 2
stanzas to be updated and nothing before that or after that. How can I
achieve that?? Hope my question makes sense.
Any help is greatly appreciated.
Make lineinfile in this situation is not easy, since this file is a
ini-file use the ini_file module instead
https://docs.ansible.com/ansible/ini_file_module.html
--
Kai Stian Olstad
--
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/3e37ce48-22d4-6b72-e9ed-9673f14fd0ea%40olstad.com.
For more options, visit https://groups.google.com/d/optout.