推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
vegaoqiang
V2EX  ›  Python

有人知道 ansible setup 这个模块的原理吗?

  •  
  •   vegaoqiang · Jul 7, 2021 · 2385 views
    This topic created in 1915 days ago, the information mentioned may be changed or developed.

    源码看不大明白,使用这个模块能获取到目标服务器的详细信息,包括 cpu,内存,磁盘,网卡,用户等等几乎常见的信息,在 playbook 中指定 gather_facts=true 也能达到相同目的,ansible 没有 agent,如果是通过 ssh 连接到目标服务器再查看相关系统信息效率应该不高吧,再加上 python 执行效率本来就捉襟见肘,那么有没有什么不为人知的骚操作?

    4 replies  •  2021-07-07 16:39:05 +08:00
    julyclyde
        1
    julyclyde  
       Jul 7, 2021
    确实是效率不高啊
    为了“没有 agent”总要付出点代价的
    knightdf
        2
    knightdf  
       Jul 7, 2021
    这玩意不需要效率
    jorneyr
        3
    jorneyr  
       Jul 7, 2021
    Ansible 效率不高,我测试同时提交 99 个命令 (shell 里用 for),然后不停报错。
    zlowly
        4
    zlowly  
       Jul 7, 2021
    可以启用 Fact Cache 插件
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2452 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 371ms · UTC 14:18 · PVG 22:18 · LAX 07:18 · JFK 10:18
    ♥ Do have faith in what you're doing.