New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Rfc] standalone formula with provided script #105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MalloZup The idea of having an easy deployment script is good.
In any case, I think that this is a sensitive topic. SUSE has multiple salt formulas (most of them managed by the SUMA team). The first discussion should be with them. To see if they have a similar need and in that case how they are solving/how the would do it.
About the current implementation.
- I would prefer to have the script working without fixed files. Create all the files during the runtime, and destroy afterwards. This should be easy to do with
bash
- I would use other approach to get the pillar file. Some flag, so you don't need to have the pillar file in an specific location.
-p my_pillar
or similar. - The same for the output log file.
- What is the
hana-top.sls
used for? Your comments in the PR description are not clear for me. salt doesn't need 3top.sls
files. It needs 2, one for the pillar and the other for the salt execution
9962b65
to
9328273
Compare
Any feedback is welcome. I already tried it out the PKG and worked ok. |
|
||
# Script to install salt formulas | ||
|
||
# these variables are formula specific: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this var change by formula..
This script will let the user automatically install formula after editing the pillar. It is usefull to abstract salt logic and provide a simple installer script, minimalistic to the user which are not familiar with salt.
9328273
to
25fd8e2
Compare
Closing due to inactivity. |
Workflow from user:
User install rpm of formula
zypper in formula-name
User edit
unique
pillar file in/usr/share/salt-formulas/config/hana/pillar/hana/hana.sls
This file need to be edited with HELP of suse.documentation which explains formula API etc.
--> having a 1 pillar.example file is normal in saltstack formulas.. see upstream : https://github.com/saltstack-formulas/openldap-formula/blob/master/pillar.example
run-saphanaboostrap-formula
(run-$FORMULA_NAME
)Features of formula CLI:
colors (red error, green INFO)
logger and execution phases:
[PREFLIGHTS]
checks, ( this can be useful in future , to check if the formula could run in the given host). It should however stay minimalist because doing to much "defensive" programming is a bad desing (anyways is out of scope)[SETUP]
copy grains etc ,FORMULA
run formula..set log level
-l
for salt. Defaulterror
concurrent
and conflict safe. An user can install X formulas, they don't interfer each other. This is because/usr/share/salt-formulas/config/FORMULA_NAME
will contain all self-isolated salt pillars/grains and other config.There is no shared conf
minimalism (auto-detection, no input allowed) -> this allow scriptable later on.
hana.sls
copy them to host1 and host2then run
ssh root@hana1 run-sapformula ; ssh root@hana2 run-sapformula
Technical details
For technical details check the RFC: https://confluence.suse.com/pages/viewpage.action?pageId=581566497
The 2 main mechanism are:
minion
and dir necessary for grant to have 0 conflictscli
check we have the folder we needs and execute salt-call with all needed parameters etc-This is what the CLI for each formula support:
Possible improvements: