Support for loading recipes and roles from modules

Modules are located under `modules` folder. They will be copied on
deploy as well.

An example structure:

```
sample
├── files
├── install.sh
├── modules
│   └── another
│       ├── files
│       ├── install.sh
│       ├── README.md
│       ├── recipes
│       └── roles
│           └── web.sh
├── README.md
├── recipes
└── roles
```

Roles and recipes will be available for your project to access it with
the commited functions
This commit is contained in:
Bruno Tavares 2014-02-23 13:23:25 -03:00
parent e60e0bbebf
commit 5096abefac
3 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,11 @@
# kickstart.module.apply_recipe module_name recipe_name
Apply `recipe_name` from `module_name`.
`module_name` is the name of the module under the `modules` folder.
`recipe_name` is the name of the recipe under the `modules/module_name/recipes/recipe_name.sh`, without the .sh
### Example
```bash
$ kickstart.module.apply_recipe kickstart-baseline gcc
```

View File

@ -0,0 +1,11 @@
# kickstart.module.apply_role module_name role_name
Apply `role_name` from `module_name`.
`module_name` is the name of the module under the `modules` folder.
`role_name` is the name of the role under the `modules/module_name/roles/role_name.sh`, without the .sh
### Example
```bash
$ kickstart.module.apply_role kickstart-baseline haskell
```

View File

@ -0,0 +1,14 @@
kickstart.module.apply_role() {
kickstart.module.apply_ $1 $2 roles
}
kickstart.module.apply_recipe() {
kickstart.module.apply_ $1 $2 recipes
}
kickstart.module.apply_() {
local cur_dir=`pwd`;
cd modules/$1
source $3/$2.sh
cd $cur_dir
}