示例#1
0
    def __init__(self, inventory):
        """ constructor """

        logger.debug("Running plugin: %s with cluster config %s" % (__file__, os.environ['OPS_CLUSTER_CONFIG']))

        app = AppContainer([os.environ['OPS_CLUSTER_CONFIG'], 'noop'])
        self.config = app.cluster_config.all()
示例#2
0
    def __init__(self, *args):
        """ constructor """

        super(VarsModule, self).__init__(*args)

        logger.debug("Running plugin: %s with cluster config %s" % (__file__, os.environ['OPS_CLUSTER_CONFIG']))

        app = AppContainer([os.environ['OPS_CLUSTER_CONFIG'], 'noop'])
        self.config = app.cluster_config.all()
示例#3
0
def app(*args):
    app = AppContainer(args)

    def test_plugin(inventory_opts):
        return """
                    {
                      "bastion": ["bastion.host"],
                      "nat": ["bastion.host"],
                      "web": [
                        "web1.host",
                        "web2.host"
                      ]
                    }
                """

        # we configure the plugin test_plugin

    inventory_plugins = ListInstanceProvider(instance(test_plugin))
    app.inventory_plugins = inventory_plugins

    return app
示例#4
0
    def __init__(self, inventory):
        """ constructor """

        logger.debug("Running plugin: %s with cluster config %s" %
                     (__file__, os.environ['OPS_CLUSTER_CONFIG']))

        app = AppContainer([os.environ['OPS_CLUSTER_CONFIG'], 'noop'])
        self.config = app.ops_config.config.copy()
        self.config.update({
            'ops_package_dir':
            app.ops_config.package_dir,
            'ops_ansible_tasks_dir':
            app.ops_config.package_dir + "/data/ansible/tasks"
        })
示例#5
0
def app(args):
    return AppContainer(args)