无法从Jenkins运行openstack客户端

时间:2018-03-26 05:26:39

标签: jenkins ansible openstack

我创建了Ansible playbook来在openstack云中创建新的图像。 而我正在运行Jenkins的这本剧本。从Jenkins运行时发出以下错误。

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

我已导出环境变量进行身份验证。

1 个答案:

答案 0 :(得分:0)

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

相关问题