os_server create instance failed with attributeError

57 views
Skip to first unread message

Hardik Italia

unread,
Nov 24, 2015, 9:52:33 AM11/24/15
to Ansible Project
Hi,

I am trying to create a instance in openstack environment using ansible module os_server and getting following errors. Any suggestions?

I install ansible from the source by following instruction from http://docs.ansible.com/ansible/intro_installation.html#running-from-source.

jenkins@jenkins-ansible:~$ ansible --version
ansible 2.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides

Playbook:

- name: launch a compute instance

  hosts: localhost

  tasks:

  - name: launch an instance

    os_server:

      state: present

      auth:

        auth_url: http://10.10.10.10:35357/v2.0/

        username: admin

        password: admin

        project_name: admin

      name: vm1

      image: c88964bd-14e6-4c9b-9d31-42f348f53eb9

      key_name: vm_rsa

      timeout: 200

      flavor: 4

      security_groups: default

      nics:

        - net-id: c88964bd-14e6-4c9b-9d31-42f348f53eb9

        - net-name: n1




PLAY [launch a compute instance] ***********************************************

TASK [setup] *******************************************************************
ok: [127.0.0.1]

TASK [launch an instance] ******************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, "msg": "Traceback (most recent call last):\r\n  File \"/home/jenkins/.ansible/tmp/ansible-tmp-1448333412.82-245001675947198/os_server\", line 24, in <module>\r\n    import shade\r\n  File \"/usr/local/lib/python2.7/dist-packages/shade/__init__.py\", line 24, in <module>\r\n    from shade.openstackcloud import OpenStackCloud\r\n  File \"/usr/local/lib/python2.7/dist-packages/shade/openstackcloud.py\", line 32, in <module>\r\n    from keystoneclient import client as keystone_client\r\n  File \"/usr/local/lib/python2.7/dist-packages/keystoneclient/client.py\", line 15, in <module>\r\n    from keystoneclient import discover\r\n  File \"/usr/local/lib/python2.7/dist-packages/keystoneclient/discover.py\", line 24, in <module>\r\n    from keystoneclient.v2_0 import client as v2_client\r\n  File \"/usr/local/lib/python2.7/dist-packages/keystoneclient/v2_0/__init__.py\", line 1, in <module>\r\n    from keystoneclient.v2_0.client import Client  # noqa\r\n  File \"/usr/local/lib/python2.7/dist-packages/keystoneclient/v2_0/client.py\", line 21, in <module>\r\n    from keystoneclient import httpclient\r\n  File \"/usr/local/lib/python2.7/dist-packages/keystoneclient/httpclient.py\", line 152, in <module>\r\n    class HTTPClient(baseclient.Client, base.BaseAuthPlugin):\r\n  File \"/usr/local/lib/python2.7/dist-packages/keystoneclient/httpclient.py\", line 262, in HTTPClient\r\n    user_agent=USER_AGENT, connect_retries=None, **kwargs):\r\n  File \"/usr/local/lib/python2.7/dist-packages/debtcollector/renames.py\", line 38, in decorator\r\n    @six.wraps(f)\r\nAttributeError: 'module' object has no attribute 'wraps'\r\n", "parsed": false}

PLAY RECAP *********************************************************************
127.0.0.1                  : ok=1    changed=0    unreachable=0    failed=1

Thanks,
Hardik

David Shrewsbury

unread,
Nov 24, 2015, 12:16:50 PM11/24/15
to Ansible Project
Looks like you need to upgrade the Python six module.


-Dave

Hardik Italia

unread,
Nov 24, 2015, 7:42:13 PM11/24/15
to Ansible Project
Thanks for your reply.

I have updated python six module but still getting same errors,

six                       - Python 2 and 3 compatibility utilities
  INSTALLED: 1.10.0 (latest)

Thanks,
hardik
Reply all
Reply to author
Forward
0 new messages