Difference between revisions of "Saltstack"

From ArchWiki
Jump to: navigation, search
(Installation)
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
[[Category:System administration]]
 
[[Category:System administration]]
= Saltstack =
+
{{Article summary start}}
 +
{{Article summary text|This page will give you information on what is Salt Stack and how to install it on Archlinux.}}
 +
{{Article summary end}}
  
This page will give you information on what is Salt Stack and how to install it on Archlinux.
+
From [http://docs.saltstack.com/ docs.saltstack.com]:
  
== What is Salt Stack? ==
+
:''Salt is a new approach to infrastructure management. Easy enought to get running in minutes, scalable enough to manage tens of thousands of servers, and fast enough to communicate with them in seconds.''
From the website:
+
:''Salt delivers a dynamic communication bus for instrastructures that can be used for orchestration, remote execution, configuration management and much more.''
 
+
Salt is a new approach to infrastructure management. Easy enought to get running in minutes,
+
scalable enough to manage tens of thousands of servers, and fast enough to communicate with them in seconds.
+
 
+
Salt delivers a dynamic communication bus for instrastructures that can be used for orchestration, remote execution, configuration management and much more.
+
  
 
== Installation ==
 
== Installation ==
Salt is available on aur {{AUR|salt}} or via the unofficial Salt Stack Archlinux repo:
+
Salt is available on [[AUR]] as {{AUR|salt}} or via the unofficial Salt Stack Archlinux repository:
  [salt]
+
[salt]
  Server = http://intothesaltmine.org/archlinux/
+
Server = http://intothesaltmine.org/archlinux/
 +
 
 +
The repo is a little bit outdated please use this {{AUR|salt}}
  
 
== Components of Salt Stack ==
 
== Components of Salt Stack ==
  
Salt is at it's core a Remote Execution solution. Running pre-defined or arbitrary commands on remote hosts. Salt functions on a master/minion topology. A master server acts as a central control bus for the clients (called minions), and the minions connect back to the master.
+
Salt is at its core a Remote Execution solution. Running pre-defined or arbitrary commands on remote hosts. Salt functions on a master/minion topology. A master server acts as a central control bus for the clients (called minions), and the minions connect back to the master.
  
 
=== Salt Master ===
 
=== Salt Master ===
  
 
Turning on the Salt master is easy, just turn it on! The default configuration is suitable for the vast majority of installations. The Salt master can be controlled with systemd.
 
Turning on the Salt master is easy, just turn it on! The default configuration is suitable for the vast majority of installations. The Salt master can be controlled with systemd.
  # systemctl start salt-master
+
# systemctl start salt-master
  
 
The Salt master can also be started in the foreground in debug mode, thus greatly increasing the command output:
 
The Salt master can also be started in the foreground in debug mode, thus greatly increasing the command output:
  # salt-master -l debug
+
# salt-master -l debug
  
 
The Salt master needs to bind to 2 TCP network ports on the system, these ports are 4505 and 4506.
 
The Salt master needs to bind to 2 TCP network ports on the system, these ports are 4505 and 4506.
Line 35: Line 34:
 
The Salt Minion can operate with or without a Salt Master. This wiki assumes that the minion will be connected to the master. for information on how to run a master-less minion please see the masterless quickstart guide: http://docs.saltstack.com/topics/tutorials/quickstart.html
 
The Salt Minion can operate with or without a Salt Master. This wiki assumes that the minion will be connected to the master. for information on how to run a master-less minion please see the masterless quickstart guide: http://docs.saltstack.com/topics/tutorials/quickstart.html
  
The Salt minion only needs to be aware of one piece of information to run, the network location of the master. By default the minion will look for the DNS name '''salt''' for the master, making the easiest approach to set internal DNS to resolve the name salt back to the Salt Master IP. Otherwise the minion configuration file will need to be edited, edit the configuration option '''master''' to point to the DNS name or the IP of the Salt Master.<br>
+
The Salt minion only needs to be aware of one piece of information to run, the network location of the master. By default the minion will look for the DNS name '''salt''' for the master, making the easiest approach to set internal DNS to resolve the name salt back to the Salt Master IP. Otherwise the minion configuration file will need to be edited, edit the configuration option '''master''' to point to the DNS name or the IP of the Salt Master.
/etc/salt/minion:
+
 
  master: saltmaster.example.com
+
{{hc|/etc/salt/minion|
 +
master: saltmaster.example.com}}
  
 
Now that the master can be found, start the minion in the same way as the master; with systemd.
 
Now that the master can be found, start the minion in the same way as the master; with systemd.
  # systemctl start salt-minion
+
# systemctl start salt-minion
  
 
Or in debug mode
 
Or in debug mode
  # salt-minion -l debug
+
# salt-minion -l debug
  
 
=== Salt Key ===
 
=== Salt Key ===
  
 
Salt authenticates minion using public key encryption and authentication. For a minion to start accepting commands from the master the minion keys need to be accepted. the '''salt-key''' command is used to manage all of the keys on the master. To list the keys that are on the master run salt-key list command:
 
Salt authenticates minion using public key encryption and authentication. For a minion to start accepting commands from the master the minion keys need to be accepted. the '''salt-key''' command is used to manage all of the keys on the master. To list the keys that are on the master run salt-key list command:
  # salt-key -L
+
# salt-key -L
  
 
The keys that have been rejected, accepted and pending acceptance are listed. To accept a minion:
 
The keys that have been rejected, accepted and pending acceptance are listed. To accept a minion:
  # salt-key -a minion.example.com
+
# salt-key -a minion.example.com
  
 
Or you can accept all keys at once with :
 
Or you can accept all keys at once with :
  # salt-key -A
+
# salt-key -A
  
 
== Salt commands ==
 
== Salt commands ==
Line 61: Line 61:
  
 
The '''salt''' command is compromised of command options, target specification, the function to execute, and arguments to the function. A simple command to start with looks like this:
 
The '''salt''' command is compromised of command options, target specification, the function to execute, and arguments to the function. A simple command to start with looks like this:
  # salt '*' test.ping
+
# salt '*' test.ping
  
 
The '''*''' is the target, which specifies all minions, and '''test.ping''' tells the minions to run the '''test.ping''' function. This '''salt''' command will tell all of the minions to execute the '''test.ping''' in parallel and return the result.
 
The '''*''' is the target, which specifies all minions, and '''test.ping''' tells the minions to run the '''test.ping''' function. This '''salt''' command will tell all of the minions to execute the '''test.ping''' in parallel and return the result.
  
 
for more commands see documentation or run:
 
for more commands see documentation or run:
  # salt '*' sys.doc
+
# salt '*' sys.doc
  
Link to the documentation:
+
==See also==
http://docs.saltstack.com/
+
* http://docs.saltstack.com/ - Official documentation

Revision as of 05:14, 23 May 2013

Summary help replacing me
This page will give you information on what is Salt Stack and how to install it on Archlinux.

From docs.saltstack.com:

Salt is a new approach to infrastructure management. Easy enought to get running in minutes, scalable enough to manage tens of thousands of servers, and fast enough to communicate with them in seconds.
Salt delivers a dynamic communication bus for instrastructures that can be used for orchestration, remote execution, configuration management and much more.

Installation

Salt is available on AUR as saltAUR or via the unofficial Salt Stack Archlinux repository:

[salt]
Server = http://intothesaltmine.org/archlinux/

The repo is a little bit outdated please use this saltAUR

Components of Salt Stack

Salt is at its core a Remote Execution solution. Running pre-defined or arbitrary commands on remote hosts. Salt functions on a master/minion topology. A master server acts as a central control bus for the clients (called minions), and the minions connect back to the master.

Salt Master

Turning on the Salt master is easy, just turn it on! The default configuration is suitable for the vast majority of installations. The Salt master can be controlled with systemd.

# systemctl start salt-master

The Salt master can also be started in the foreground in debug mode, thus greatly increasing the command output:

# salt-master -l debug

The Salt master needs to bind to 2 TCP network ports on the system, these ports are 4505 and 4506.

Salt Minion

The Salt Minion can operate with or without a Salt Master. This wiki assumes that the minion will be connected to the master. for information on how to run a master-less minion please see the masterless quickstart guide: http://docs.saltstack.com/topics/tutorials/quickstart.html

The Salt minion only needs to be aware of one piece of information to run, the network location of the master. By default the minion will look for the DNS name salt for the master, making the easiest approach to set internal DNS to resolve the name salt back to the Salt Master IP. Otherwise the minion configuration file will need to be edited, edit the configuration option master to point to the DNS name or the IP of the Salt Master.

/etc/salt/minion
master: saltmaster.example.com

Now that the master can be found, start the minion in the same way as the master; with systemd.

# systemctl start salt-minion

Or in debug mode

# salt-minion -l debug

Salt Key

Salt authenticates minion using public key encryption and authentication. For a minion to start accepting commands from the master the minion keys need to be accepted. the salt-key command is used to manage all of the keys on the master. To list the keys that are on the master run salt-key list command:

# salt-key -L

The keys that have been rejected, accepted and pending acceptance are listed. To accept a minion:

# salt-key -a minion.example.com

Or you can accept all keys at once with :

# salt-key -A

Salt commands

After connecting and accepting the minion on the Salt master you can now send commands to the minion. Salt commands allow for a vast set of functions to be executed and for specific minion and groups of minions to be targeted for execution. This makes the salt command very powerful, but the commannd is also very usable, and easy to understand.

The salt command is compromised of command options, target specification, the function to execute, and arguments to the function. A simple command to start with looks like this:

# salt '*' test.ping

The * is the target, which specifies all minions, and test.ping tells the minions to run the test.ping function. This salt command will tell all of the minions to execute the test.ping in parallel and return the result.

for more commands see documentation or run:

# salt '*' sys.doc

See also