diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-11-28 13:12:24 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-11-30 15:12:27 -0500 |
commit | 9c879d5feea84bb90faf77c0c68fd57325c5b5b5 (patch) | |
tree | f10e197999be4d9d2c1e85be77d408b028bb2c8e | |
parent | 719478fd34077fcbf1b6c6ad201c36ff57983490 (diff) | |
download | pki-ticket-399-6.zip pki-ticket-399-6.tar.gz pki-ticket-399-6.tar.xz |
Simplified the configuration file using defaults.ticket-399-6
Previously to create a subsystem the admin would have to copy the
entire default deployment configuration, which contains many
parameters, and then customize it. Now the deployment code has been
changed such that the default config file will be used to provide
the default values, so the admin will only need to provide the
non-default parameters, thus reducing the size of the file.
Sample configuration files are provided in /usr/share/pki/
deployment/config.
Ticket #399
-rw-r--r-- | base/deploy/CMakeLists.txt | 11 | ||||
-rw-r--r-- | base/deploy/config/deployment.cfg (renamed from base/deploy/config/pkideployment.cfg) | 0 | ||||
-rw-r--r-- | base/deploy/config/sample.cfg | 6 | ||||
-rw-r--r-- | base/deploy/src/scriptlets/infrastructure_layout.py | 4 | ||||
-rw-r--r-- | base/deploy/src/scriptlets/pkiconfig.py | 11 | ||||
-rw-r--r-- | base/deploy/src/scriptlets/pkimessages.py | 2 | ||||
-rw-r--r-- | base/deploy/src/scriptlets/pkiparser.py | 10 |
7 files changed, 26 insertions, 18 deletions
diff --git a/base/deploy/CMakeLists.txt b/base/deploy/CMakeLists.txt index 9838b03..26abe53 100644 --- a/base/deploy/CMakeLists.txt +++ b/base/deploy/CMakeLists.txt @@ -56,15 +56,10 @@ install( ) install( - FILES - config/pkideployment.cfg - config/pkislots.cfg + DIRECTORY + config DESTINATION - ${DATA_INSTALL_DIR}/deployment/config - PERMISSIONS - OWNER_WRITE OWNER_READ - GROUP_READ - WORLD_READ + ${DATA_INSTALL_DIR}/deployment ) find_package(PythonInterp REQUIRED) diff --git a/base/deploy/config/pkideployment.cfg b/base/deploy/config/deployment.cfg index 133d4e9..133d4e9 100644 --- a/base/deploy/config/pkideployment.cfg +++ b/base/deploy/config/deployment.cfg diff --git a/base/deploy/config/sample.cfg b/base/deploy/config/sample.cfg new file mode 100644 index 0000000..6e95303 --- /dev/null +++ b/base/deploy/config/sample.cfg @@ -0,0 +1,6 @@ +[Common] +pki_admin_password= +pki_backup_password= +pki_client_pkcs12_password= +pki_ds_password= +pki_security_domain_password= diff --git a/base/deploy/src/scriptlets/infrastructure_layout.py b/base/deploy/src/scriptlets/infrastructure_layout.py index e79fa8b..8eed598 100644 --- a/base/deploy/src/scriptlets/infrastructure_layout.py +++ b/base/deploy/src/scriptlets/infrastructure_layout.py @@ -40,7 +40,7 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): extra=config.PKI_INDENTATION_LEVEL_1) # NOTE: It was determined that since the "pkidestroy" command # relies upon a symbolic link to a replica of the original - # "pkideployment.cfg" configuration file used by the + # deployment configuration file used by the # "pkispawn" command of an instance, it is necessary to # create any required instance and subsystem directories # in this top-level "infrastructure_layout" scriptlet @@ -50,7 +50,7 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): # # establish the top-level infrastructure, instance, and subsystem # registry directories for storage of a copy of the original - # "pkideployment.cfg" configuration file used to spawn this instance, + # deployment configuration file used to spawn this instance, # and save a copy of this file util.directory.create(master['pki_registry_path']) util.directory.create(master['pki_instance_type_registry_path']) diff --git a/base/deploy/src/scriptlets/pkiconfig.py b/base/deploy/src/scriptlets/pkiconfig.py index 0043662..35c80a5 100644 --- a/base/deploy/src/scriptlets/pkiconfig.py +++ b/base/deploy/src/scriptlets/pkiconfig.py @@ -99,9 +99,14 @@ PKI_DEPLOYMENT_DEFAULT_APACHE_SERVICE_NAME = "apache" PKI_DEPLOYMENT_DEFAULT_TOMCAT_SERVICE_NAME = "tomcat" PKI_DEPLOYMENT_DEFAULT_APACHE_INSTANCE_NAME = "pki-apache" PKI_DEPLOYMENT_DEFAULT_TOMCAT_INSTANCE_NAME = "pki-tomcat" -PKI_DEPLOYMENT_DEFAULT_CONFIGURATION_FILE = "pkideployment.cfg" + +PKI_DEPLOYMENT_CONFIGURATION_DIR =\ + "/usr/share/pki/deployment/config" +PKI_DEPLOYMENT_CONFIGURATION_FILE = "deployment.cfg" +PKI_DEPLOYMENT_DEFAULT_CONFIGURATION_FILE =\ + PKI_DEPLOYMENT_CONFIGURATION_DIR + "/" + PKI_DEPLOYMENT_CONFIGURATION_FILE PKI_DEPLOYMENT_SLOTS_CONFIGURATION_FILE =\ - "/usr/share/pki/deployment/config/pkislots.cfg" + PKI_DEPLOYMENT_CONFIGURATION_DIR + "/pkislots.cfg" # subtypes of PKI subsystems PKI_DEPLOYMENT_CLONED_PKI_SUBSYSTEM = "Cloned" @@ -155,7 +160,7 @@ def str2bool(string): # and 'wait_to_attach_an_external_java_debugger(master)' functions, # change 'pki_enable_java_debugger=False' to # 'pki_enable_java_debugger=True' in the appropriate -# 'pkideployment.cfg' configuration file. +# deployment configuration file. def prepare_for_an_external_java_debugger(instance): print print PKI_DEPLOYMENT_INTERRUPT_BANNER diff --git a/base/deploy/src/scriptlets/pkimessages.py b/base/deploy/src/scriptlets/pkimessages.py index cec154c..dbfb8e1 100644 --- a/base/deploy/src/scriptlets/pkimessages.py +++ b/base/deploy/src/scriptlets/pkimessages.py @@ -114,7 +114,7 @@ PKIDESTROY_EPILOG =\ "REMINDER:\n\n"\ " The default PKI instance path will be calculated and placed in front\n"\ " of the mandatory '-i <instance>' parameter, and the values that reside\n"\ -" in a copy of the 'pkideployment.cfg' file that was most recently used\n"\ +" in deployment configuration file that was most recently used\n"\ " by this instance's 'pkispawn' (or 'pkispawn -u') command will be\n"\ " utilized by 'pkidestroy' to remove this instance.\n\n"\ " Finally, if an optional '-p <prefix>' is defined, this value WILL be\n"\ diff --git a/base/deploy/src/scriptlets/pkiparser.py b/base/deploy/src/scriptlets/pkiparser.py index 438b23b..d05870e 100644 --- a/base/deploy/src/scriptlets/pkiparser.py +++ b/base/deploy/src/scriptlets/pkiparser.py @@ -178,7 +178,7 @@ class PKIConfigParser: deployed_pki_subsystem_path + "/" +\ "registry" + "/" +\ config.pki_subsystem.lower() + "/" +\ - config.PKI_DEPLOYMENT_DEFAULT_CONFIGURATION_FILE + config.PKI_DEPLOYMENT_CONFIGURATION_FILE # always verify that configuration file exists if not os.path.exists(config.pkideployment_cfg) or\ not os.path.isfile(config.pkideployment_cfg): @@ -222,7 +222,9 @@ class PKIConfigParser: self.pki_config = ConfigParser.ConfigParser() # Make keys case-sensitive! self.pki_config.optionxform = str - self.pki_config.read(config.pkideployment_cfg) + self.pki_config.read([ + config.PKI_DEPLOYMENT_DEFAULT_CONFIGURATION_FILE, + config.pkideployment_cfg]) config.pki_default_dict = self.pki_config.defaults() pkilogging.sensitive_parameters = config.pki_default_dict['sensitive_parameters'].split() config.pki_common_dict = dict(self.pki_config._sections['Common']) @@ -2309,11 +2311,11 @@ class PKIConfigParser: # Finalization name/value pairs config.pki_master_dict['pki_deployment_cfg_replica'] =\ os.path.join(config.pki_master_dict['pki_subsystem_registry_path'], - config.PKI_DEPLOYMENT_DEFAULT_CONFIGURATION_FILE) + config.PKI_DEPLOYMENT_CONFIGURATION_FILE) config.pki_master_dict['pki_deployment_cfg_spawn_archive'] =\ config.pki_master_dict['pki_subsystem_archive_log_path'] + "/" +\ "spawn" + "_" +\ - config.PKI_DEPLOYMENT_DEFAULT_CONFIGURATION_FILE + "." +\ + config.PKI_DEPLOYMENT_CONFIGURATION_FILE + "." +\ config.pki_master_dict['pki_timestamp'] config.pki_master_dict['pki_deployment_cfg_respawn_archive'] =\ config.pki_master_dict['pki_subsystem_archive_log_path'] + "/" +\ |