2017-05-08 1 views
1

私はシステムを展開するために使用しようとしています。私はYMLファイル内のモジュールを期待して使用し、それを実行するためにansible-playbookを使って試してみて、このエラーを得た:私は、可能なモジュールを使用するとき、私はこのメッセージを受け取りました:pexpectのpythonモジュールが必要です

fatal: [192.168.100.132]: FAILED! => {"changed": false, "failed": true, "msg": "The pexpect python module is required"}

その後、私はpypi.python.orgからpexpect-4.2.1パッケージをダウンロードし、Pythonのセットアップ」してインストールします。 py install "をクリックします。 しかし、それは動作せず、エラーは決して変更されません。 エラーを処理するにはどうすればよいですか?

YMLファイルからいくつかのコード:

- name: auth root 
    expect: 
    command: mysql_secure_installation 
    responses: 
     'Enter password for user root:': '{{password.stdout}}' 
     'New password:': 'dtise123' 
     'Re-enter new password:': 'dtise123' 
     'Do you wish to continue with the password provided\?\(Press y\|Y for Yes, any other key for No\) :': 'y' 
     'Remove anonymous users\? \(Press y\|Y for Yes, any other key for No\) :': 'y' 
     'Disallow root login remotely\? \(Press y\|Y for Yes, any other key for No\) :': 'y' 
     'Remove test database and access to it\? \(Press y\|Y for Yes, any other key for No\) :': 'y' 
     'Reload privilege tables now\? \(Press y\|Y for Yes, any other key for No\) :': 'y' 
    echo: yes 

私はpypi.python.orgからpexpect-4.2.1.tar.gzをダウンロードして、次のように行った:

mv pexpect-4.2.1.tar.gz /usr/local/src/ 
cd /usr/local/src 
tar zxvf pexpect-4.2.1.tar.gz 
cd pexpect-4.2.1 
python setup.py install 
+0

pexpectはどこにインストールしましたか? – techraf

+0

私は質問の答えを追加しました。私を助けてください! –

+0

私はどこに尋ねられたのですか、私はどのマシンであるのかを知りました。 – techraf

答えて

2

I installed it [pexpect] on the Ansible host. Do I need to install it on each node machine?

はい、モジュールはターゲットマシン上で実行され、前提条件(存在する場合)がインストールされている必要があります。

+0

ありがとうございました。ターゲットマシンにpexpectとptyprocessをインストールすると、実際に動作します! –

関連する問題