Skip to content

Commit

Permalink
the inventory can be set in the ansible.cfg file, in that case we don…
Browse files Browse the repository at this point in the history
…'t need to pass --inventory-file to ansible-inventory command
  • Loading branch information
ltamaster committed Jul 15, 2024
1 parent d3c74f9 commit b66be08
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ public String getNodeList() throws IOException, AnsibleException {

List<String> procArgs = new ArrayList<>();
procArgs.add(ANSIBLE_INVENTORY);
procArgs.add("--inventory-file" + "=" + inventory);
//inventory can be defined in ansible.cfg
if(inventory!=null && !inventory.isEmpty()){
procArgs.add("--inventory-file" + "=" + inventory);
}
procArgs.add("--list");
procArgs.add("-y");

Expand Down

0 comments on commit b66be08

Please sign in to comment.