微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ansible ansible.builtin.expect |要求:期待

如何解决ansible ansible.builtin.expect |要求:期待

目前,我正在尝试使用 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,我必须安装:

蟒蛇>= 2.6

预期 >= 3.3

我安装了 Python 2.7.5,但如果我想安装 pexpect,它只会安装 2.3 版。

要安装 pexpect,我使用:

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

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

解决方法

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

- name: Install pexpect throuhg pip
  become: true
  pip:
    name: "pexpect>=3.3"
    state: present
,

可能是这样的:

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。