Recently, I'm learning salt from its doc. However, I'm quite confused about execution modules and state modules. Why there are two types of module? Why they can't unify? If we have just one type of module that can be used both on command line and in sls file, isn't it simpler and better?
相关问题
- Salt/Hash for Firebase Simple Login?
- Unique text field in MySQL and php
- Spring Security salt for custom UserDetails
- Compare version numbers using jinja2
- Is salting with a hashed version of the user's
相关文章
- PHP storing password with blowfish & salt & pepper
- PHP crypt(pass, salt) alternative in Java - Blowfi
- should i use urandom or openssl_random_pseudo_byte
- how to render and dump the file sls with salt stac
- How do I use SHA-512 with Rfc2898DeriveBytes in my
- AES 256 bit encryption - java.security.InvalidAlgo
- Spring Security Custom Authentication and Password
- PDO Register and Login Password Matching
In short:
Execution modules:
They are designed to perform tasks on a minion. For example:
mysql.query
will query a specified database. The execution module does not check if the database needs to be queried or not. It just executes its task.Have a look at the complete list of modules and you will see that they will just execute a task for you. https://docs.saltstack.com/en/latest/ref/modules/all/index.html
States module:
It's called THE states module.
The states module is a module too. But it's a special one. With the states module you can create states (the sls files under /srv/salt ) for your Minions.
You could for example create a state that ensures the Minion has a web server configured for www.example.com.
After you have created your state you can apply it with the states module:
salt <minion> state.apply example_webserver
The
example_webserver
state specifies what the Minion needs to have. If the Minion is already in the correct state, it does nothing. If the Minion is not in the correct state it will try to get there.The states module can be found here: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.module.html