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:
parent
e60e0bbebf
commit
5096abefac
11
docs/kickstart/module/apply_recipe.md
Normal file
11
docs/kickstart/module/apply_recipe.md
Normal 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
|
||||
```
|
11
docs/kickstart/module/apply_role.md
Normal file
11
docs/kickstart/module/apply_role.md
Normal 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
|
||||
```
|
14
kickstart/recipes/kickstart/module.sh
Normal file
14
kickstart/recipes/kickstart/module.sh
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user