title: Using ec2_snapshot getting error message "boto required for this module"
body: <p>I am using Ubuntu Server 16.4 with ansible 2.4 on AWS</p>
  
  <p>My playbook is trying to take snapshots of ec2 vol. See below</p>
  
  <pre><code>- hosts: localhost
    connection: local
    become: yes
    become_method: sudo
    gather_facts: yes
    any_errors_fatal: True
  
  - name: Take snapshots of all volume"
    ec2_snapshot:
        volume_id: "{{item.id}}"
        description: "Taken on {{ ansible_date_time.date }}"
        snapshot_tags:
            frequency: hourly
    with_items: "{{ aws_ec2_vol_setting }}"
  </code></pre>
  
  <p>I run the playbook with the following cmd</p>
  
  <pre><code>ansible-playbook -vvv  pb_aws_backup_nw_us_sat.yml
  
  Using module file /usr/lib/python2.7/dist-packages/ansible/modules/cloud/amazon/ec2_snapshot.py
  &lt;127.0.0.1&gt; ESTABLISH LOCAL CONNECTION FOR USER: r_ansible
  &lt;127.0.0.1&gt; EXEC /bin/sh -c 'echo ~ &amp;&amp; sleep 0'
  &lt;127.0.0.1&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p "` echo /home/r_ansible/.ansible/tmp/ansible-tmp-1517934063.54-197986659054036 `" &amp;&amp; echo ansible-tmp-1517934063.54-197986659054036="` echo /home/r_ansible/.ansible/tmp/ansible-tmp-1517934063.54-197986659054036 `" ) &amp;&amp; sleep 0'
  &lt;127.0.0.1&gt; PUT /tmp/tmprERpt_ TO /home/r_ansible/.ansible/tmp/ansible-tmp-1517934063.54-197986659054036/ec2_snapshot.py
  &lt;127.0.0.1&gt; EXEC /bin/sh -c 'chmod u+x /home/r_ansible/.ansible/tmp/ansible-tmp-1517934063.54-197986659054036/ /home/r_ansible/.ansible/tmp/ansible-tmp-1517934063.54-197986659054036/ec2_snapshot.py &amp;&amp; sleep 0'
  &lt;127.0.0.1&gt; EXEC /bin/sh -c 'sudo -H -S -n -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-ociuiywkpfvurbbesjwxhczxoglttlsa; /usr/bin/python /home/r_ansible/.ansible/tmp/ansible-tmp-1517934063.54-197986659054036/ec2_snapshot.py; rm -rf "/home/r_ansible/.ansible/tmp/ansible-tmp-1517934063.54-197986659054036/" &gt; /dev/null 2&gt;&amp;1'"'"' &amp;&amp; sleep 0'
  Using module file /usr/lib/python2.7/dist-packages/ansible/modules/cloud/amazon/ec2_snapshot.py
  &lt;127.0.0.1&gt; EXEC /bin/sh -c 'echo ~ &amp;&amp; sleep 0'
  The full traceback is:
    File "/tmp/ansible_gUIlz4/ansible_module_ec2_snapshot.py", line 127, in &lt;module&gt;
      import boto.ec2
  
  failed: [localhost] (item={u'vol': u'vol-us-sat-01', u'id': u'vol-0b6aaa3b8289580f6', u'server': u'us-nv-sat-01'}) =&gt; {
      "changed": false,
      "invocation": {
          "module_args": {
              "aws_access_key": null,
              "aws_secret_key": null,
              "description": null,
              "device_name": null,
              "ec2_url": null,
              "instance_id": null,
              "last_snapshot_min_age": 0,
              "profile": null,
              "region": null,
              "security_token": null,
              "snapshot_id": null,
              "snapshot_tags": {
                  "frequency": "hourly"
              },
              "state": "present",
              "validate_certs": true,
              "volume_id": "vol-0b6aaXXXXXXXX",
              "wait": true,
              "wait_timeout": 0
          }
      },
      "item": {
          "id": "vol-0b6aXXXXXXXXXX",
          "server": "us-nv-sat-01",
          "vol": "vol-us-sat-01"
      },
      "msg": "boto required for this module"
  }
  </code></pre>
  
  <p>Note: The access key and secret key are empty because i am using a IAM role that is assign to the server.</p>
  
  <p>I have check my host and to me at least it looks like i have all the requirements.</p>
  
  <pre><code>$ which python
  /usr/bin/python
  $ pip list boto | grep boto
  boto (2.48.0)
  boto3 (1.5.23)
  botocore (1.8.37)
  $ python -V
  Python 2.7.12
  </code></pre>
  
  <p>python modules all seem to be there and importing fine is well</p>
  
  <pre><code>$ python
  Python 2.7.12 (default, Dec  4 2017, 14:50:18)
  [GCC 5.4.0 20160609] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import boto
  &gt;&gt;&gt; import boto.ec2
  &gt;&gt;&gt; import boto3
  </code></pre>
  
  <p>So i am not sure why i am getting the error "boto required for this module".
  I have also tried without any success the solution suggested <a href="https://www.zigg.com/2014/using-virtualenv-python-local-ansible.html" rel="nofollow noreferrer" title="Using virtualenv Python in local Ansible">here</a> but I still get the issue.</p>