Hi Nicolas, thinking about a regexp that check and add the string below if not present (e.g: with lineinfile) role: <name>
it will use the negative look ahead pattern of regexp I will pass it to you tomorrow if someone else do not beat me Stay tuned Phil 2015-06-30 11:09 GMT+02:00 Nicolas G <[email protected]>: > Hi all, > > We have a role var defined for every role like bellow : > > # roles/db/vars/main.yml : > role : db > > # roles/web/vars/main.yml : > role : web > > # roles/app/vars/main.yml : > role : app > > > We need to have this var a specific "config :" line in a configuration > file in a way that will be the same if we run 1 single role on a host or > all roles : > > if we only run the db role the file should be : > # /etc/file.conf : > config: role : db > > if we run all roles on the host the file should look like : > # /etc/file.conf : > config: role : db, role: web, role:app > > > This might look simple but I'm having a hard time to code the logic in > Ansible.. any ideas ? > > Thanks in advance. > > -- > 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/7a8ee5f0-dee6-466f-a5ac-ff4d1e6283be%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/7a8ee5f0-dee6-466f-a5ac-ff4d1e6283be%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAB1FMuTvvf0FCbuD0zOrAuBs0KdJ43jm12FBG7OPH0WcwZey%2Bg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
