Le 2019-02-12 17:11, [email protected] a écrit :
Hi all,

I have a problem, i think there is a bug in ansible 2.8.0 but when i
run this task :

- pause:
    prompt: "Voulez-vous effectuer ce deploiement ? (o/n)"
  register: response

- debug:
    msg: "deploiement effectue"
  when: response == "o"

-  meta: end_play
   when: response != "o"

The condition WHEN: RESPONSE != "0" not works !!

So, when i grab "o" for answer at the question "VOULEZ-VOUS EFFECTUER
CE DEPLOIEMENT ? (O/N)",  this task is play or he must exit !!

Why ?

Thank for your help guy !! :)



Perhaps because you don't read the documentation and instead said there's a bug ;-) You asks a lot of questions in little time on the list, try a little bit to learn by yourself


A little more functionning sample should probably be :

- hosts: localhost
  tasks:

  - name: "Prompt it"
    pause:
      prompt: "Voulez-vous effectuer ce deploiement ? (o/n)"
    register: response

  - name: "Print value of register"
    debug:
      msg: "print value of register : {{ response }}"

  - name: "Affiche si o est presse"
    debug:
      msg: "deploiement effectue"
    when: response.user_input == "o"

  - name: "Aller a la fin si o n est pas presse"
    meta: end_play
    when: response.user_input != "o"

  - name: "This is something after it"
    debug:
      msg: "Print it"

Regards,

JYL

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1084430a3d2edca543f5546376271953%40lenhof.eu.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to