Ansible Ansible.builtin.expect |要求:PEEXPECT

Ansible Ansible.builtin.expect |要求:PEEXPECT,ansible,pexpect,Ansible,Pexpect,目前,我正在尝试使用ansible.builtin.expect 以下是我的用例: - name: Set password for built-in user expect: command: '/usr/share/elasticsearch/bin/elasticsearch-keystore add "bootstrap.password" -f' responses: Enter value for bootstrap.password: 'tes

目前,我正在尝试使用ansible.builtin.expect

以下是我的用例:

- name: Set password for built-in user
    expect: command: '/usr/share/elasticsearch/bin/elasticsearch-keystore add "bootstrap.password" -f' 
    responses: Enter value for bootstrap.password: 'test'
要使用ansible.builtin.expect,我必须安装:

python>=2.6

p预期>=3.3

我已经安装了Python2.7.5,但是如果我想安装pexpect,它只安装2.3版

要安装pexpect,我使用:

- name: Install pexpect module
  yum:
    name: pexpect
    state: latest

有人知道我是如何安装pexpect 3.3版的吗?

类似的东西可能是:

- name: 'install pexpect'
  become: true
  become_user: 'root'
  yum:
    name: '{{ item }}'
    state: present
    enablerepo: 'standard'
  with_items:
    - 'pexpect'

为什么不直接安装符合您要求的pip版本:

-名称:通过pip安装pexpect
变成:真的
pip:
名称:“pexpect>=3.3”
国家:现在

谢谢您的回答!此尝试的错误是:“找不到存储库标准”。您应该检查哪些yum repos可用,哪些包含pexpect。ie:查看您的
/etc/yum/repos.conf
yum--enablerepo=rhel7u6列表| grep pexpect
谢谢,很简单!