mod
parent
5362f47805
commit
25f81ad389
140
README.md
140
README.md
|
@ -98,17 +98,151 @@ cat /etc/salt/minion.d/minion.conf
|
||||||
master: 10.1.4.1
|
master: 10.1.4.1
|
||||||
|
|
||||||
# Уникальный идентификатор миньона
|
# Уникальный идентификатор миньона
|
||||||
|
# по-умолчанию берётся hostname
|
||||||
id: centos-minion-1
|
id: centos-minion-1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Ключи
|
||||||
|
|
||||||
|
Для аутентификации и авторизации в Salt используются пары ключей (закрытый, открытый). При включении службы миньона формируется пара ключей, открытый ключ отправляется на мастер.
|
||||||
|
|
||||||
|
У мастера есть специальная утилита для работы с ключами - `salt-key`
|
||||||
|
|
||||||
|
Некоторые примеры работы с ней:
|
||||||
|
|
||||||
|
Посмотреть все ключи
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[root@alt-master ~]# salt-key -L
|
||||||
|
Accepted Keys:
|
||||||
|
Denied Keys:
|
||||||
|
Unaccepted Keys:
|
||||||
|
alt-minion-5
|
||||||
|
alt-minion-6
|
||||||
|
centos-minion-1
|
||||||
|
centos-minion-2
|
||||||
|
deb-minion-3
|
||||||
|
deb-minion-4
|
||||||
|
Rejected Keys:
|
||||||
|
```
|
||||||
|
|
||||||
|
Принять ключ конкретного миньона
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[root@alt-master ~]# salt-key -l accepted
|
||||||
|
Accepted Keys:
|
||||||
|
[root@alt-master ~]# salt-key -a centos-minion-1
|
||||||
|
The following keys are going to be accepted:
|
||||||
|
Unaccepted Keys:
|
||||||
|
centos-minion-1
|
||||||
|
Proceed? [n/Y]
|
||||||
|
Key for minion centos-minion-1 accepted.
|
||||||
|
```
|
||||||
|
|
||||||
|
Принять ключи по маске идентификаторов
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[root@alt-master ~]# salt-key -a 'deb*'
|
||||||
|
The following keys are going to be accepted:
|
||||||
|
Unaccepted Keys:
|
||||||
|
deb-minion-3
|
||||||
|
deb-minion-4
|
||||||
|
Proceed? [n/Y]
|
||||||
|
Key for minion deb-minion-3 accepted.
|
||||||
|
Key for minion deb-minion-4 accepted.
|
||||||
|
```
|
||||||
|
|
||||||
|
Показать только принятые ключи
|
||||||
|
|
||||||
|
```bash
|
||||||
|
salt-key -l accepted
|
||||||
|
```
|
||||||
|
|
||||||
|
Принять все предлагаемые ключи
|
||||||
|
|
||||||
|
```bash
|
||||||
|
salt-key -A
|
||||||
|
```
|
||||||
|
|
||||||
|
Удалить ключи по маске
|
||||||
|
|
||||||
|
```bash
|
||||||
|
salt-key -d 'deb*'
|
||||||
|
```
|
||||||
|
|
||||||
|
Удалить конкретный ключ
|
||||||
|
|
||||||
|
```bash
|
||||||
|
salt-key -d deb-minion-3
|
||||||
|
```
|
||||||
|
|
||||||
|
Удалить все ключи
|
||||||
|
|
||||||
|
```bash
|
||||||
|
salt-key -D
|
||||||
|
```
|
||||||
|
|
||||||
|
Для дальнейшей работы необходимо принять ключи миньонов (уверены в том, что в текущем окружении только проверенные узлы)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[root@alt-master ~]# salt-key -A
|
||||||
|
The following keys are going to be accepted:
|
||||||
|
Unaccepted Keys:
|
||||||
|
alt-minion-5
|
||||||
|
alt-minion-6
|
||||||
|
centos-minion-2
|
||||||
|
Proceed? [n/Y]
|
||||||
|
Key for minion alt-minion-5 accepted.
|
||||||
|
Key for minion alt-minion-6 accepted.
|
||||||
|
Key for minion centos-minion-2 accepted.
|
||||||
|
```
|
||||||
|
|
||||||
|
Таким образом должен получиться такой вывод
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[root@alt-master ~]# salt-key -L
|
||||||
|
Accepted Keys:
|
||||||
|
alt-minion-5
|
||||||
|
alt-minion-6
|
||||||
|
centos-minion-1
|
||||||
|
centos-minion-2
|
||||||
|
deb-minion-3
|
||||||
|
deb-minion-4
|
||||||
|
Denied Keys:
|
||||||
|
Unaccepted Keys:
|
||||||
|
Rejected Keys:
|
||||||
|
```
|
||||||
|
|
||||||
|
## Первый тест
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[root@alt-master ~]# salt '*' test.ping
|
||||||
|
centos-minion-2:
|
||||||
|
True
|
||||||
|
deb-minion-3:
|
||||||
|
True
|
||||||
|
deb-minion-4:
|
||||||
|
True
|
||||||
|
centos-minion-1:
|
||||||
|
True
|
||||||
|
alt-minion-6:
|
||||||
|
True
|
||||||
|
alt-minion-5:
|
||||||
|
True
|
||||||
|
|
||||||
|
|
||||||
|
-------------------------------------------
|
||||||
|
Summary
|
||||||
|
-------------------------------------------
|
||||||
|
# of minions targeted: 6
|
||||||
|
# of minions returned: 6
|
||||||
|
# of minions that did not return: 0
|
||||||
|
# of minions with errors: 0
|
||||||
|
-------------------------------------------
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Источники
|
## Источники
|
||||||
|
|
||||||
<https://www.youtube.com/watch?v=6zY41M2anrY></br>
|
<https://www.youtube.com/watch?v=6zY41M2anrY></br>
|
||||||
<https://docs.saltproject.io/en/latest/contents.html>
|
<https://docs.saltproject.io/en/latest/contents.html>
|
||||||
|
|
||||||
sa
|
|
||||||
P@ssw0rd
|
|
||||||
|
|
Loading…
Reference in New Issue