mc_project_1 / project settings regitry APIV1¶
-
mc_states.modules.mc_project_1.
get_common_vars
(*args, **kwargs)¶ Retro compat, wrapper to get_configuration
-
mc_states.modules.mc_project_1.
get_configuration
(name, salt_subdir='salt', default_env=None, project_subdir='project', salt_branch='salt', project_branch='master', pillar_subdir='pillar', user=None, groups=None, salt_root='{project_dir}/salt', project_root='{project_dir}/project', pillar_top='{project_dir}/pillar', pillar_root='{project_dir}/pillar', url='https://github.com/makinacorpus/{name}.git', domain='{name}.local', domains=None, main_ip='127.0.0.1', defaults=None, env_defaults=None, os_defaults=None, sls_includes=None, no_user=False, no_salt=False, full=True, no_domain=False, no_reset_perms=False, no_default_includes=False, *args, **kwargs)¶ Return all needed data for the project API macro: project API 1
- name
- name of the project
- default_env
- environnemt to run into (may be dev|prod, better to set a grain see bellow)
- project_subdir
- the subdirectory of the project in /srv/projects/foo
- salt_root
- where to install the salt branch
- project_root
- where to install the project,
- salt_subdir
- the subdirectory of the salt in /srv/salts/foo
- pillar_subdir
- the subdirectory of the pillar in /srv/pillars/foo
- full
- set to false to only run the sole project states and not a full highstate
- project_branch
- the branch of the project
- salt_branch
- the branch of the project salt tree
- url
- the git repository url
- domain
- main domain of the installed application if any
- domains
- Additionnal hosts (mapping {host: ip}), the main domain will be inserted in this list linked to the ‘main_ip’.
- user
- system project user
- groups
- system project user groups, first group is main
- defaults
- data mapping for this project to use in states as common.data
- env_defaults
- per environment (eg: prod|dev) specific defaults data
- os_defaults
- per os (eg: Ubuntu/Debian) specific defaults data
- sls_includes
- includes to add to the project top includes statement
- no_salt
- Do not manage the salt branch
Licefycle functions and activation bypass see ref:project_lifecycle
All the projects will have the same global procedure. From star
- no_default_includes
- Do not add salt_minon & other bases sls like ssh to default includes
- no_domain
- Do not manage the domains in /etc/hosts
- no_reset_perms
- Do not run fixpermissions
You can override default states values by pillar/grain like:
salt grain.setval makina-projects.foo.url 'http://goo/goo.git salt grain.setval makina-projects.foo.default_env prod
Or in pillar:
/srv/projects/foo/pillar/init.sls: makina-projects.foo.url: http://goo/goo.git makina-projects.foo.default_env: prod