moogle
V2EX  ›  问与答

osx 使用 localhost 调试 docker 模块时如果使用本地 hosts 文件出现错误的问题

  •  
  •   moogle · May 31, 2017 · 2120 views
    This topic created in 3269 days ago, the information mentioned may be changed or developed.

    系统为 OSX。

    如果在 playbook 里写 hosts: localhost,不设置 ansible.cfg 和本地的 hosts 文件,就可以正常使用 docker 模块。以下是-vvvv 输出结果:

    changed: [localhost] => {
    
        "ansible_facts": {
        
            "docker_containers": [
            
    省略
    
        "msg": "started 1 container, created 1 container.",
        
        "reload_reasons": null,
        
        "summary": {
    
    省略
    
    }
    

    如果在本地 hosts 文件里写明 localhost ansible_connection=local,就会出现如下问题:

        "msg": "`docker-py` doesn't seem to be installed, but is required for the Ansible Docker module."
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5651 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 52ms · UTC 07:31 · PVG 15:31 · LAX 00:31 · JFK 03:31
    ♥ Do have faith in what you're doing.