# Problem with a sh installation

**URL:** <https://forum.ansible.com/t/problem-with-a-sh-installation/31382>\
**Category:** Ansible Project\
**Created:** [September 27, 2019, 9:16pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382 "2019-09-27T21:16:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier\_Esparza](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Javier\_Esparza](https://forum.ansible.com/u/Javier_Esparza)\
**Post date:** [September 27, 2019, 9:16pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/1 "2019-09-27T21:16:50Z")

</div>

Hello, first i want to say that my english is not good, but i wll to try, i’m new in Ansible too, Y have create my first playbok with instalation of very programas that i need but… here comes the questions.

I want to install my printer with scan i have a script that do that but is not the same.  
this script, when proceed to install the program, show a blue screen with a confirmation, only what i have to do is press the enter key

But when i do it whit ansible don’t show me any blue screen with de question and only what the playbook do is thinking

Why???

Here comes my code.

That not Work…

> * * *
> 
> - hosts: all  
> gather\_facts: no  
> become: True  
> become\_method: sudo  
> become\_user: root  
> tasks:  
> ############## INSTALACION SCANNER #############################
> 
> - name: Descargamos el Tar.gz del Driver del Escaner  
> get\_url:  
> url: [https://ftp.hp.com/pub/softlib/software13/printers/SS/SL-C4010ND/uld\_V1.00.39\_01.17.tar.gz](https://ftp.hp.com/pub/softlib/software13/printers/SS/SL-C4010ND/uld_V1.00.39_01.17.tar.gz)  
> dest: /tmp/download-samsungScanner-driver.tar.gz
> 
> - name: Descomprimimos el Archivo Tar  
> unarchive:  
> src: /tmp/download-samsungScanner-driver.tar.gz  
> dest: /tmp/  
> remote\_src: yes
> 
> - name: Ejecutamos el script de instalacion del scanner  
> command: sh /tmp/uld/install-scanner.sh -y

Here comes the script that work’s

> #instalacion scanner  
> wget [https://ftp.hp.com/pub/softlib/software13/printers/SS/SL-C4010ND/uld\_V1.00.39\_01.17.tar.gz](https://ftp.hp.com/pub/softlib/software13/printers/SS/SL-C4010ND/uld_V1.00.39_01.17.tar.gz)  
> tar zxvf uld\_V1.00.39\_01.17.tar.gz  
> cd uld/  
> sh install-scanner.sh

Thanks a everybody

---

<div class="post-metadata">

**Author:** ![Alexis\_Gonzalo\_Alvar](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Alexis\_Gonzalo\_Alvar](https://forum.ansible.com/u/Alexis_Gonzalo_Alvar)\
**Post date:** [September 27, 2019, 9:27pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/2 "2019-09-27T21:27:32Z")

</div>

Do you have the mistake?

---

<div class="post-metadata">

**Author:** ![Javier\_Esparza](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Javier\_Esparza](https://forum.ansible.com/u/Javier_Esparza)\
**Post date:** [September 27, 2019, 9:35pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/3 "2019-09-27T21:35:47Z")

</div>

the playbook don’t show any error, only what it do is thinking or charging but don’t show nothing that’s the problem 😢

---

<div class="post-metadata">

**Author:** ![Alexis\_Gonzalo\_Alvar](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Alexis\_Gonzalo\_Alvar](https://forum.ansible.com/u/Alexis_Gonzalo_Alvar)\
**Post date:** [September 27, 2019, 9:38pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/4 "2019-09-27T21:38:04Z")

</div>

Can you take a screenshoot?

---

<div class="post-metadata">

**Author:** ![Javier\_Esparza](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Javier\_Esparza](https://forum.ansible.com/u/Javier_Esparza)\
**Post date:** [September 27, 2019, 9:48pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/5 "2019-09-27T21:48:27Z")

</div>

Here comes the screenshot

 ![ErrorAnsible.PNG](https://us1.discourse-cdn.com/ansible/original/2X/b/bedefa73889bd0ff740bec940edfb7bdb60b0d7e.png)

i let the playbook around 20 minutes and that do nothing

---

<div class="post-metadata">

**Author:** ![Alexis\_Gonzalo\_Alvar](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Alexis\_Gonzalo\_Alvar](https://forum.ansible.com/u/Alexis_Gonzalo_Alvar)\
**Post date:** [September 27, 2019, 9:53pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/6 "2019-09-27T21:53:45Z")

</div>

Tienes que esperar no más, no te queda de otra. Me ha pasado cuando estuve haciendo pruebas. Pero mientras que no salga en rojo no hay problema. Quizá es un archivo muy pesado.

---

<div class="post-metadata">

**Author:** ![Javier\_Esparza](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Javier\_Esparza](https://forum.ansible.com/u/Javier_Esparza)\
**Post date:** [September 27, 2019, 10:17pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/7 "2019-09-27T22:17:42Z")

</div>

Mi duda está que cuando ejecuto el script se demora un par de segundos eso sí me pide una validación en una pantalla azul que genera, en la cual solo presionó entrer y continúa la instalacion, entonces no sé cómo maneja ansible este tipo de validaciones.

---

<div class="post-metadata">

**Author:** ![Alexis\_Gonzalo\_Alvar](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Alexis\_Gonzalo\_Alvar](https://forum.ansible.com/u/Alexis_Gonzalo_Alvar)\
**Post date:** [September 27, 2019, 10:41pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/8 "2019-09-27T22:41:01Z")

</div>

De que se demora en ejecutar, eso es normal, pero tienes que encontrar una manera de que acepte esa validación sin necesidad de presionar enter o poner una clave.

---

<div class="post-metadata">

**Author:** ![Javier\_Esparza](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Javier\_Esparza](https://forum.ansible.com/u/Javier_Esparza)\
**Post date:** [September 27, 2019, 10:45pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/9 "2019-09-27T22:45:22Z")

</div>

Eso es lo que he buscado todo el día sin encontrar mucho ☹ por lo mismo decidí publicarlo en el foro para ver si alguien me podía ayudar

---

<div class="post-metadata">

**Author:** ![Alexis\_Gonzalo\_Alvar](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Alexis\_Gonzalo\_Alvar](https://forum.ansible.com/u/Alexis_Gonzalo_Alvar)\
**Post date:** [September 27, 2019, 10:46pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/10 "2019-09-27T22:46:53Z")

</div>

Qué es lo que está validando el playbook que presionas enter?

---

<div class="post-metadata">

**Author:** ![Mukul\_Malhotra](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Mukul\_Malhotra](https://forum.ansible.com/u/Mukul_Malhotra)\
**Post date:** [September 28, 2019, 5:46am UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/11 "2019-09-28T05:46:11Z")

</div>

you have to use the shell module instead of command module

---

<div class="post-metadata">

**Author:** ![Javier\_Esparza](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Javier\_Esparza](https://forum.ansible.com/u/Javier_Esparza)\
**Post date:** [September 28, 2019, 7:01pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/12 "2019-09-28T19:01:08Z")

</div>

Cuando se instala el fix del escaner te pregunta si quieres agregar al usuario a un grupo y te la opcion de aceptar solamente, presionas la tecla y prosigue con la instalación.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [September 28, 2019, 7:10pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/13 "2019-09-28T19:10:49Z")

</div>

This is a English only list, please refrain to use Spanish.

There is a Spanish IRC channel you can use.  
[https://docs.ansible.com/ansible/latest/community/communication.html](https://docs.ansible.com/ansible/latest/community/communication.html)

---

<div class="post-metadata">

**Author:** ![Javier\_Esparza](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Javier\_Esparza](https://forum.ansible.com/u/Javier_Esparza)\
**Post date:** [September 30, 2019, 8:40pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/14 "2019-09-30T20:40:39Z")

</div>

Here are my 3 questions that i have to respons when i want to install my scanner  
I find the module Expects but i dont find so much about that, i had tried to implement it, but i get a error.

heres is my code:

 ![ErrorAnsible2.PNG](https://us1.discourse-cdn.com/ansible/original/2X/2/270dcd09800963fe2914910ac605ebce77cc5833.png)

here comes the error, i disbloqued the first line of the questions

 ![ErrorAnsible3.PNG](https://us1.discourse-cdn.com/ansible/original/2X/1/1b518cb7c532ceb89e4be47902d90fe45729d11f.png)

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [September 30, 2019, 9:34pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/15 "2019-09-30T21:34:57Z")

</div>

Actually it's 4, you forgot the --More--, this works

&nbsp;&nbsp;&nbsp;&nbsp;- expect:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command: /tmp/uld/install-scanner.sh  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;responses:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"--More--": \r  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to quit: \r  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do you agree: y  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To skip, enter: n

---

<div class="post-metadata">

**Author:** ![Javier\_Esparza](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Javier\_Esparza](https://forum.ansible.com/u/Javier_Esparza)\
**Post date:** [September 30, 2019, 9:41pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/16 "2019-09-30T21:41:10Z")

</div>

i tried that but with the same anser

 ![ErrorAnsible4.PNG](https://us1.discourse-cdn.com/ansible/original/2X/0/0d82d2d358dce36b6a4e1c0e93e9c3deab88284c.png)

---

<div class="post-metadata">

**Author:** ![Javier\_Esparza](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Javier\_Esparza](https://forum.ansible.com/u/Javier_Esparza)\
**Post date:** [September 30, 2019, 9:43pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/17 "2019-09-30T21:43:21Z")

</div>

Is correct what i have write?

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [September 30, 2019, 9:45pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/18 "2019-09-30T21:45:30Z")

</div>

Please don't use images, it's impossible to comment on.

You need to look closer, I did not have dashes nor Questions in my task.  
Just copy inn my task and it will work.

---

<div class="post-metadata">

**Author:** ![Javier\_Esparza](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Javier\_Esparza](https://forum.ansible.com/u/Javier_Esparza)\
**Post date:** [September 30, 2019, 9:50pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/19 "2019-09-30T21:50:47Z")

</div>

Sorry my friend here comes de code.

- name: Ejecutamos el script de instalacion del scanner  
expect:  
command: /tmp/uld/install-scanner.sh  
response:  
Questions:
- “Press Enter to continue or q and then Enter to quit.:” : “\n”
- “Do you agree ? [y/n]” : “y”
- “–More–” : “\r”
- “If you want to configure firewall automatically, enter y or just press Enter. To skip, enter n.” : “n”

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [October 1, 2019, 5:35pm UTC](https://forum.ansible.com/t/problem-with-a-sh-installation/31382/20 "2019-10-01T17:35:49Z")

</div>

I have already given you a working task in a previous mail, so why are you still using this task that doesn't work?
