From cc31c6f414d51b1cd6b7f2d7228d635a2e23895b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BE=D0=BB=D0=B3=D0=B8=D0=B9=20=D0=90=D1=80=D1=82?= =?UTF-8?q?=D1=91=D0=BC?= Date: Fri, 11 Aug 2023 14:50:14 +0300 Subject: [PATCH] add check dc play --- ansible_deploy_dc/check_primary_dc.yml | 61 ++ ansible_deploy_dc/deploy_dc.yml | 33 - ansible_deploy_dc/deploy_primary_dc.yml | 101 +++ ansible_deploy_dc/facts.yml | 1008 +++++++++++++++++++++++ ansible_deploy_dc/vars.yml | 31 +- 5 files changed, 1200 insertions(+), 34 deletions(-) create mode 100644 ansible_deploy_dc/check_primary_dc.yml delete mode 100644 ansible_deploy_dc/deploy_dc.yml create mode 100644 ansible_deploy_dc/deploy_primary_dc.yml create mode 100644 ansible_deploy_dc/facts.yml diff --git a/ansible_deploy_dc/check_primary_dc.yml b/ansible_deploy_dc/check_primary_dc.yml new file mode 100644 index 0000000..eb02942 --- /dev/null +++ b/ansible_deploy_dc/check_primary_dc.yml @@ -0,0 +1,61 @@ +--- + +- name: Проверка состояния контроллера домена + hosts: dctest + vars_files: + - vars.yml + + tasks: + - name: Проверка наличия развёрнутого домена на хосте {{ ansible_hostname }} + ansible.builtin.shell: "samba-tool domain info {{ ansible_default_ipv4.address }}" + register: samba_tool_result + + - name: Информация о домене + ansible.builtin.debug: + var: samba_tool_result.stdout_lines + + - name: Получение настройки резолвера + ansible.builtin.shell: "cat /etc/resolv.conf" + register: resolv_conf_result + - name: Вывод /etc/resolv.conf + ansible.builtin.debug: + var: resolv_conf_result.stdout_lines + + - name: Записи служб DNS. Kerberos + ansible.builtin.shell: "host -t SRV _kerberos._udp.{{ dc_details.realm }}" + register: srv_kerberos + - name: SRV запись Kerberos + ansible.builtin.debug: + var: srv_kerberos.stdout_lines + + - name: Записи служб DNS. LDAP + ansible.builtin.shell: "host -t SRV _ldap._tcp.{{ dc_details.realm }}" + register: srv_ldap + - name: SRV запись LDAP + ansible.builtin.debug: + var: srv_ldap.stdout_lines + + - name: Записи служб DNS. A запись + ansible.builtin.shell: "host {{ ansible_hostname }}.{{ dc_details.realm }}" + register: a_line + - name: A запись домена + ansible.builtin.debug: + var: a_line.stdout_lines + + - name: Проверка возможности авторизации Kerberos + ansible.builtin.expect: + command: "kinit {{ dc_details.admin }}" + responses: + # "Password for {{ dc_details.admin }}@{{ dc_details.realm_u }}:": "{{ dc_details.adminpass }}" + "Password for .*:": "{{ dc_details.adminpass }}" + # you don't want to show passwords in your logs + #no_log: true + echo: true + timeout: 5 + + - name: Текущие билеты Kerberos + ansible.builtin.shell: "klist" + register: klist + - name: Вывод билета Kerberos + ansible.builtin.debug: + var: klist.stdout_lines diff --git a/ansible_deploy_dc/deploy_dc.yml b/ansible_deploy_dc/deploy_dc.yml deleted file mode 100644 index 8d86235..0000000 --- a/ansible_deploy_dc/deploy_dc.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- - -- name: Разворачивание контроллера домена - hosts: dctest - vars_files: - - vars.yml - - tasks: - - name: Обновление системы - apt_rpm: - update_cache: true - dist_upgrade: true - clean: true - - - name: Установка пакетов {{ packages }} - apt_rpm: - package: "{{ item }}" - state: present - update_cache: yes - loop: "{{ packages }}" - - - name: Разрешить подключение клиентов для синхронизации времени - ansible.builtin.lineinfile: - path: /etc/chrony.conf - line: allow all - create: yes - - - name: Включение службы синхронизации времени chrony - systemd: - name: chronyd - enabled: yes - state: restarted - masked: no \ No newline at end of file diff --git a/ansible_deploy_dc/deploy_primary_dc.yml b/ansible_deploy_dc/deploy_primary_dc.yml new file mode 100644 index 0000000..86b8376 --- /dev/null +++ b/ansible_deploy_dc/deploy_primary_dc.yml @@ -0,0 +1,101 @@ +--- + +- name: Разворачивание контроллера домена + hosts: dctest + vars_files: + - vars.yml + + 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: Установка пакетов {{ packages }} + apt_rpm: + package: "{{ item }}" + state: present + update_cache: yes + loop: "{{ packages }}" + + - name: Разрешить подключение клиентов для синхронизации времени + ansible.builtin.lineinfile: + path: /etc/chrony.conf + line: allow all + create: yes + + - name: Включение службы синхронизации времени chrony + ansible.builtin.systemd: + name: chronyd + enabled: true + state: restarted + masked: false + + - name: Отключение служб, которые будут конфликтовать с контроллером + ansible.builtin.systemd: + name: "{{ item }}" + enabled: false + state: stopped + loop: "{{ stop_daemons }}" + ignore_errors: yes + + - name: Удалить старую конфигурацию Samba + ansible.builtin.file: + path: "{{ item }}" + state: absent + force: true + loop: "{{ old_config_to_remove }}" + + - name: Создать каталог для хранения групповых политик + ansible.builtin.file: + path: "{{ gp_folder }}" + state: directory + mode: '0755' + + - name: Настройка резолвера на 127.0.0.1 + ansible.builtin.lineinfile: + path: /etc/resolvconf.conf + regexp: '^name_servers' + line: name_servers=127.0.0.1 + + - name: Обновление конфигурации резолвера + ansible.builtin.shell: "resolvconf -u" + + - name: Разворачивание первого контроллера домена + ansible.builtin.shell: | + samba-tool domain provision --realm={{ dc_details.realm }} --domain={{ dc_details.domain }} \ + --adminpass='{{ dc_details.adminpass }}' --dns-backend=SAMBA_INTERNAL \ + --option="dns forwarder={{ dc_details.dns_forwarder }}" --server-role=dc --use-rfc2307 + register: dc_provision_output + - ansible.builtin.debug: + msg: dc_provision_output + + - name: Включение службы {{ samba_service }} + ansible.builtin.systemd: + name: "{{ samba_service }}" + enabled: true + state: restarted + masked: false + + - name: Копирование конфигурации Kerberos + ansible.builtin.copy: + remote_src: true + src: /var/lib/samba/private/krb5.conf + dest: /etc/krb5.conf diff --git a/ansible_deploy_dc/facts.yml b/ansible_deploy_dc/facts.yml new file mode 100644 index 0000000..c754833 --- /dev/null +++ b/ansible_deploy_dc/facts.yml @@ -0,0 +1,1008 @@ +dctest | SUCCESS => { + "ansible_facts": { + "ansible_all_ipv4_addresses": [ + "192.168.13.139" + ], + "ansible_all_ipv6_addresses": [ + "fe80::f060:8eff:fed2:c8ce" + ], + "ansible_apparmor": { + "status": "disabled" + }, + "ansible_architecture": "x86_64", + "ansible_bios_date": "04/01/2014", + "ansible_bios_version": "rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org", + "ansible_cmdline": { + "BOOT_IMAGE": "/boot/vmlinuz", + "panic": "30", + "resume": "/dev/disk/by-uuid/cf4246e4-0296-4d52-9e40-6dcbb85214e2", + "ro": true, + "root": "UUID=ee3114c1-18ec-423e-8c66-ee7cc24b1df4", + "splash": true + }, + "ansible_date_time": { + "date": "2023-08-11", + "day": "11", + "epoch": "1691739591", + "hour": "10", + "iso8601": "2023-08-11T07:39:51Z", + "iso8601_basic": "20230811T103951846939", + "iso8601_basic_short": "20230811T103951", + "iso8601_micro": "2023-08-11T07:39:51.846939Z", + "minute": "39", + "month": "08", + "second": "51", + "time": "10:39:51", + "tz": "MSK", + "tz_offset": "+0300", + "weekday": "Пятница", + "weekday_number": "5", + "weeknumber": "32", + "year": "2023" + }, + "ansible_default_ipv4": { + "address": "192.168.13.139", + "alias": "ens18", + "broadcast": "192.168.13.255", + "gateway": "192.168.13.1", + "interface": "ens18", + "macaddress": "f2:60:8e:d2:c8:ce", + "mtu": 1500, + "netmask": "255.255.255.0", + "network": "192.168.13.0", + "type": "ether" + }, + "ansible_default_ipv6": {}, + "ansible_device_links": { + "ids": { + "sda": [ + "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0" + ], + "sda1": [ + "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part1" + ], + "sda2": [ + "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part2" + ], + "sr0": [ + "ata-QEMU_DVD-ROM_QM00003", + "scsi-0QEMU_QEMU_DVD-ROM_QM00003", + "scsi-1ATA_QEMU_DVD-ROM_QM00003" + ] + }, + "labels": {}, + "masters": {}, + "uuids": { + "sda1": [ + "cf4246e4-0296-4d52-9e40-6dcbb85214e2" + ], + "sda2": [ + "ee3114c1-18ec-423e-8c66-ee7cc24b1df4" + ] + } + }, + "ansible_devices": { + "loop0": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "1", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "mq-deadline", + "sectors": "0", + "sectorsize": "512", + "size": "0.00 Bytes", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "loop1": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "1", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "mq-deadline", + "sectors": "0", + "sectorsize": "512", + "size": "0.00 Bytes", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "loop2": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "1", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "mq-deadline", + "sectors": "0", + "sectorsize": "512", + "size": "0.00 Bytes", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "loop3": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "1", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "mq-deadline", + "sectors": "0", + "sectorsize": "512", + "size": "0.00 Bytes", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "loop4": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "1", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "mq-deadline", + "sectors": "0", + "sectorsize": "512", + "size": "0.00 Bytes", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "loop5": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "1", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "mq-deadline", + "sectors": "0", + "sectorsize": "512", + "size": "0.00 Bytes", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "loop6": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "1", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "mq-deadline", + "sectors": "0", + "sectorsize": "512", + "size": "0.00 Bytes", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "loop7": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "1", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "mq-deadline", + "sectors": "0", + "sectorsize": "512", + "size": "0.00 Bytes", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram0": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram1": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram10": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram11": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram12": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram13": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram14": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram15": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram2": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram3": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram4": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram5": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram6": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram7": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram8": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "ram9": { + "holders": [], + "host": "", + "links": { + "ids": [], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": null, + "partitions": {}, + "removable": "0", + "rotational": "0", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "", + "sectors": "32768", + "sectorsize": "512", + "size": "16.00 MB", + "support_discard": "0", + "vendor": null, + "virtual": 1 + }, + "sda": { + "holders": [], + "host": "SCSI storage controller: Red Hat, Inc. Virtio SCSI", + "links": { + "ids": [ + "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0" + ], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": "QEMU HARDDISK", + "partitions": { + "sda1": { + "holders": [], + "links": { + "ids": [ + "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part1" + ], + "labels": [], + "masters": [], + "uuids": [ + "cf4246e4-0296-4d52-9e40-6dcbb85214e2" + ] + }, + "sectors": "1011712", + "sectorsize": 512, + "size": "494.00 MB", + "start": "2048", + "uuid": "cf4246e4-0296-4d52-9e40-6dcbb85214e2" + }, + "sda2": { + "holders": [], + "links": { + "ids": [ + "scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part2" + ], + "labels": [], + "masters": [], + "uuids": [ + "ee3114c1-18ec-423e-8c66-ee7cc24b1df4" + ] + }, + "sectors": "66093056", + "sectorsize": 512, + "size": "31.52 GB", + "start": "1013760", + "uuid": "ee3114c1-18ec-423e-8c66-ee7cc24b1df4" + } + }, + "removable": "0", + "rotational": "1", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "none", + "sectors": "67108864", + "sectorsize": "512", + "size": "32.00 GB", + "support_discard": "4096", + "vendor": "QEMU", + "virtual": 1 + }, + "sr0": { + "holders": [], + "host": "IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]", + "links": { + "ids": [ + "ata-QEMU_DVD-ROM_QM00003", + "scsi-0QEMU_QEMU_DVD-ROM_QM00003", + "scsi-1ATA_QEMU_DVD-ROM_QM00003" + ], + "labels": [], + "masters": [], + "uuids": [] + }, + "model": "QEMU DVD-ROM", + "partitions": {}, + "removable": "1", + "rotational": "1", + "sas_address": null, + "sas_device_handle": null, + "scheduler_mode": "mq-deadline", + "sectors": "2097151", + "sectorsize": "512", + "size": "1024.00 MB", + "support_discard": "0", + "vendor": "QEMU", + "virtual": 1 + } + }, + "ansible_distribution": "Altlinux", + "ansible_distribution_file_parsed": true, + "ansible_distribution_file_path": "/etc/altlinux-release", + "ansible_distribution_file_search_string": "ALT", + "ansible_distribution_file_variety": "Altlinux", + "ansible_distribution_major_version": "10", + "ansible_distribution_release": "Mendelevium", + "ansible_distribution_version": "10.1", + "ansible_dns": { + "nameservers": [ + "192.168.13.26" + ], + "search": [ + "dav.lan" + ] + }, + "ansible_domain": "alt.lan", + "ansible_effective_group_id": 0, + "ansible_effective_user_id": 0, + "ansible_ens18": { + "active": true, + "device": "ens18", + "ipv4": { + "address": "192.168.13.139", + "broadcast": "192.168.13.255", + "netmask": "255.255.255.0", + "network": "192.168.13.0" + }, + "ipv6": [ + { + "address": "fe80::f060:8eff:fed2:c8ce", + "prefix": "64", + "scope": "link" + } + ], + "macaddress": "f2:60:8e:d2:c8:ce", + "module": "virtio_net", + "mtu": 1500, + "pciid": "virtio2", + "promisc": false, + "speed": -1, + "type": "ether" + }, + "ansible_env": { + "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/0/bus", + "ENV": "/root/.bashrc", + "HOME": "/root", + "INPUTRC": "/etc/inputrc", + "LANG": "ru_RU.UTF-8", + "LANGUAGE": "", + "LOGNAME": "root", + "MAIL": "/var/mail/root", + "PATH": "/root/bin:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin", + "PWD": "/root", + "SHELL": "/bin/bash", + "SHLVL": "2", + "SSH_CLIENT": "192.168.13.3 60856 22", + "SSH_CONNECTION": "192.168.13.3 60856 192.168.13.139 22", + "SSH_KEY_FINGERPRINT": "MD5:b9:01:61:24:88:34:e4:ab:76:13:ab:15:0d:4b:48:3a", + "SSH_TTY": "/dev/pts/1", + "TERM": "xterm-256color", + "TMP": "/tmp/.private/root", + "TMPDIR": "/tmp/.private/root", + "USER": "root", + "USERNAME": "root", + "XDG_RUNTIME_DIR": "/run/user/0", + "XDG_SESSION_CLASS": "user", + "XDG_SESSION_ID": "325", + "XDG_SESSION_TYPE": "tty", + "_": "/usr/bin/python3" + }, + "ansible_fibre_channel_wwn": [], + "ansible_fips": false, + "ansible_form_factor": "Other", + "ansible_fqdn": "dc.alt.lan", + "ansible_hostname": "dc", + "ansible_hostnqn": "", + "ansible_interfaces": [ + "ens18", + "lo" + ], + "ansible_is_chroot": false, + "ansible_iscsi_iqn": "", + "ansible_kernel": "5.10.166-std-def-alt1", + "ansible_kernel_version": "#1 SMP Thu Feb 9 11:47:41 UTC 2023", + "ansible_lo": { + "active": true, + "device": "lo", + "ipv4": { + "address": "127.0.0.1", + "broadcast": "", + "netmask": "255.0.0.0", + "network": "127.0.0.0" + }, + "ipv6": [ + { + "address": "::1", + "prefix": "128", + "scope": "host" + } + ], + "mtu": 65536, + "promisc": false, + "type": "loopback" + }, + "ansible_local": {}, + "ansible_lsb": { + "codename": "Mendelevium", + "description": "ALT Server 10.1 (Mendelevium)", + "id": "ALT", + "major_release": "10", + "release": "10.1" + }, + "ansible_lvm": { + "lvs": {}, + "pvs": {}, + "vgs": {} + }, + "ansible_machine": "x86_64", + "ansible_machine_id": "738f7cbbc32812362f4af6fc64d48fa9", + "ansible_memfree_mb": 91, + "ansible_memory_mb": { + "nocache": { + "free": 1761, + "used": 219 + }, + "real": { + "free": 91, + "total": 1980, + "used": 1889 + }, + "swap": { + "cached": 0, + "free": 493, + "total": 493, + "used": 0 + } + }, + "ansible_memtotal_mb": 1980, + "ansible_mounts": [ + { + "block_available": 6931389, + "block_size": 4096, + "block_total": 8086727, + "block_used": 1155338, + "device": "/dev/sda2", + "fstype": "ext4", + "inode_available": 2016064, + "inode_total": 2068528, + "inode_used": 52464, + "mount": "/", + "options": "rw,relatime", + "size_available": 28390969344, + "size_total": 33123233792, + "uuid": "ee3114c1-18ec-423e-8c66-ee7cc24b1df4" + } + ], + "ansible_nodename": "dc.alt.lan", + "ansible_os_family": "Altlinux", + "ansible_pkg_mgr": "apt_rpm", + "ansible_proc_cmdline": { + "BOOT_IMAGE": "/boot/vmlinuz", + "panic": "30", + "resume": "/dev/disk/by-uuid/cf4246e4-0296-4d52-9e40-6dcbb85214e2", + "ro": true, + "root": "UUID=ee3114c1-18ec-423e-8c66-ee7cc24b1df4", + "splash": true + }, + "ansible_processor": [ + "0", + "GenuineIntel", + "QEMU Virtual CPU version 2.5+", + "1", + "GenuineIntel", + "QEMU Virtual CPU version 2.5+" + ], + "ansible_processor_cores": 2, + "ansible_processor_count": 1, + "ansible_processor_threads_per_core": 1, + "ansible_processor_vcpus": 2, + "ansible_product_name": "Standard PC (i440FX + PIIX, 1996)", + "ansible_product_serial": "NA", + "ansible_product_uuid": "1ae5a9d4-50a1-4149-8070-355a9d31d3fa", + "ansible_product_version": "pc-i440fx-8.0", + "ansible_python": { + "executable": "/usr/bin/python3", + "has_sslcontext": true, + "type": "cpython", + "version": { + "major": 3, + "micro": 16, + "minor": 9, + "releaselevel": "final", + "serial": 0 + }, + "version_info": [ + 3, + 9, + 16, + "final", + 0 + ] + }, + "ansible_python_version": "3.9.16", + "ansible_real_group_id": 0, + "ansible_real_user_id": 0, + "ansible_selinux": { + "status": "Missing selinux Python library" + }, + "ansible_selinux_python_present": false, + "ansible_service_mgr": "systemd", + "ansible_ssh_host_key_dsa_public": "AAAAB3NzaC1kc3MAAACBAMAVdMNI+YbQIKJ3JZQ+2+DV4nbT7X8J138SE1y1qlS4wukxh+sIkx0P6zCtGB3RZzEaCf28pJsadohK28cNWlOff+30hTIaw/YUgwVNliTvv+8Tc6225Kl+xtOFqE6LeEQ+pAlDWUJ2NT41pQTWzxlt7Zvn7vT/mciAVJB0PlNHAAAAFQC3rm5LQeHrshWQfHKA25HlJE/aCQAAAIEAl76AjBjOkNRqAtZOErX81wvT+Unw/adesjWJX9pWR/QOx7qRSTgfrFI12hMNsiodE7h42wOMESQRw8b5ItsJyeZ5p/2VoM+FrgJI0+SFYFUMFg2kBXthR2EeZSK25YJ3W2ntmYU8rOI+cvAKwh2sWd1O8/LBZVrqSLa4OXa2gu0AAACAEKMTvEafkgcJ5lBvQisshiUhaEsiZYLiEESvfuJ/wtalhweWXcb0wAHugRH7crCeCU5cY/nr/5lfdnaBWKdMiOof285fRoSI2kPYCHcXFSnjfMWF9Tzbqaip80Q5HBHcWocM8H3+424HMiiDGK9iVYoWfQIfS/Kw2ckp37+z2IQ=", + "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBKH/7cXRLPaK3yBRFaUV2Y9qUlLnQuCz2KoHj1HavRYZ7HVBgt9FqcJK45JXWppl9tz1DY+CSCUM30yGQAB8Iw=", + "ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIHBdXohsJ1CaZSGbTZgVjW1mjfcVY8qPP/vvzsyq2HGo", + "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQC0qIpHueqQS84Qel5al1U4pXr2oKIvMh0JsJ8QkD8C9165DgwjMaWj5+ckV9REw0iMsoW5bHXbOs14oYjywqnCyvugXT5YHeQjTcX4Ihfi/+aYA7ZfpAIiozkgm6ptzA+kP39YIvWoHzO3AOLaMVd4nHOBvtNJqRw5o4nnMgz5Xkceko1MIEOC5iSsbNbbauk4W3Y8LzPVFDoFsn6He+KFKtHjd5MDTxEIrB0Dp/+NQWtV7RxwKBMNjAx66PaDYSJdC3jerDy4s9Q3bQeRgMTacS18mVogg+OHEE4d+TOex5L1d4vHj4MH7BTBmdi0LXneOXpzMw4FLgn6le8wbj3L", + "ansible_swapfree_mb": 493, + "ansible_swaptotal_mb": 493, + "ansible_system": "Linux", + "ansible_system_capabilities": [ + "cap_chown", + "cap_dac_override", + "cap_dac_read_search", + "cap_fowner", + "cap_fsetid", + "cap_kill", + "cap_setgid", + "cap_setuid", + "cap_setpcap", + "cap_linux_immutable", + "cap_net_bind_service", + "cap_net_broadcast", + "cap_net_admin", + "cap_net_raw", + "cap_ipc_lock", + "cap_ipc_owner", + "cap_sys_module", + "cap_sys_rawio", + "cap_sys_chroot", + "cap_sys_ptrace", + "cap_sys_pacct", + "cap_sys_admin", + "cap_sys_boot", + "cap_sys_nice", + "cap_sys_resource", + "cap_sys_time", + "cap_sys_tty_config", + "cap_mknod", + "cap_lease", + "cap_audit_write", + "cap_audit_control", + "cap_setfcap", + "cap_mac_override", + "cap_mac_admin", + "cap_syslog", + "cap_wake_alarm", + "cap_block_suspend", + "cap_audit_read", + "38", + "39", + "40+ep" + ], + "ansible_system_capabilities_enforced": "True", + "ansible_system_vendor": "QEMU", + "ansible_uptime_seconds": 78154, + "ansible_user_dir": "/root", + "ansible_user_gecos": "System Administrator", + "ansible_user_gid": 0, + "ansible_user_id": "root", + "ansible_user_shell": "/bin/bash", + "ansible_user_uid": 0, + "ansible_userspace_architecture": "x86_64", + "ansible_userspace_bits": "64", + "ansible_virtualization_role": "guest", + "ansible_virtualization_type": "kvm", + "discovered_interpreter_python": "/usr/bin/python3", + "gather_subset": [ + "all" + ], + "module_setup": true + }, + "changed": false +} diff --git a/ansible_deploy_dc/vars.yml b/ansible_deploy_dc/vars.yml index 5443c9e..55e1643 100644 --- a/ansible_deploy_dc/vars.yml +++ b/ansible_deploy_dc/vars.yml @@ -1,3 +1,32 @@ packages: - task-samba-dc - - chrony \ No newline at end of file + - chrony + - bind-utils + - python3-module-pexpect + +stop_daemons: + - smb + - nmb + - krb5kdc + - slapd + - bind + +old_config_to_remove: + - /etc/samba/smb.conf + - /var/lib/samba + - /var/cache/samba + +folder_for_gp: + - /var/lib/samba/sysvol + +gp_folder: /var/lib/samba/sysvol + +dc_details: + realm: alt.lan + realm_u: ALT.LAN + domain: alt + admin: administrator + adminpass: P@ssw0rd + dns_forwarder: 77.88.8.8 + +samba_service: samba