Настройка глобального файла конфигурации Ansible
Отключить подтверждение подключения к новым серверам:
sudo sed -i 's/#host_key_checking = False/host_key_checking = False/g' /etc/ansible/ansible.cfg
vim /etc/ansible/ansible.cfg
[defaults]
host_key_checking = false
Настройка глобального файла Inventory для Linux серверов
vim /etc/ansible/hosts
[unix_servers]
Ubuntu1 ansible_host=<IP> ansible_user=ubuntu ansible_ssh_private_key_file=/home/ec2-user/.ssh/aws.note.kx_private.pem
Настройка глобального файла Inventory для Windows серверов
vim /etc/ansible/hosts
[win_servers]
WinSrv2012R2 ansible_host=<IP>
[win_servers:vars]
ansible_user = Administrator
ansible_password = <pass>
ansible_port = 5986
ansible_connection = winrm
ansible_winrm_server_cert_validation = ignore
Требования к Linux клиенту:
Требования к Windows клиенту:
Избавление от warning интерпретатора Python
Текст ошибок:
[WARNING]:
Platform linux on host 'hostname' is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this.
See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
[DEPRECATION WARNING]:
Distribution Ubuntu 18.04 on host 'hostname' should use /usr/bin/python3, but is using /usr/bin/python for backward compatibility with prior Ansible releases.
A future Ansible release will default to using the discovered platform python for this host.
See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
This feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
Инструкции по устранению Warning сообщений
vim ~/ansible/ansible.cfg
interpreter_python = auto_silent