ansible / ansible

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy and maintain. Automate everything from code deployment to network configuration to cloud management, in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com.
https://www.ansible.com/
GNU General Public License v3.0
62.96k stars 23.91k forks source link

purestorage sdk is required #54885

Closed lpossamai closed 5 years ago

lpossamai commented 5 years ago

Hi guys. Not sure if this is the right place for this.

I am trying to use the Pure Storage Snap Module, but I'm getting the following error:

TASK [perform PURE volume snapshot] *******************************************************************************************************************************************************************************
fatal: [192.168.199.15]: FAILED! => {"changed": false, "msg": "purestorage sdk is required for this module in volume"}

yaml file:

---
# Perform PURE Flasharray Database snapshots
- name: perform PURE volume snapshot
  purefa_snap:
    name: Oracle/db2-prod-oracledb
    suffix: snap
    fa_url: "{{ fa_url }}"
    api_token: "{{ apiToken }}"

I already have the purestorage python module installed; and I am not running this remotlely:

[lucas@thanos ansible]$ pip freeze | grep purestorage
purestorage==1.16.0

Ansible version:

ansible 2.7.9
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/lucas/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/lucas/.local/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.15+ (default, Oct  2 2018, 22:12:08) [GCC 8.2.0]
ansibot commented 5 years ago

@lpossamai: Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

Please set the description of this issue with this template: https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE.md

click here for bot help

Akasurde commented 5 years ago

!component =lib/ansible/modules/storage/purestorage/purefa_snap.py

lpossamai commented 5 years ago

So.. doing some digging.

The Playbook I'm using is:

---
- name: Oracle Database Snapshots
  hosts: dbservers
  remote_user: oracle
  sudo: true
  sudo_user: root
  vars_files:
    - vars/arrays.yaml
    - vars/database.yaml

  tasks:

# Take Snapshot of database volumes
    - include: tasks/take_snapshot.yaml
      run_once: yes

tasks/take_snapshot.yaml:

---
# Perform PURE Flasharray Database snapshots
- name: perform PURE volume snapshot
  purefa_snap:
    name: db2-prod-oracledb
    suffix: snap
    fa_url: "{{ fa_url }}"
    api_token: "{{ apiToken }}"

Now, if I replace "hosts: dbservers" for "hosts: localhost", it works. So that means it was indeed trying to connect to "dbservers" and then running the commands. I did check the dbservers host and I can see purestorage sdk is also installed there.

oracle[DR]@db2:~$pip freeze |grep purestorage
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
purestorage==1.16.0

How can I fix the missing purestorage sdk error? It is an RHEL 6.7. Thanks!

lpossamai commented 5 years ago

This has been solved.

This is an issue with Python and not ansible.