예제 #1
0
    def test_configure_module_confis(self):
        from fabmagic import redis
        recipes = [("nginx", {"roles": ["web1", "web2"]}),
                   "monit",
                   "recipes",
                   "deploy",
                   "frameworks",
                   "frameworks.django",
                   redis]
        fabmagic.configure_modules(*recipes)
        self.assertTrue(isinstance(fabmagic.env.magic_modules, dict))

        for recipe in recipes:
            if isinstance(recipe, (tuple, list)):
                for key, value in recipe[1].iteritems():
                    self.assertEquals(fabmagic.env.magic_modules[recipe[0]][key], value)
            else:
                if isinstance(recipe, ModuleType):
                    m = recipe
                    recipe = m.__name__
                else:
                    m = import_module("fabmagic.{0}".format(recipe))

                self.assertEquals(fabmagic.env.magic_modules[_throw_off_fabmagic(recipe)],
                                  getattr(m, "module_config", fabmagic.utils.ModuleConfig()))
        self.env = deepcopy(self.env_copy)
예제 #2
0
:license: BSD, see LICENSE for more details.
:github: http://github.com/Lispython/fabmagic
"""

import fabmagic
import fabmagic.redis

from fabric.state import env
from fabric.api import task, run as remote_run

fabmagic.configure_modules(
    ("nginx", {"test_key": "test_value"}),
    "monit",
    ("cookbooks", {"roles": ["system", "db"]}),
    "roles",
    "redis",
    "deploy",
    "frameworks.django",
    # Reset preconfigured recipe_config.roles
    ("system", {"roles": ["system", "db"]})
    )

machine1 = {"host": "[email protected]",
            "password": "******"}

machine2 = {"host": "[email protected]",
            "password": "******"}

# Configure recipes by machine roles and environment

예제 #3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabmagic.fabfile
~~~~~~~~~~~~~~~~

Examples of Fabric Magic Recipes

:copyright: (c) 2012 by Alexandr Lispython ([email protected]).
:license: BSD, see LICENSE for more details.
:github: http://github.com/Lispython/fabmagic
"""

import fabmagic

fabmagic.configure_modules("nginx", "monit", "cookbooks", "deploy",
                           "frameworks", "system")
예제 #4
0
"""

import fabmagic
import fabmagic.redis

from fabric.state import env
from fabric.api import task, run as remote_run

fabmagic.configure_modules(
    ("nginx", {
        "test_key": "test_value"
    }),
    "monit",
    ("cookbooks", {
        "roles": ["system", "db"]
    }),
    "roles",
    "redis",
    "deploy",
    "frameworks.django",
    # Reset preconfigured recipe_config.roles
    ("system", {
        "roles": ["system", "db"]
    }))

machine1 = {"host": "[email protected]", "password": "******"}

machine2 = {"host": "[email protected]", "password": "******"}

# Configure recipes by machine roles and environment

예제 #5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabmagic.fabfile
~~~~~~~~~~~~~~~~

Examples of Fabric Magic Recipes

:copyright: (c) 2012 by Alexandr Lispython ([email protected]).
:license: BSD, see LICENSE for more details.
:github: http://github.com/Lispython/fabmagic
"""

import fabmagic


fabmagic.configure_modules(
    "nginx",
    "monit",
    "cookbooks",
    "deploy",
    "frameworks",
    "system")