def init_ldap_setup_parser_options()

in ambari-server/src/main/python/ambari-server.py [0:0]


def init_ldap_setup_parser_options(parser):
  parser.add_option(
    "--ldap-url",
    action="callback",
    callback=check_ldap_url_options,
    type="str",
    default=None,
    help="Primary URL for LDAP (must not be used together with --ldap-primary-host and --ldap-primary-port)",
    dest="ldap_url",
  )
  parser.add_option(
    "--ldap-primary-host",
    action="callback",
    callback=check_ldap_url_options,
    type="str",
    default=None,
    help="Primary Host for LDAP (must not be used together with --ldap-url)",
    dest="ldap_primary_host",
  )
  parser.add_option(
    "--ldap-primary-port",
    action="callback",
    callback=check_ldap_url_options,
    type="int",
    default=None,
    help="Primary Port for LDAP (must not be used together with --ldap-url)",
    dest="ldap_primary_port",
  )
  parser.add_option(
    "--ldap-secondary-url",
    action="callback",
    callback=check_ldap_url_options,
    type="str",
    default=None,
    help="Secondary URL for LDAP (must not be used together with --ldap-secondary-host and --ldap-secondary-port)",
    dest="ldap_secondary_url",
  )
  parser.add_option(
    "--ldap-secondary-host",
    action="callback",
    callback=check_ldap_url_options,
    type="str",
    default=None,
    help="Secondary Host for LDAP (must not be used together with --ldap-secondary-url)",
    dest="ldap_secondary_host",
  )
  parser.add_option(
    "--ldap-secondary-port",
    action="callback",
    callback=check_ldap_url_options,
    type="int",
    default=None,
    help="Secondary Port for LDAP (must not be used together with --ldap-secondary-url)",
    dest="ldap_secondary_port",
  )
  parser.add_option(
    "--ldap-ssl", default=None, help="Use SSL [true/false] for LDAP", dest="ldap_ssl"
  )
  parser.add_option(
    "--ldap-type",
    default=None,
    help=f"Specify ldap type [{'/'.join(LDAP_TYPES)}] for offering defaults for missing options.",
    dest="ldap_type",
  )
  parser.add_option(
    "--ldap-user-class",
    default=None,
    help="User Attribute Object Class for LDAP",
    dest="ldap_user_class",
  )
  parser.add_option(
    "--ldap-user-attr",
    default=None,
    help="User Attribute Name for LDAP",
    dest="ldap_user_attr",
  )
  parser.add_option(
    "--ldap-user-group-member-attr",
    default=None,
    help="User Group Member Attribute for LDAP",
    dest="ldap_user_group_member_attr",
  )
  parser.add_option(
    "--ldap-group-class",
    default=None,
    help="Group Attribute Object Class for LDAP",
    dest="ldap_group_class",
  )
  parser.add_option(
    "--ldap-group-attr",
    default=None,
    help="Group Attribute Name for LDAP",
    dest="ldap_group_attr",
  )
  parser.add_option(
    "--ldap-member-attr",
    default=None,
    help="Group Membership Attribute Name for LDAP",
    dest="ldap_member_attr",
  )
  parser.add_option(
    "--ldap-dn",
    default=None,
    help="Distinguished name attribute for LDAP",
    dest="ldap_dn",
  )
  parser.add_option(
    "--ldap-base-dn", default=None, help="Base DN for LDAP", dest="ldap_base_dn"
  )
  parser.add_option(
    "--ldap-manager-dn",
    default=None,
    help="Manager DN for LDAP",
    dest="ldap_manager_dn",
  )
  parser.add_option(
    "--ldap-manager-password",
    default=None,
    help="Manager Password For LDAP",
    dest="ldap_manager_password",
  )
  parser.add_option(
    "--ldap-save-settings",
    action="store_true",
    default=None,
    help="Save without review for LDAP",
    dest="ldap_save_settings",
  )
  parser.add_option(
    "--ldap-referral",
    default=None,
    help="Referral method [follow/ignore] for LDAP",
    dest="ldap_referral",
  )
  parser.add_option(
    "--ldap-bind-anonym",
    default=None,
    help="Bind anonymously [true/false] for LDAP",
    dest="ldap_bind_anonym",
  )
  parser.add_option(
    "--ldap-sync-username-collisions-behavior",
    default=None,
    help="Handling behavior for username collisions [convert/skip] for LDAP sync",
    dest="ldap_sync_username_collisions_behavior",
  )
  parser.add_option(
    "--ldap-sync-disable-endpoint-identification",
    default=None,
    help="Determines whether to disable endpoint identification (hostname verification) during SSL handshake for LDAP sync. This option takes effect only if --ldap-ssl is set to 'true'",
    dest="ldap_sync_disable_endpoint_identification",
  )
  parser.add_option(
    "--ldap-force-lowercase-usernames",
    default=None,
    help="Declares whether to force the ldap user name to be lowercase or leave as-is",
    dest="ldap_force_lowercase_usernames",
  )
  parser.add_option(
    "--ldap-pagination-enabled",
    default=None,
    help="Determines whether results from LDAP are paginated when requested",
    dest="ldap_pagination_enabled",
  )
  parser.add_option(
    "--ldap-force-setup",
    action="store_true",
    default=False,
    help="Forces the use of LDAP even if other (i.e. PAM) authentication method is configured already or if there is no authentication method configured at all",
    dest="ldap_force_setup",
  )
  parser.add_option(
    "--ambari-admin-username",
    default=None,
    help="Ambari administrator username for accessing Ambari's REST API",
    dest="ambari_admin_username",
  )
  parser.add_option(
    "--ambari-admin-password",
    default=None,
    help="Ambari administrator password for accessing Ambari's REST API",
    dest="ambari_admin_password",
  )
  parser.add_option(
    "--truststore-type",
    default=None,
    help="Type of TrustStore (jks|jceks|pkcs12)",
    dest="trust_store_type",
  )
  parser.add_option(
    "--truststore-path",
    default=None,
    help="Path of TrustStore",
    dest="trust_store_path",
  )
  parser.add_option(
    "--truststore-password",
    default=None,
    help="Password for TrustStore",
    dest="trust_store_password",
  )
  parser.add_option(
    "--truststore-reconfigure",
    action="store_true",
    default=None,
    help="Force to reconfigure TrustStore if exits",
    dest="trust_store_reconfigure",
  )
  parser.add_option(
    "--ldap-enabled-ambari",
    default=None,
    help="Indicates whether to enable/disable LDAP authentication for Ambari, itself",
    dest="ldap_enabled_ambari",
  )
  parser.add_option(
    "--ldap-manage-services",
    default=None,
    help="Indicates whether Ambari should manage the LDAP configurations for specified services",
    dest="ldap_manage_services",
  )
  parser.add_option(
    "--ldap-enabled-services",
    default=None,
    help="A comma separated list of services that are expected to be configured for LDAP (you are allowed to use '*' to indicate ALL services)",
    dest="ldap_enabled_services",
  )