Update README.md

This commit is contained in:
NewName
2024-08-14 03:05:58 +08:00
parent b40f833830
commit ceff215c74

View File

@@ -117,9 +117,9 @@ sudo apt install ansible -y
### 2禁用被控主机密钥检查 ### 2禁用被控主机密钥检查
``` ```
sudo nano /etc/ansible/ansible.cfg sudo mkdir -p /etc/ansible && sudo touch /etc/ansible/ansible.cfg && cd /etc/ansible
``` ```
添加以下配置 `ansible.cfg`添加以下配置
``` ```
[defaults] [defaults]
host_key_checking = False host_key_checking = False
@@ -131,10 +131,10 @@ ansible_ssh_common_args = '-o StrictHostKeyChecking=no'
创建配置文件 创建配置文件
``` ```
touch /etc/ansible/hosts && cd /etc/ansible touch hosts
``` ```
编辑`/etc/ansible/hosts`文件,添加目标主机示例 添加目标主机示例
``` ```
[myservers] [myservers]
1 ansible_host=192.168.1.1 ansible_user=root ansible_port=22 ansible_ssh_pass=password1 1 ansible_host=192.168.1.1 ansible_user=root ansible_port=22 ansible_ssh_pass=password1