2017-05-08 20 views
1

我想用我們的系統來部署我們的系統。我曾經期望在陽明文件模塊,並嘗試使用ansible-playbook運行它,並得到這個錯誤:當我使用可靠的模塊期望,我得到了這個味精:需要pyx模塊

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

然後我從pypi.python.org下載Pexpect的-4.2.1包,並通過「蟒蛇安裝程序安裝它。 py安裝「。 但它不起作用,錯誤從未改變。 我該怎麼處理這個錯誤?

從陽明文件中的一些代碼:

- 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時,它確實可行! –