enhancement(ansible/inventory.py) add --quit argument

close #8
This commit is contained in:
egarette@silique.fr 2023-07-28 08:40:46 +02:00
parent 833f6e8d4d
commit d0aaf99890

View file

@ -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: