mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-26 08:51:50 -06:00
61 lines
1.9 KiB
Plaintext
61 lines
1.9 KiB
Plaintext
|
#! /usr/bin/python -E
|
||
|
# Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
|
||
|
#
|
||
|
# Copyright (C) 2007 Red Hat
|
||
|
# see file 'COPYING' for use and warranty information
|
||
|
#
|
||
|
# This program is free software; you can redistribute it and/or
|
||
|
# modify it under the terms of the GNU General Public License as
|
||
|
# published by the Free Software Foundation; version 2 only
|
||
|
#
|
||
|
# This program is distributed in the hope that it will be useful,
|
||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
# GNU General Public License for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU General Public License
|
||
|
# along with this program; if not, write to the Free Software
|
||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||
|
#
|
||
|
|
||
|
|
||
|
# requires the following packages:
|
||
|
# fedora-ds-base
|
||
|
# openldap-clients
|
||
|
# nss-tools
|
||
|
|
||
|
VERSION = "%prog .1"
|
||
|
|
||
|
import logging
|
||
|
from optparse import OptionParser
|
||
|
import ipa.dsinstance
|
||
|
|
||
|
def parse_options():
|
||
|
parser = OptionParser(version=VERSION)
|
||
|
parser.add_option("-r", "--realm", dest="realm_name",
|
||
|
help="realm name")
|
||
|
parser.add_option("-a", "--host-address", dest="host_name",
|
||
|
help="host address (name or IP address)")
|
||
|
parser.add_option("-p", "--password", dest="password",
|
||
|
help="admin password")
|
||
|
|
||
|
options, args = parser.parse_args()
|
||
|
|
||
|
if not options.realm_name or not options.host_name or not options.password:
|
||
|
parser.error("error: password, realm, and host name required")
|
||
|
|
||
|
return options
|
||
|
|
||
|
def main():
|
||
|
logging.basicConfig(level=logging.DEBUG,
|
||
|
format='%(asctime)s %(levelname)s %(message)s',
|
||
|
filename='ipa-install.log',
|
||
|
filemode='w')
|
||
|
options = parse_options()
|
||
|
ds = ipa.dsinstance.DsInstance()
|
||
|
ds.create_instance(options.realm_name, options.host_name, options.password)
|
||
|
|
||
|
return 0
|
||
|
|
||
|
main()
|