在这个问题上的任何帮助都是感激的。
我试图使用Ansible模板将json文件复制到localhost,并运行curl命令导入datadog dasboard。
Jenkins错误:
TASK [datadog-dashboard : Import Datadog Dashboard in main] ********************
16:54:24 included: /home/jenkins/agent/workspace/5052/non_production/monitoring-as-code/src/roles/datadog-dashboard/tasks/Import.yaml for localhost
16:54:24
16:54:24 TASK [datadog-dashboard : Copying Dashboard json file] *************************
16:54:24 fatal: [localhost]: FAILED! => {"changed": false, "msg": "Could not find or access 'src/roles/datadog-dashboard/templates/datadog-dashboard/non_production/NonProd.json'\nSearched in:\n\t/home/jenkins/agent/workspace/5052/non_production/monitoring-as-code/src/roles/datadog-dashboard/templates/src/roles/datadog-dashboard/templates/datadog-dashboard/non_production/NonProd.json\n\t/home/jenkins/agent/workspace/5052/non_production/monitoring-as-code/src/roles/datadog-dashboard/src/roles/datadog-dashboard/templates/datadog-dashboard/non_production/NonProd.json\n\t/home/jenkins/agent/workspace/5052/non_production/monitoring-as-code/src/roles/datadog-dashboard/tasks/templates/src/roles/datadog-dashboard/templates/datadog-dashboard/non_production/NonProd.json\n\t/home/jenkins/agent/workspace/5052/non_production/monitoring-as-code/src/roles/datadog-dashboard/tasks/src/roles/datadog-dashboard/templates/datadog-dashboard/non_production/NonProd.json\n\t/home/jenkins/agent/workspace/5052/non_production/monitoring-as-code/src/templates/src/roles/datadog-dashboard/templates/datadog-dashboard/non_production/NonProd.json\n\t/home/jenkins/agent/workspace/5052/non_production/monitoring-as-code/src/src/roles/datadog-dashboard/templates/datadog-dashboard/non_production/NonProd.json on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"}
Ansible代码:
- name: Copying Dashboard json file
template:
src: src/roles/datadog-dashboard/templates/datadog-dashboard/{{ application_env }}/NonProd.json
dest: /tmp/5052-dash.json
mode: '0644'
1条答案
按热度按时间rvpgvaaj1#
它仅适用于以下路径: