Re: [ansible-project] Re: finding a phrase through ansible script

2018-04-11 Thread Bishwajit Samanta
Hi, thanks for sharing the docs link. In the meanwhile i am not able to go in the right direction of solving the problem. so far what i have done is :: 1. converted the text file to json through python. 2. write some ansible codes, which in return it is dumping the contents but i am not able to

Re: [ansible-project] Re: finding a phrase through ansible script

2018-04-11 Thread Matt Martz
Templating in Ansible is handled by Jinja2. You can find documentation on Jinja2 at http://jinja.pocoo.org/docs/dev/templates/ For the `first` filter specifically: http://jinja.pocoo.org/docs/dev/templates/#first On Wed, Apr 11, 2018 at 11:47 AM, Bishwajit Samanta <

[ansible-project] Re: finding a phrase through ansible script

2018-04-11 Thread Bishwajit Samanta
@Matt Martz : I am sorry to ask silly questions, regarding ansible as by seeing the small piece of code, i can understand you must be an ansible expert. If possible you can help me in my problem explanation a bit. And any such links for learning you want to refer, please refer me. As i

[ansible-project] Re: finding a phrase through ansible script

2018-04-11 Thread Bishwajit Samanta
I am glad you replied so fast, but sorry to say i am not an ansible expert . I am just a beginner . I just typed the code. Can you help me in understanding where i am not correct. --- - hosts: devops tasks: - debug: msg: "{{ hostinfo|dictsort|selectattr('1.hostclass', 'equalto',