Above code is working but after that it failing with below code, i need 7.2.5 before -css in above output but failing to get that tried files_found_path[0].split(‘-‘) as well
fatal: [host1: FAILED! => {“msg”: “The task includes an option with an undefined variable. The error was: ‘list object’ has no attribute ‘split’. ‘list object’ has no attribute ‘split’\n\nThe error appears to be in ‘/Users/sameer_modak/ansibledemo/testing.yml’: line 54, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: get version\n ^ here\n”}
fatal: [host2]: FAILED! => {“msg”: “The task includes an option with an undefined variable. The error was: ‘list object’ has no attribute ‘split’. ‘list object’ has no attribute ‘split’\n\nThe error appears to be in ‘/Users/sameer_modak/ansibledemo/testing.yml’: line 54, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: get version\n ^ here\n”}
fatal: [host3]: FAILED! => {“msg”: "The task includes an option with an undefined variable. The error was: ‘list object’ has no attribute ‘split’. ‘list object’ has no a
i did try that as well but no luck as i have already mentioned in my previous conversation.
below is the complete code, output i want is 7.2.5 from jar line. thats it. But i m missing something may taking long route when simple solution is there
Thanks (faar aabhari) Abhijeet for your reply. but also i have to store that in variable so i ll have to use set_fact ryt or is there any simpler way in one line because if you see my code i had to use so many set_fact to 1st get one value then again store in another value.
One more point i have to highlight is that when i get output of my shell command jar path is not always the 1st item in list it sometimes 2nd so this is bit annoying .