2017-09-18 15 views
-1

私はAWSクラウド上にRed Hatマシンを持っています。私はAnsible and Dockerをインストールしました(コミュニティ版はRed Hatにはインストールできません)。今私はドッカーが機能するかどうかを確認するための単純なコマンドをrunnigています:Red HatのDocker実験版

ansible local -m shell -a "docker pull hello-world" 

私は次のエラーを取得しています:

localhost | FAILED | rc=1 >>

Using default tag: latest

Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon. Is the docker daemon running on this host?). Using system default: https://index.docker.io/v1/Cannot connect to the Docker daemon. Is the docker daemon running on this host?

私は

sudo ansible local -m shell -a "docker pull hello-world" 
localhost | UNREACHABLE! => { 
     "changed": false, 
     "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).\r\n", 
     "unreachable": true 
} 

を使用するとき、私は持っています私はこの問題に直面しているDockerとの間に正常に動作します。私が紛失しているものや、Dockerの実験版のセットアップが必要なものはありますか?

+0

この 'ansibleローカル-s -mシェル-a「ドッキングウィンドウプルこんにちは世界」' –

+0

おかげでその作業をしてみ-sフラグを追加することによって行うことができます –

答えて

2

あなたはsudoを使って実行するのではなく、sudoを使ってコマンドを実行する必要があることを確信しています。それは予想通り

ansible local -s -m shell -a "docker pull hello-world" 
関連する問題