cancel
Showing results for 
Search instead for 
Did you mean: 
  • 262 Views

saving ansible-navigator output to a file

Hi,

Earlier I used to be able to save ansible-playbook output to a file; open it back in vim and use json folding to be able to find paths to elements so that I could construct variables and conditionals.

Now the output from ansible-navigator contains a lot of un-printable characters , which totally mess up the output in vim.

Kindly provide a way to be able to save clean output of anisble-navigator.

Labels (1)
0 Kudos
2 Replies
bonnevil
Starfighter Starfighter
Starfighter
  • 191 Views

Heh, you're not talking to the product devs here, but to the learning community and to training folks.  The upstream development community is at https://github.com/ansible/ansible-navigator and that might be a more effective place to share this feedback if you're looking for folks to change the tool.

However, there's probably also a way to "clean up" the unprintable characters before it goes to a file that you're opening in vim, through some ansible-navigator option or by cleverness with a command-line pipeline.  There might be something you can do in vim, too, come to think of it.  I'd have to take a closer look at that to figure it out, though, and it depends on what those characters are.  Maybe someone else here has some thoughts already.

0 Kudos
Travis
Moderator
Moderator
  • 128 Views

@harjitsachar1 -

Can you show an example of a playbook with the saved output as well as how you ran it to save the output using ansible-playbook command from Ansible core (and the ansible.cfg). Then can you show how you are attempting to do this with ansible-navigator along with the relevant configuration files (ansible-navigator.yml and ansible.cfg) and the command you ran to generate the playbook and output.

I'd like to compare this as I haven't noticed any real difference (especially when dumping things to STDOUT) if that is what you are doing. If you're using something else, it might as @bonnevil stated by just a matter of tweaking things or ensuring you have some of the correct filters or other items in the execution environment. I know for some of the filtering I've justed, the jmsepath has been a pain in my side on not being in some of the EEs that I've used.

So while you need to think of it being run slightly differently because of the ansible-navigator command, you also need to figure out if it is because something is different in the EE running the playbook. You might try the older 2.9 supported EE to see if it runs there, you might also ensure that you install ansible-core to your system and run with the playbook command directly and not use an EE or the ansible-navigator command. This should help you to 100% determine it is a result of Navigator and the EE or if it is how the playbook output will be regardless of how it has been executed.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
0 Kudos
Join the discussion
You must log in to join this conversation.