Updated README for all rolers, added role for configure sshd_config

pull/2/head
yuobrezkov 2025-01-31 15:28:35 +03:00
parent a758261414
commit 7c45838597
4 changed files with 128 additions and 64 deletions

View File

@ -1,38 +1,37 @@
Role Name
=========
# Роль Ansible: Установка Docker
A brief description of the role goes here.
## Описание
Requirements
------------
Данная роль предназначена для установки и настройки Docker на серверах с Debian/Ubuntu. В рамках выполнения роли:
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
1. Удаляются старые версии Docker и связанных пакетов.
2. Обновляется кэш `apt`.
3. Устанавливаются необходимые пакеты для работы с репозиториями.
4. Загружается GPG-ключ Docker и добавляется официальный репозиторий.
5. Обновляется кэш пакетов после добавления репозитория.
6. Устанавливаются необходимые компоненты Docker.
7. Обеспечивается запуск и автозапуск службы Docker.
Role Variables
--------------
## Требования
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
- Поддерживаемая версия ОС: Debian/Ubuntu
- Ansible с правами `root` (например, через `become: yes`)
Dependencies
------------
## Зависимости
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Данная роль не имеет зависимостей от других ролей.
Example Playbook
----------------
## Пример Playbook
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
Пример использования роли в Playbook:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
```yaml
- hosts: all
become: yes
roles:
- docker-install
```
License
-------
## Автор
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
Автор: [Юрий Обрезков]

View File

@ -1,20 +1,45 @@
Role Name
=========
# Роль Ansible: Инициализация кластера K8s
Это базовый набор, необходимый для инициализации кластера.
Тут происходит установка всех модулей, необходимых для настройки кластера K8s
## Описание
Requirements
------------
Данная роль предназначена для базовой настройки и инициализации кластера Kubernetes. В рамках выполнения роли:
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
1. Обновляются и очищаются пакеты системы.
2. Удаляются старые репозитории и GPG-ключи Kubernetes и CRI-O.
3. Отключается swap.
4. Загружаются необходимые модули ядра и включается пересылка IPv4-трафика.
5. Устанавливаются базовые пакеты и инструменты для работы с Kubernetes.
6. Добавляются репозитории и GPG-ключи Kubernetes и CRI-O.
7. Устанавливаются `kubelet`, `kubeadm`, `kubectl`, а также `cri-o`.
8. Включается и запускается служба `cri-o`.
Role Variables
--------------
## Требования
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
- Поддерживаемая версия ОС: Debian/Ubuntu
- Ansible с правами `root` (например, через `become: yes`)
Dependencies
------------
## Переменные роли
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
| Переменная | Значение по умолчанию |
|---------------|--------------------|
| `k8s_version` | `v1.31` |
| `crio_version` | `v1.30` |
## Зависимости
Данная роль не имеет зависимостей от других ролей.
## Пример Playbook
Пример использования роли в Playbook:
```yaml
- hosts: all
become: yes
roles:
- common-kubernetes
```
## Автор
Автор: [Юрий Обрезков]

View File

@ -1,20 +1,45 @@
Role Name
=========
# Роль Ansible: Инициализация мастер-ноды K8s
Здесь производится инициализация мастер ноды.
## Описание
Requirements
------------
Данная роль предназначена для настройки и инициализации мастер-ноды в кластере Kubernetes. В рамках выполнения роли:
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
1. Инициализируется мастер-узел Kubernetes с заданными параметрами.
2. Создается директория `.kube` для хранения конфигурации Kubernetes.
3. Копируется конфигурационный файл `kubeconfig` в домашний каталог пользователя.
4. Устанавливаются корректные права доступа для `kubeconfig`.
5. Устанавливается сетевой аддон Flannel.
Role Variables
--------------
## Требования
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
- Поддерживаемая версия ОС: Debian/Ubuntu
- Ansible с правами `root` (например, через `become: yes`)
Dependencies
------------
## Переменные роли
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
-------------
| Переменная | Значение по умолчанию |
|-------------------|--------------------|
| `cidr_network` | `10.244.0.0/16` |
| `host_ip_address` | `192.168.2.34` |
| `ansible_user_dir` | `/home/user` |
| `ansible_user_id` | `1000` |
| `ansible_user_gid` | `1000` |
## Зависимости
Данная роль не имеет зависимостей от других ролей.
## Пример Playbook
Пример использования роли в Playbook:
```yaml
- hosts: all
become: yes
roles:
- kubernetes-master
```
## Автор
Автор: [Юрий обрезков]

View File

@ -1,20 +1,35 @@
Role Name
=========
# Роль Ansible: Инициализация worker-ноды K8s
Здесь воркер присоединяется к кластеру с помощью токена присоединения, который достаётся из мастеры ноды. Для каждого кластера рекомендуется использовать группировку по [master] [worker], а так же самим указывать необходимые значения (как минимум креды)
## Описание
Requirements
------------
Данная роль предназначена для присоединения worker-узлов к кластеру Kubernetes. В рамках выполнения роли:
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
1. Генерируется токен присоединения на мастер-ноде.
2. Токен передается в worker-ноды.
3. Проверяется, был ли узел уже добавлен в кластер.
4. Выполняется присоединение worker-ноды к кластеру.
Role Variables
--------------
## Требования
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
- Поддерживаемая версия ОС: Debian/Ubuntu
- Ansible с правами `root` (например, через `become: yes`)
- Группировка хостов в `inventory` по `[master]` и `[worker]`
Dependencies
------------
## Зависимости
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Данная роль не имеет зависимостей от других ролей.
## Пример Playbook
Пример использования роли в Playbook:
```yaml
- hosts: workers
become: yes
roles:
- kubernetes-worker
```
## Автор
Автор: [Юрий Обрезков]