title: How to pass multiple executable in ansible within a shell module?
body: <p>I am trying to pass a prompt y in ansible when it executes command.
  When i do manually on server it asks for a prompt. </p>
  
  <p>The issue is for command to run i need to pass the executable /bin/bash 
  <em>command: <code>source /etc/profile.d/tableau_server.sh &amp;&amp; tsm pending-changes apply</code></em> for expect command to run  i need to pass /usr/bin/expect . </p>
  
  <p>My question, how can i pass 2 executable in ansible such that for command it uses /bin/bash and for expect prompt it should use /usr/bin/expect and the error is because i am using source, what is an alternative i can use?</p>
  
  <p>Update: I dont know why but i am not able to pass --ignore-prompt , It gives an error </p>
  
  <pre><code>ubuntu@ip-xx-xxx-xx-xx:~$ tsm pending-changes apply --ignore-prompt
  Unrecognized option: --ignore-prompt
  </code></pre>
  
  <p>Please help me with a solution!</p>
  
  <pre><code>ubuntu@ip-xx-xxx-xx-xx:~$ tsm pending-changes apply
  This operation will perform a server restart. Are you sure you wish to continue?
  (y/n): 
  </code></pre>
  
  <p>My ansible script:</p>
  
  <pre><code>  shell: |
       source /etc/profile.d/tableau_server.sh &amp;&amp; tsm pending-changes apply
       expect "This operation will perform a server restart. Are you sure you wish to continue?\n(y/n):"
       send "y\n"
       exit 0
    args:
       executable: /usr/bin/expect
        args:
           executable: /bin/bash/expect
        when: inventory_hostname == "xx.xxx.xx.xx"
  </code></pre>
  
  <p>ERROR:</p>
  
  <pre><code> changed: [xx.xxx.xxx.xx] =&gt; {
      "changed": true,
      "cmd": "source /etc/profile.d/tableau_server.sh &amp;&amp; tsm pending-changes apply\n expect \"This operation will perform a server restart. Are you sure you wish to continue?\\n(y/n):\"\n send \"y\\n\"\n exit 0",
      "delta": "0:00:00.034824",
      "end": "2018-08-20 17:29:41.457700",
      "invocation": {
          "module_args": {
              "_raw_params": "source /etc/profile.d/tableau_server.sh &amp;&amp; tsm pending-changes apply\n expect \"This operation will perform a server restart. Are you sure you wish to continue?\\n(y/n):\"\n send \"y\\n\"\n exit 0",
              "_uses_shell": true,
              "argv": null,
              "chdir": null,
              "creates": null,
              "executable": "/usr/bin/expect",
              "removes": null,
              "stdin": null,
              "warn": true
          }
      },
      "rc": 0,
      "start": "2018-08-20 17:29:41.422876",
      "stderr": "wrong # args: should be \"source ?-encoding name? fileName\"\n    while executing\n\"source /etc/profile.d/tableau_server.sh &amp;&amp; tsm pending-changes apply\"",
      "stderr_lines": [
          "wrong # args: should be \"source ?-encoding name? fileName\"",
          "    while executing",
          "\"source /etc/profile.d/tableau_server.sh &amp;&amp; tsm pending-changes apply\""
      ],
      "stdout": "",
      "stdout_lines": []
  </code></pre>