title: How to run Privilege Exec command in Ansible on Cisco Router
body: <p>I am attempting to write a playbook to perform a packet capture. The commands are run in Privilege exec mode, i.e #   Not config mode (config#) and not user exec (>)</p>
  
  <p>I have to run become and become_method: enable so that I can get into the device. However when I run the playbook with become and become_method I get <code>\r\n% Invalid input detected at '^' marker.\r\n\r\nrouter(config)#\n</code>".</p>
  
  <p>When I run the playbook without become and become_method I get the "operation requires privilege escalation\n" </p>
  
  <p>The commands in question:</p>
  
  <pre><code>  - name: setup packet capture
      ios_config:
        lines:
          - monitor capture buffer PKT size 2048 max-size 4096 circular
          - monitor capture buffer PKT filter access-list PackCap
      become: yes
      become_method: enable
  </code></pre>
  
  <p>How do I run the command in just privilege exec mode?</p>
  
  <p>Thanks!</p>