title: Operation requires privilege escalation
body: <p>I have a trouble with ansible. </p>
  
  <p>I tried to create some VLAN but I got back this error: "operation requires privilege escalation" </p>
  
  <p><strong>ansible.cfg:</strong></p>
  
  <pre><code>[defaults]
  
  inventory = hosts
  host_key_checking = false
  gather_facts = false
  timeout = 1000
  </code></pre>
  
  <p><strong>hosts:</strong></p>
  
  <pre><code>[switch]
  sw-este ansible_host=192.168.99.10 ansible_network_os=ios
  </code></pre>
  
  <p><strong>Playbook:</strong></p>
  
  <pre><code>---
  - name: Crear las VLAN y configurar las interfaces
    hosts: sw-este
    gather_facts: false
    connection: network_cli
  
    tasks:
  
    - name: create VLAN
      ios_vlan:
        vlan_id: "{{ item.id }}" 
        name: "{{ item.name }}"
        state: present
  
      with_items:
        - { id : 21, name : Contabilidad }
        - { id : 23, name : Ingenieria }
  </code></pre>
  
  <p>And here is result of: </p>
  
  <blockquote>
    <p>ansible-playbook roles/Basic_Config/tasks/create_vlan.yml -k -u
    ansible -vvv</p>
  </blockquote>
  
  <pre><code>ansible-playbook 2.5.0
    config file = /root/Training/ansible.cfg
    configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/lib/python2.7/dist-packages/ansible
    executable location = /usr/bin/ansible-playbook
    python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
  Using /root/Training/ansible.cfg as config file
  SSH password: 
  Parsed /root/Training/hosts inventory source with ini plugin
  
  PLAYBOOK: create_vlan.yml ******************************************************
  1 plays in roles/Basic_Config/tasks/create_vlan.yml
  
  PLAY [Crear las VLAN y configurar las interfaces] ******************************
  META: ran handlers
  
  TASK [create VLAN] *************************************************************
  task path: /root/Training/roles/Basic_Config/tasks/create_vlan.yml:9
  Using module file /usr/lib/python2.7/dist-packages/ansible/modules/network/ios/ios_vlan.py
  &lt;192.168.99.10&gt; ESTABLISH LOCAL CONNECTION FOR USER: root
  &lt;192.168.99.10&gt; EXEC /bin/sh -c 'echo ~ &amp;&amp; sleep 0'
  &lt;192.168.99.10&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926 `" &amp;&amp; echo ansible-tmp-1523359559.78-25490853974926="` echo /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926 `" ) &amp;&amp; sleep 0'
  &lt;192.168.99.10&gt; PUT /root/.ansible/tmp/ansible-local-20772YYZlPo/tmplAtgR2 TO /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ios_vlan.py
  &lt;192.168.99.10&gt; EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ios_vlan.py &amp;&amp; sleep 0'
  &lt;192.168.99.10&gt; EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ios_vlan.py &amp;&amp; sleep 0'
  &lt;192.168.99.10&gt; EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1523359559.78-25490853974926/ &gt; /dev/null 2&gt;&amp;1 &amp;&amp; sleep 0'
  The full traceback is:
  Traceback (most recent call last):
    File "/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py", line 323, in &lt;module&gt;
      main()
    File "/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py", line 314, in main
      load_config(module, commands)
    File "/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py", line 162, in load_config
    File "/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/connection.py", line 146, in __rpc__
  ansible.module_utils.connection.ConnectionError: operation requires privilege escalation
  
  failed: [sw-este] (item={u'id': 21, u'name': u'Contabilidad'}) =&gt; {
      "changed": false, 
      "item": {
          "id": 21, 
          "name": "Contabilidad"
      }, 
      "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py\", line 323, in &lt;module&gt;\n    main()\n  File \"/tmp/ansible_Mv7Iu8/ansible_module_ios_vlan.py\", line 314, in main\n    load_config(module, commands)\n  File \"/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py\", line 162, in load_config\n  File \"/tmp/ansible_Mv7Iu8/ansible_modlib.zip/ansible/module_utils/connection.py\", line 146, in __rpc__\nansible.module_utils.connection.ConnectionError: operation requires privilege escalation\n", 
      "module_stdout": "", 
      "msg": "MODULE FAILURE", 
      "rc": 1
  }
  Using module file /usr/lib/python2.7/dist-packages/ansible/modules/network/ios/ios_vlan.py
  &lt;192.168.99.10&gt; ESTABLISH LOCAL CONNECTION FOR USER: root
  &lt;192.168.99.10&gt; EXEC /bin/sh -c 'echo ~ &amp;&amp; sleep 0'
  &lt;192.168.99.10&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640 `" &amp;&amp; echo ansible-tmp-1523359560.84-82791789077640="` echo /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640 `" ) &amp;&amp; sleep 0'
  &lt;192.168.99.10&gt; PUT /root/.ansible/tmp/ansible-local-20772YYZlPo/tmphTJUVi TO /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ios_vlan.py
  &lt;192.168.99.10&gt; EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ios_vlan.py &amp;&amp; sleep 0'
  &lt;192.168.99.10&gt; EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ios_vlan.py &amp;&amp; sleep 0'
  &lt;192.168.99.10&gt; EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1523359560.84-82791789077640/ &gt; /dev/null 2&gt;&amp;1 &amp;&amp; sleep 0'
  The full traceback is:
  Traceback (most recent call last):
    File "/tmp/ansible_7sSs07/ansible_module_ios_vlan.py", line 323, in &lt;module&gt;
      main()
    File "/tmp/ansible_7sSs07/ansible_module_ios_vlan.py", line 314, in main
      load_config(module, commands)
    File "/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py", line 162, in load_config
    File "/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/connection.py", line 146, in __rpc__
  ansible.module_utils.connection.ConnectionError: operation requires privilege escalation
  
  failed: [sw-este] (item={u'id': 23, u'name': u'Ingenieria'}) =&gt; {
      "changed": false, 
      "item": {
          "id": 23, 
          "name": "Ingenieria"
      }, 
      "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_7sSs07/ansible_module_ios_vlan.py\", line 323, in &lt;module&gt;\n    main()\n  File \"/tmp/ansible_7sSs07/ansible_module_ios_vlan.py\", line 314, in main\n    load_config(module, commands)\n  File \"/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py\", line 162, in load_config\n  File \"/tmp/ansible_7sSs07/ansible_modlib.zip/ansible/module_utils/connection.py\", line 146, in __rpc__\nansible.module_utils.connection.ConnectionError: operation requires privilege escalation\n", 
      "module_stdout": "", 
      "msg": "MODULE FAILURE", 
      "rc": 1
  }
      to retry, use: --limit @/root/Training/roles/Basic_Config/tasks/create_vlan.retry
  
  PLAY RECAP *********************************************************************
  sw-este                    : ok=0    changed=0    unreachable=0    failed=1   
  </code></pre>
  
  <p>I tried with connection: local, with become_method: enable but nothing works</p>