Hello  Kai Stian Olstad  

further to this context, could you please advise how to escape square 
bracket from the output in ansible?

On Saturday, March 10, 2018 at 8:04:50 PM UTC+1 Kai Stian Olstad wrote:

> On Saturday, 10 March 2018 16.46.14 CET William Muriithi wrote:
> > I have a task that need to run the command below:
> > 
> > ipa dnsrecord-add idm.example.com cluster 
> --a-rec={192.0.2.40,192.0.2.41}
> > 
> > The problem is that the IPA and ansible both use the "{" character. I
> > have attempted to escape one of the "{" with a back slash, and ansible
> > is fine with that, but then the resulting command isn't valid as far
> > as IPA server is concerned.
> > 
> > How would you guys go about resolving this? This is what I am seeing.
> > 
> > - name: Create a DNS FQDN that will be shared by both active and 
> > replica systems
> > 
> > shell: ipa dnsrecord-add eng.example.com {{service_username}}
> > --a-rec=[{{ cluster_IP|join(",") }}]
>
> I don't now why you have those square brackets in there since you command 
> should not have them according to your command on top.
> To get the curly bracket in just use string concatenation.
>
> --a-rec={{ '{' ~ ip | join(',') ~ '}' }}
>
>
> -- 
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e434064f-6fd2-4e08-a166-495e58f5400fn%40googlegroups.com.

Reply via email to