RobinBa
RobinBa

Reputation: 25

Ansible ansible.builtin.expect | requirement: pexpect

Currently, I am trying to use the ansible.builtin.expect.

Here is my usecase:

- 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'

To use ansible.builtin.expect I have to install:

python >= 2.6

pexpect >= 3.3

I have Python 2.7.5 installed, but if i want to install pexpect, it only installs version 2.3.

To install pexpect i use:

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

Does anyone know, how I am able to install pexpect version 3.3?

Upvotes: 2

Views: 1759

Answers (2)

Zeitounator
Zeitounator

Reputation: 44809

Why not installing directly the pip version matching your requirement:

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

Upvotes: 1

The HCD
The HCD

Reputation: 510

something like this maybe:

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

Upvotes: 0

Related Questions