informatica:linux:salt
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| informatica:linux:salt [2014/01/04 13:37] – [Servidor] javi | informatica:linux:salt [2015/04/13 20:19] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ========== Salt ========== | + | ====== Salt ====== |
| salt configuration python | salt configuration python | ||
| - | ======= Instalacion | + | ===== Instalacion ===== |
| - | ===== Servidor | + | ==== Servidor ==== |
| Instalacion normal: | Instalacion normal: | ||
| Line 20: | Line 20: | ||
| </ | </ | ||
| - | ===== Cliente | + | ==== Cliente ==== |
| | | ||
| Instalacion normal: | Instalacion normal: | ||
| Line 35: | Line 35: | ||
| </ | </ | ||
| - | ===== (Cliente y servidor) Instalacion manual de zeromq | + | ==== (Cliente y servidor) Instalacion manual de zeromq ==== |
| 1. Instalar paquetes: | 1. Instalar paquetes: | ||
| Line 85: | Line 85: | ||
| sudo pip install --upgrade pyzmq | sudo pip install --upgrade pyzmq | ||
| + | ===== Claves ===== | ||
| + | ==== Aceptar las claves del cliente ==== | ||
| - | ======= Claves ======= | ||
| - | | ||
| El cliente se tiene que registrar contra el servidor. Este proceso se realiza **una sola vez por cada cliente**: | El cliente se tiene que registrar contra el servidor. Este proceso se realiza **una sola vez por cada cliente**: | ||
| Line 125: | Line 125: | ||
| client.example.com: | client.example.com: | ||
| - | ======= | + | |
| + | ==== Regenerar claves del cliente | ||
| + | |||
| + | Este procedimiento es util cuando por ejemplo se clona una Maquina Virtual y se quiere registrar el cliente contra el maestro. | ||
| + | |||
| + | 1. (Cliente) para salt: | ||
| + | |||
| + | sudo service salt-minion stop | ||
| + | |||
| + | 2. (Cliente) eliminar claves tanto propias como del servidor: | ||
| + | |||
| + | sudo rm -fr / | ||
| + | |||
| + | 3. (Cliente) ajustar el id de minion, por ejemplo especificando el mismo valor que el hostname: | ||
| + | |||
| + | sudo vim / | ||
| + | |||
| + | cliente-2.example.com | ||
| + | |||
| + | 4. (Cliente) arrancar salt: | ||
| + | |||
| + | sudo service salt-minion start | ||
| + | |||
| + | 5. (Servidor) ya deberia poder ver la nueva peticion: | ||
| + | |||
| + | sudo salt-key -L | ||
| + | Accepted Keys: | ||
| + | cliente.example.com | ||
| + | Unaccepted Keys: | ||
| + | cliente-2.example.com | ||
| + | Rejected Keys: | ||
| + | |||
| + | 6. (Servidor) solo queda aceptar las claves: | ||
| + | |||
| + | sudo salt-key -a cliente-2.example.com | ||
| + | |||
| + | < | ||
| + | The following keys are going to be accepted: | ||
| + | Unaccepted Keys: | ||
| + | cliente-2.example.com | ||
| + | Proceed? [n/Y] Y | ||
| + | Key for minion cliente-2.example.com accepted | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Configuracion | ||
| - | ===== Servidor | + | ==== Servidor ==== |
| sudo cp / | sudo cp / | ||
| Line 141: | Line 186: | ||
| pillar_roots: | pillar_roots: | ||
| base: | base: | ||
| - | - /etc/salt/pillars | + | - /etc/salt/pillar |
| </ | </ | ||
| | | ||
| - | ===== Cliente | + | Para ejecutar salt-master como usuario no-privilegiado: |
| + | |||
| + | 1. Para salt: | ||
| + | |||
| + | sudo service salt-master stop | ||
| + | ps aux | grep salt | ||
| + | |||
| + | 2. Cambiar permisos (en este caso yo uso '/ | ||
| + | |||
| + | sudo chown -R usuario: | ||
| + | |||
| + | 3. Reiniciar salt: | ||
| + | |||
| + | sudo service salt-master start | ||
| + | ==== Cliente ==== | ||
| sudo cp / | sudo cp / | ||
| Line 152: | Line 211: | ||
| </ | </ | ||
| - | ======= States | + | |
| + | ===== States ===== | ||
| Son los modulos en los que se definen las acciones, mas o menos complejas, a realizar por parte de los clientes, o ' | Son los modulos en los que se definen las acciones, mas o menos complejas, a realizar por parte de los clientes, o ' | ||
| Line 199: | Line 259: | ||
| </ | </ | ||
| - | ======= | + | ===== Pillars |
| + | |||
| + | ==== Ejemplo sencillo | ||
| (Salt < 0.16.2 usar ' | (Salt < 0.16.2 usar ' | ||
| Line 402: | Line 464: | ||
| 5 | 5 | ||
| </ | </ | ||
| - | ======= Errores ======= | ||
| - | 2014-01-03 22: | + | ==== Especificar por minion id ==== |
| - | **SOLUCION** seguir procedimiento [[salt# | + | /etc/salt/ |
| - | | + | |
| | | ||
| + | < | ||
| + | base: | ||
| + | ' | ||
| + | - users | ||
| + | ' | ||
| + | - data | ||
| + | </ | ||
| + | ===== Grains ===== | ||
| + | |||
| + | ==== Listar ==== | ||
| + | |||
| + | sudo salt ' | ||
| + | |||
| + | < | ||
| + | client.example.com: | ||
| + | - biosreleasedate | ||
| + | - biosversion | ||
| + | - cpu_flags | ||
| + | - cpu_model | ||
| + | - cpuarch | ||
| + | - defaultencoding | ||
| + | - defaultlanguage | ||
| + | - domain | ||
| + | - fqdn | ||
| + | - fqdn_ip4 | ||
| + | - fqdn_ip6 | ||
| + | - gpus | ||
| + | - host | ||
| + | - id | ||
| + | - ip_interfaces | ||
| + | - ipv4 | ||
| + | - ipv6 | ||
| + | - kernel | ||
| + | - kernelrelease | ||
| + | - localhost | ||
| + | - lsb_distrib_codename | ||
| + | - lsb_distrib_description | ||
| + | - lsb_distrib_id | ||
| + | - lsb_distrib_release | ||
| + | - manufacturer | ||
| + | - master | ||
| + | - mem_total | ||
| + | - nodename | ||
| + | - num_cpus | ||
| + | - num_gpus | ||
| + | - os | ||
| + | - os_family | ||
| + | - osarch | ||
| + | - oscodename | ||
| + | - osfinger | ||
| + | - osfullname | ||
| + | - osrelease | ||
| + | - path | ||
| + | - productname | ||
| + | - ps | ||
| + | - pythonpath | ||
| + | - pythonversion | ||
| + | - saltpath | ||
| + | - saltversion | ||
| + | - saltversioninfo | ||
| + | - serialnumber | ||
| + | - server_id | ||
| + | - shell | ||
| + | - virtual | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== " | ||
| + | |||
| + | http:// | ||
| + | |||
| + | http:// | ||
| + | |||
| + | http:// | ||
| + | |||
| + | ===== Enlaces ===== | ||
| + | |||
| + | * Lista de state modules: | ||
| + | |||
| + | http:// | ||
| + | |||
| + | ===== Errores ===== | ||
| + | |||
| + | 2014-01-03 22: | ||
| + | |||
| + | **SOLUCION** seguir procedimiento [[salt# | ||
informatica/linux/salt.1388842625.txt.gz · Last modified: (external edit)
