From d0aaf998905a5b08cbac3a5930cee9300b15962d Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 28 Jul 2023 08:40:46 +0200 Subject: [PATCH] enhancement(ansible/inventory.py) add --quit argument close #8 --- ansible/inventory.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ansible/inventory.py b/ansible/inventory.py index 3ec4881..8549309 100755 --- a/ansible/inventory.py +++ b/ansible/inventory.py @@ -41,6 +41,7 @@ class RisottoInventory(object): parser.add_argument('--nocache', action='store_true') parser.add_argument('--debug', action='store_true') parser.add_argument('--pretty_print', action='store_true') + parser.add_argument('--quite', action='store_true') self.args = parser.parse_args() if self.args.debug: global DEBUG @@ -75,7 +76,7 @@ class RisottoInventory(object): 'hosts': servers, 'vars': { # FIXME -# 'ansible_ssh_host': '192.168.0.29', + 'ansible_ssh_host': '192.168.0.29', 'ansible_ssh_user': 'root', 'ansible_python_interpreter': '/usr/bin/python3' } @@ -119,7 +120,7 @@ def main(): from pprint import pprint from json import loads pprint(loads(values)) - else: + elif not inv.args.quite: print(values) except Exception as err: if DEBUG: