-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(init): top level meta state apply states based on configuration
Minion should only have the proper configuration set and running `state.apply moosefs` will apply only enabled components. BREAKING CHANGE: you must set `master:enabled`, `metalogger:enabled`, `chunkserver:enabled`, `cgiserv:enabled`, `client:enabled`, `cli:enabled` and `netdump:enabled` to install each component with the top level state
- Loading branch information
Showing
2 changed files
with
42 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- mode: salt; coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{%- set includes = [] %} | ||
{%- set components = [ | ||
"netdump", | ||
"cli", | ||
"client", | ||
"cgiserv", | ||
"cgi", | ||
"chunkserver", | ||
"metalogger", | ||
"master", | ||
] %} | ||
|
||
{%- for component in components %} | ||
{%- do includes.append("." ~ component ~ ".cleaned") %} | ||
{%- endfor %} | ||
|
||
include: {{ includes }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
{% from "moosefs/map.jinja" import moosefs with context %} | ||
# -*- mode: salt; coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{#- Get the `tplroot` from `tpldir` #} | ||
{%- set tplroot = tpldir.split("/")[0] %} | ||
{%- from tplroot ~ "/libs/map.jinja" import mapdata as moosefs without context %} | ||
build_essestial: | ||
pkg.installed: | ||
- pkgs: | ||
{% for required_pkg in moosefs.required_pkgs %} | ||
- {{ required_pkg }} | ||
{% endfor %} | ||
{%- set includes = [] %} | ||
{%- set components = [ | ||
"master", | ||
"metalogger", | ||
"chunkserver", | ||
"cgi", | ||
"cgiserv", | ||
"client", | ||
"cli", | ||
"netdump", | ||
] %} | ||
mfs-group: | ||
group.present: | ||
- name: mfs | ||
- system: True | ||
{%- for component in components %} | ||
{%- if moosefs | traverse(component ~ ":enabled", False) %} | ||
{%- do includes.append("." ~ component) %} | ||
{%- endif %} | ||
{%- endfor %} | ||
mfs: | ||
user.present: | ||
- name: mfs | ||
- fullname: MooseFS | ||
- home: /home/mfs | ||
- createhome: True | ||
- groups: | ||
- mfs | ||
include: {{ includes }} |