简体   繁体   中英

Unable to run openstack client from Jenkins

I created Ansible playbook to create new image in openstack cloud. And I am running this playbook from Jenkins. While running from Jenkins its giving following error.

TASK [Create image from Instance]
********************************************** fatal: 
[localhost -localhost]: FAILED! ={"changed": true, "cmd":
  "/bin/openstack --insecure server image create --name abhay_suse_demo_img Abhay_Suse_Demo", 
  "delta": "0:00:00.542002", "end": "2018-03-26 07:07:44.377724", 
  "msg": "non-zero return code", "rc": 1, "start": "2018-03-26 07:07:43.835722", 
  "stderr": "'module' object has no attribute 'OpenStackConfigException'", 
  "stderr_lines": ["'module' object has no attribute 'OpenStackConfigException'"], 
  "stdout": "", "stdout_lines": []}     
  to retry, use: --limit @/tmp/imageCreate_Fe.retry

- hosts: localhost
tasks:
- name: Shutdown the instance
  os_server_action: action=stop server={{ server }} timeout=200 verify=no
  delegate_to: localhost
  ignore_errors: Yes
- name: Create image from Instance
  shell: /bin/openstack --insecure server image create --name {{ snapshot_image }}  {{ server }}
  delegate_to: localhost

I have already exported my environmental variables for authentication.

是因为jenkins以jenkins用户身份运行命令吗?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM