alt_vkr/ansible/08_nas.yml

36 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
- name: Настройка файлового сервера
hosts: nas
tasks:
- name: Проверка соответствия ОС
ansible.builtin.fail:
msg: Операционная система должна быть Альт
when: ansible_os_family != "Altlinux"
- name: Проверка наличия развёрнутого домена на хосте {{ ansible_hostname }}
ansible.builtin.shell: "samba-tool domain info {{ ansible_default_ipv4.address }}"
register: samba_tool_result
ignore_errors: yes
- name: Если на хосте развёрнут домен, выполнение прерывается
ansible.builtin.fail:
msg: На хосте {{ ansible_hostname }} обнаружен развёрнутый домен. Прерываю выполнение
when:
- samba_tool_result.failed == false
- name: Обновление системы
apt_rpm:
update_cache: true
dist_upgrade: true
clean: true
- name: Назначение корректного имени хоста
ansible.builtin.hostname:
name: "{{ hostnames.dc1_host }}.{{ dc_details.realm }}"
use: systemd
###################
https://www.altlinux.org/Samba/Fileserver/AD-auth
###################