Skip to content

Commit

Permalink
ansible
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayZhu1024 committed Jul 11, 2024
1 parent e50a6ac commit 30059f6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ansible/1.ansible安装和常见模块.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,27 @@ ANSIBLE_CONFIG #环境变量,注意:指定目录下的ansible.cfg
./ansible.cfg   #当前目录下的ansible.cfg,一般一个项目对应一个专用配置文件,推荐使用
~/.ansible.cfg #当前用户家目录下的.ansible.cfg
/etc/ansible/ansible.cfg   #系统默认配置文件
```

Ansible 的默认配置文件 /etc/ansible/ansible.cfg ,其中大部分的配置内容无需进行修改

```bash
[defaults]
#inventory     = /etc/ansible/hosts #主机列表配置文件
#library = /usr/share/my_modules/ #库文件存放目录
#remote_tmp = $HOME/.ansible/tmp #临时py命令文件存放在远程主机目录
#local_tmp     = $HOME/.ansible/tmp #本机的临时命令执行目录
#forks         = 5   #默认并发数
#sudo_user     = root #默认sudo 用户
#ask_sudo_pass = True #每次执行ansible命令是否询问ssh密码
#ask_pass     = True  
#remote_port   = 22
#host_key_checking = False     #检查对应服务器的host_key,建议取消此行注释,实现第一次连接自动信任目标主机
#log_path=/var/log/ansible.log #日志文件,建议启用
#module_name = command   #默认模块,可以修改为shell模块
[privilege_escalation] #普通用户提权配置
#become=True
#become_method=sudo
#become_user=root
#become_ask_pass=False
```

0 comments on commit 30059f6

Please sign in to comment.