title: How to run Ansible playbook with user input within Jenkins?
body: <p>I have a playbook with section "pause" and prompt. If I create job within Jenkins with Pipeline plugin and run this job I get </p>
  
  <pre><code>[WARNING]: Not waiting from prompt as stdin is not interactive
  </code></pre>
  
  <p>and job is failed. The question is how I can run job in interactive mode or how I can pause playbook within exact task and push combination Ctrl+c+c (because ansible module '<code>pause</code>' is working only like that)? I have googled a few time and tried to do that with </p>
  
  <pre><code>def userInput = input(
      id: 'Password', message: 'input your input: ', ok: 'ok',
      parameters: [string(defaultValue: '', description: '.....', name: 'INPUT_TEST')])
  </code></pre>
  
  <p>But I can't push keys combination and can't understand how I can pause jenkins job on specific ansible task within playbook. </p>
  
  <p>Pipeline example:</p>
  
  <pre><code>pipeline {
  agent { label 'master' }
    environment {
    WORKDIR = '/home/jenkins/'
    }
    stages {
  
    stage('Checkout') {
      agent { label 'master' }
      steps {
        sh '''cd $WORKDIR
        ansible-playbook -vvvv manual_playbooks/test.yml'''
        }
      }  
  
    stage ('Echo') {
       agent { label 'master' }
       steps {
          sh 'echo something' 
       }
    }
    }
  }
  </code></pre>
  
  <p>Playbook example:</p>
  
  <pre><code>---
  - name: test
    hosts: localhost
    tasks:
  
      - name: Echo start
        shell: echo 'start playbook'
  
      - pause:
          prompt: "do you want to continue?"
          echo: yes
          private: no
        register: prompt_status
  
      - name: Continue tasks
        shell: echo 'Continue full flow'
        register: reset_account_response
        when: prompt_status.user_input is defined and 
              prompt_status.user_input == "yes"
  
      - fail:
          msg: "Unexpected user input while prompting approval"
        when: prompt_status.user_input is defined and 
              prompt_status.user_input != "yes"
  </code></pre>
  
  <p>Many thanks.</p>