2015-11-17 64 views
1

我是使用Packer的新手,我希望爲我遇到的問題提供一些幫助。我似乎無法找到有關此錯誤的任何信息。這個錯誤發生在我的本地計算機和推後的地圖集中。創建工件時出錯:找不到資源

運行帕克v.0.8.7.dev

請給我伸出援助之手!

錯誤:

==> virtualbox-iso: Running post-processor: atlas 
    virtualbox-iso (atlas): Creating artifact:/
Build 'virtualbox-iso' errored: 1 error(s) occurred: 

* Post-processor failed: Error creating artifact: resource not found 

==> Some builds didn't complete successfully and had errors: 
--> virtualbox-iso: 1 error(s) occurred: 

* Post-processor failed: Error creating artifact: resource not found 

==> Builds finished but no artifacts were created. 

配置:

{ 
    "push": { 
     "name": "", 
     "vcs": true 
    }, 
    "variables": { 
     "atlas_username": "{{env `ATLAS_USERNAME`}}", 
     "atlas_name": "{{env `ATLAS_NAME`}}" 
    }, 
    "provisioners": [ 
     { 
      "type": "shell", 
      "scripts": [ 
       "scripts/base.sh", 
       "scripts/virtualbox.sh", 
       "scripts/vmware.sh", 
       "scripts/vagrant.sh", 
       "scripts/dep.sh", 
       "scripts/cleanup.sh", 
       "scripts/zerodisk.sh", 
       "scripts/custom.sh" 
      ], 
      "override": { 
       "virtualbox-iso": { 
        "execute_command": "echo 'vagrant'|sudo -S bash '{{.Path}}'" 
       }, 
       "vmware-iso": { 
        "execute_command": "echo 'vagrant'|sudo -S bash '{{.Path}}'" 
       } 
      } 
     } 
    ], 
    "builders": [ 
     { 
      "type": "virtualbox-iso", 
      "boot_command": [ 
       "<esc><esc><enter><wait>", 
       "/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", 
       "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", 
       "hostname={{ .Name }} ", 
       "fb=false debconf/frontend=noninteractive ", 
       "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ", 
       "initrd=/install/initrd.gz -- <enter>" 
      ], 
      "headless": false, 
      "boot_wait": "10s", 
      "disk_size": 20480, 
      "guest_os_type": "Ubuntu_64", 
      "http_directory": "http", 
      "iso_checksum": "c2571c4c2fc17bef1fad9e5db5e7afdb4bd29cd8ab51e42f9c036238c4e54caa", 
      "iso_checksum_type": "sha256", 
      "iso_url": "http://ftp.acc.umu.se/mirror/cdimage.ubuntu.com/releases/14.04/release/ubuntu-14.04.3-server-amd64+mac.iso", 
      "ssh_username": "vagrant", 
      "ssh_password": "vagrant", 
      "ssh_port": 22, 
      "ssh_wait_timeout": "10000s", 
      "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'vagrant'|sudo -S bash 'shutdown.sh'", 
      "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", 
      "virtualbox_version_file": ".vbox_version" 
     }, 
     { 
      "type": "vmware-iso", 
      "boot_command": [ 
       "<esc><esc><enter><wait>", 
       "/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", 
       "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", 
       "hostname={{ .Name }} ", 
       "fb=false debconf/frontend=noninteractive ", 
       "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ", 
       "initrd=/install/initrd.gz -- <enter>" 
      ], 
      "boot_wait": "10s", 
      "disk_size": 20480, 
      "guest_os_type": "Ubuntu-64", 
      "headless": true, 
      "http_directory": "http", 
      "iso_checksum": "af224223de99e2a730b67d7785b657f549be0d63221188e105445f75fb8305c9", 
      "iso_checksum_type": "sha256", 
      "iso_url": "http://releases.ubuntu.com/precise/ubuntu-12.04.5-server-amd64.iso", 
      "skip_compaction": true, 
      "ssh_username": "vagrant", 
      "ssh_password": "vagrant", 
      "ssh_port": 22, 
      "ssh_wait_timeout": "10000s", 
      "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'vagrant'|sudo -S bash 'shutdown.sh'", 
      "tools_upload_flavor": "linux" 
     } 
    ], 
    "post-processors": [ 
     [{ 
      "type": "vagrant", 
      "keep_input_artifact": true 
     }, 
     { 
      "type": "atlas", 
      "only": ["vmware-iso"], 
      "artifact": "{{user `atlas_username`}}/{{user `atlas_name`}}", 
      "artifact_type": "vagrant.box", 
      "metadata": { 
       "provider": "vmware_desktop", 
       "version": "0.0.1" 
      } 
     }, 
     { 
      "type": "atlas", 
      "only": ["virtualbox-iso"], 
      "artifact": "{{user `atlas_username`}}/{{user `atlas_name`}}", 
      "artifact_type": "vagrant.box", 
      "metadata": { 
       "provider": "virtualbox", 
       "version": "0.0.1" 
      } 
     }] 
    ] 
} 

回答

3

你得到

virtualbox-iso (atlas): Creating artifact:/

因此它似乎從

"variables": { 
    "atlas_username": "{{env `ATLAS_USERNAME`}}", 
    "atlas_name": "{{env `ATLAS_NAME`}}" 
}, 
您的變量

設置不正確 - 確保它們已設置或嘗試硬編碼。

另外,作爲一個側面說明,在最新的doc它建議使用atlas_token訪問阿特拉斯

"post-processors": [ 
    { 
    "type": "atlas", 
    "only": ["virtualbox-iso"], 
    "token": "{{user `atlas_token`}}", 
    "artifact": "hashicorp/foobar", 
    "artifact_type": "vagrant.box", 
    "metadata": { 
     "provider": "virtualbox", 
     "version": "0.0.1" 
     "created_at": "{{timestamp}}" 
    } 
    } 
] 
+0

謝謝你,這是問題! – Kansuler