Beispiel #1
0
    def __init__(self, args=None):
        """
        The web based installer leverages Flask to present end-users of
        dcos_installer with a clean web interface to configure their
        site-based installation of DC/OS.
        """
        # If no args are passed to the class, then we're calling this
        # class from another library or code so we shouldn't execute
        # parser or anything else
        if args:
            options = self.parse_args(args)
            if len(options.hash_password) > 0:
                print_header("HASHING PASSWORD TO SHA512")
                backend.hash_password(options.hash_password)
                sys.exit(0)

            make_default_dir()

            if options.web:
                print_header("Starting DC/OS installer in web mode")
                async_server.start(options)

            if options.validate_config:
                print_header('VALIDATING CONFIGURATION')
                log_warn_only()
                validation_errors = backend.do_validate_gen_config()
                if validation_errors:
                    print_validation_errors(validation_errors)
                    sys.exit(1)
                sys.exit(0)

            if options.genconf:
                print_header("EXECUTING CONFIGURATION GENERATION")
                code = backend.do_configure()
                if code != 0:
                    sys.exit(1)
                sys.exit(0)

            validate_ssh_config_or_exit()

            dispatch_action(options)
Beispiel #2
0
 def hash_password(args):
     if len(args.hash_password) > 0:
         print_header("HASHING PASSWORD TO SHA512")
         backend.hash_password(args.hash_password)
         return 0
 def hash_password(args):
     if len(args.hash_password) > 0:
         print_header("HASHING PASSWORD TO SHA512")
         backend.hash_password(args.hash_password)
         return 0
Beispiel #4
0
    def __init__(self, args=None):
        """
        The web based installer leverages Flask to present end-users of
        dcos_installer with a clean web interface to configure their
        site-based installation of DC/OS.
        """
        # If no args are passed to the class, then we're calling this
        # class from another library or code so we shouldn't execute
        # parser or anything else
        make_default_dir()
        if args:
            options = self.parse_args(args)
            if len(options.hash_password) > 0:
                print_header("HASHING PASSWORD TO SHA512")
                backend.hash_password(options.hash_password)
                sys.exit(0)

            if options.web:
                print_header("Starting DC/OS installer in web mode")
                async_server.start(options)

            if options.genconf:
                print_header("EXECUTING CONFIGURATION GENERATION")
                code = backend.do_configure()
                if code != 0:
                    sys.exit(1)
                sys.exit(0)

            if options.validate_config:
                print_header('VALIDATING CONFIGURATION')
                log_warn_only()
                validation_errors = backend.do_validate_gen_config()
                if validation_errors:
                    print_validation_errors(validation_errors)
                    sys.exit(1)
                sys.exit(0)

            validate_ssh_config_or_exit()
            action = None

            if options.preflight:
                print_header("EXECUTING PREFLIGHT")
                action = action_lib.run_preflight

            if options.deploy:
                print_header("EXECUTING DC/OS INSTALLATION")
                action = action_lib.install_dcos

            if options.postflight:
                print_header("EXECUTING POSTFLIGHT")
                action = action_lib.run_postflight

            if options.uninstall:
                print_header("EXECUTING UNINSTALL")
                tall_enough_to_ride()
                action = action_lib.uninstall_dcos

            if options.install_prereqs:
                print_header("EXECUTING INSTALL PREREQUISITES")
                action = action_lib.install_prereqs

            sys.exit(run_loop(action, options))