Can't use ansible inventory file because it is executable

后端 未结 2 1659
旧时难觅i
旧时难觅i 2021-01-13 00:06

I am trying to run an Ansible inventory file ansible -i hosts-prod all -u root -m ping and it is failing with this message:

ERROR: The file host         


        
2条回答
  •  甜味超标
    2021-01-13 00:16

    Executable inventories are parsed as JSON instead of ini files, so you can convert it to a script that outputs JSON. On top of that, Ansible passes some arguments to them to a simple 'cat' isn't enough:

    #!/bin/bash
    cat <

    Not as elegant as a simple 'cat', but should work.

提交回复
热议问题