Ejemplo n.º 1
0
    def setup_config(self):
        opts = config.master_config(self.get_config_file_path('master'))
        user = opts.get('user', 'root')
        opts['_minion_conf_file'] = opts['conf_file']
        opts.update(config.minion_config(self.get_config_file_path('minion')))
        # Over ride the user from the master config file
        opts['user'] = user

        if 'syndic_master' not in opts:
            self.error(
                "The syndic_master needs to be configured in the salt master "
                "config, EXITING!"
            )

        from salt import utils
        # Some of the opts need to be changed to match the needed opts
        # in the minion class.
        opts['master'] = opts['syndic_master']
        opts['master_ip'] = utils.dns_check(opts['master'])

        opts['master_uri'] = 'tcp://{0}:{1}'.format(
            opts['master_ip'], str(opts['master_port'])
        )
        opts['_master_conf_file'] = opts['conf_file']
        opts.pop('conf_file')
        return opts
Ejemplo n.º 2
0
    def setup_config(self):
        opts = config.master_config(self.get_config_file_path("master"))
        opts["_minion_conf_file"] = opts["conf_file"]
        opts.update(config.minion_config(self.get_config_file_path("minion")))

        if "syndic_master" not in opts:
            self.error("The syndic_master needs to be configured in the salt master " "config, EXITING!")

        from salt import utils

        # Some of the opts need to be changed to match the needed opts
        # in the minion class.
        opts["master"] = opts["syndic_master"]
        opts["master_ip"] = utils.dns_check(opts["master"])

        opts["master_uri"] = "tcp://{0}:{1}".format(opts["master_ip"], str(opts["master_port"]))
        opts["_master_conf_file"] = opts["conf_file"]
        opts.pop("conf_file")
        return opts
Ejemplo n.º 3
0
    def setup_config(self):
        opts = config.master_config(self.get_config_file_path())
        user = opts.get('user', 'root')
        opts['_minion_conf_file'] = opts['conf_file']
        opts.update(config.minion_config(self.get_config_file_path('minion')))
        # Override the user from the master config file
        opts['user'] = user
        # Override the name of the PID file.
        opts['pidfile'] = '/var/run/salt-syndic.pid'

        if not opts.get('syndic_master', None):
            self.error(
                'The syndic_master needs to be configured in the salt master '
                'config, EXITING!'
            )

        # Some of the opts need to be changed to match the needed opts
        # in the minion class.
        opts['master'] = opts.get('syndic_master', opts['master'])
        try:
            opts['master_ip'] = utils.dns_check(
                opts['master'],
                ipv6=opts['ipv6']
            )
        except exceptions.SaltSystemExit as exc:
            self.exit(
                status=exc.code,
                msg='{0}: {1}\n'.format(self.get_prog_name(), exc.message)
            )

        opts['master_uri'] = 'tcp://{0}:{1}'.format(
            opts['master_ip'], str(opts['master_port'])
        )
        opts['_master_conf_file'] = opts['conf_file']
        opts.pop('conf_file')
        return opts