add deploy dc playbook
This commit is contained in:
5
ansible_deploy_dc/ansible.cfg
Normal file
5
ansible_deploy_dc/ansible.cfg
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[defaults]
|
||||||
|
host_key_checking = false
|
||||||
|
inventory = ./hosts.ini
|
||||||
|
#private_key_file = /home/sysadmin/.ssh/id_rsa
|
||||||
|
private_key_file = /home/da2001/.ssh/id_rsa
|
||||||
33
ansible_deploy_dc/deploy_dc.yml
Normal file
33
ansible_deploy_dc/deploy_dc.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- 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
|
||||||
9
ansible_deploy_dc/hosts.ini
Normal file
9
ansible_deploy_dc/hosts.ini
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[dc]
|
||||||
|
alts1 ansible_host=10.1.1.11 ansible_user=root
|
||||||
|
alts2 ansible_host=10.1.1.12 ansible_user=root
|
||||||
|
|
||||||
|
[nas]
|
||||||
|
alts3 ansible_host=10.1.1.13 ansible_user=root
|
||||||
|
|
||||||
|
[test]
|
||||||
|
dctest ansible_host=192.168.13.139 ansible_user=root
|
||||||
3
ansible_deploy_dc/vars.yml
Normal file
3
ansible_deploy_dc/vars.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
packages:
|
||||||
|
- task-samba-dc
|
||||||
|
- chrony
|
||||||
Reference in New Issue
Block a user