On 5/14/20 5:16 PM, Laci wrote: > Another task I'm working on is a conditional blockinfile, something like: > if OS=BSD do this, if Linux do that. > > I need this because there is a slightly different configuration for them: > > BSD: > Job { > Name = "serverX" > Client = "serverX-fd" > JobDefs = "DefaultJob" > } > > Linux: > Job { > Name = "serverX" > Client = "serverX-fd" > JobDefs = "DefaultJob" > FileSet = "linux" > } > >
Sorry but I would really use a template instead of shoehorn your syntax with blockinfile. Regards Racke > > On Thursday, May 14, 2020 at 10:31:36 AM UTC-4, Laci wrote: > > Actually this is my goal. > We are going to have add new servers every time to this file. > > So the following lines will be repeated X times > Job { > Name = "serverX" > Client = "serverX-fd" > JobDefs = "DefaultJob" > } > > > "Using a custom marker without the {mark} variable may result in > the block > being repeatedly inserted on subsequent playbook runs." > > > -- > 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 > ansible-project+unsubscr...@googlegroups.com > <mailto:ansible-project+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/3b17e950-1ea1-4734-9b38-3746c44ac1ee%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/3b17e950-1ea1-4734-9b38-3746c44ac1ee%40googlegroups.com?utm_medium=email&utm_source=footer>. -- Ecommerce and Linux consulting + Perl and web application programming. Debian and Sympa administration. Provisioning with Ansible. -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1fed7fb5-487c-839d-9c26-68438e73a452%40linuxia.de.
signature.asc
Description: OpenPGP digital signature