ansible为服务器集群装python包

一、ansible.cfg
[defaults]
inventory = inventories/python3.7.9
remote_user = 用户名
private_key_file = /Users/用户名/用户名.private_key
host_key_checking = False
remote_port=22
callback_whitelist = profile_tasks
strategy_plugins = /usr/用户名/mitogen-master/ansible_mitogen/plugins/strategy
strategy=mitogen_linear
forks=30
[ssh_connection]
ssh_args = -F ssh.cfg
二、ssh.cfg
Host *
ProxyCommand /usr/local/bin/ncat --proxy 代理地址:8080 --proxy-type http %h %p

本文介绍了如何通过Ansible配置文件 ansible.cfg、ssh.cfg,定义roles和inventories,特别是main.yml和hosts,以及deploy.yml,来实现一键为服务器集群安装Python软件包。通过这种方式,可以高效地管理和更新大规模服务器环境中的Python依赖。
订阅专栏 解锁全文
104

被折叠的 条评论
为什么被折叠?



