mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 12:33:59 -07:00
parent
16c2207d21
commit
758cfeb73e
4 changed files with 23 additions and 22 deletions
|
|
@ -4,6 +4,7 @@ import argparse
|
|||
from ipalib import api
|
||||
import json
|
||||
|
||||
|
||||
def initialize():
|
||||
'''
|
||||
This function initializes the FreeIPA/IPA API. This function requires
|
||||
|
|
@ -16,11 +17,12 @@ def initialize():
|
|||
try:
|
||||
api.Backend.rpcclient.connect()
|
||||
except AttributeError:
|
||||
#FreeIPA < 4.0 compatibility
|
||||
# FreeIPA < 4.0 compatibility
|
||||
api.Backend.xmlclient.connect()
|
||||
|
||||
return api
|
||||
|
||||
|
||||
def list_groups(api):
|
||||
'''
|
||||
This function prints a list of all host groups. This function requires
|
||||
|
|
@ -28,8 +30,8 @@ def list_groups(api):
|
|||
'''
|
||||
|
||||
inventory = {}
|
||||
hostvars={}
|
||||
meta={}
|
||||
hostvars = {}
|
||||
meta = {}
|
||||
|
||||
result = api.Command.hostgroup_find()['result']
|
||||
|
||||
|
|
@ -51,6 +53,7 @@ def list_groups(api):
|
|||
|
||||
return None
|
||||
|
||||
|
||||
def parse_args():
|
||||
'''
|
||||
This function parses the arguments that were passed in via the command line.
|
||||
|
|
@ -66,6 +69,7 @@ def parse_args():
|
|||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def print_host(host):
|
||||
'''
|
||||
This function is really a stub, it could return variables to be used in
|
||||
|
|
@ -79,6 +83,7 @@ def print_host(host):
|
|||
|
||||
return None
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = parse_args()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue