Friday, September 30, 2022

Salt Formats

So far, the example SLS files were YAML files. However, Salt interprets YAML files as Jinja templates of YAML files. This is useful for customizing fields based on grains or pillars.For example, the name of the package containing the things you need to build Python packages differs between CentOS and Debian. The following SLS snippet shows how to target different packages to different machines in...
Share:

Friday, September 23, 2022

Salt Concepts

Salt introduces quite a bit of terminology and quite a few concepts.A minion is the Salt agent. Even in the agentless SSH-based communication, there is still a minion. The first thing that Salt does is send over code for a minion and then start it.A Salt master sends commands to minions. A Salt state is a file with the .sls extension, which contains state declarations.name_of_state:    state.identifier:  ...
Share:

Monday, September 19, 2022

Desired state in Salt

The technical term for the desired state in Salt is highstate, which is shortened from high-level state. It describes the goal of the state. The name is a frequent cause of confusion because it seems to be the opposite of a low state, which is described almost nowhere.The low states, or the low-level states, are the steps Salt takes to get to the goal. Since the compilation of the goal to the low-level...
Share:

Thursday, September 15, 2022

Salt local testing

For testing locally, use salt-call --local instead of salt '*'. This needs privileged access, so it should probably be done in a VM or a container.The following command sends a ping command to all the machines on the roster (or, later, all connected minions).$ salt '*' test.pingThey are all supposed...
Share:

Monday, September 12, 2022

Using Salt

There are a few ways to use Salt.Locally: Run a local command that takes the desired steps.SSH: The server will ssh into clients and run commands that take the desired steps.Native protocol: Clients connect to the server and take whatever steps the server instructs them.Using the ssh mode removes the...
Share:

Thursday, September 8, 2022

SaltStack

Salt belongs to a class of configuration management systems intended to make administrating a large number of machines easier. It does so by applying the same rules to different machines, making sure that any differences in their configuration are intentional.It is written in Python and, more importantly, extensible in Python. For example, wherever a YAML file is used, Salt allows a Python file that...
Share:

Sunday, September 4, 2022

Python data types continued.....

Python provides a set data type for storing sets of data. A set is not a sequence because it does not have a specific order.Python also provides a single mapping data type, dict, which is used for creating dictionaries. A dictionary in Python is not a dictionary in the everyday sense, although there are some similarities between the two: A key in the dictionary maps to a particular value, enabling...
Share: