{"id":2401,"date":"2018-03-05T17:09:47","date_gmt":"2018-03-05T22:09:47","guid":{"rendered":"http:\/\/osric.com\/chris\/accidental-developer\/?p=2401"},"modified":"2018-03-05T19:52:55","modified_gmt":"2018-03-06T00:52:55","slug":"ansible-unarchive-module-error-path-does-not-exist","status":"publish","type":"post","link":"https:\/\/osric.com\/chris\/accidental-developer\/2018\/03\/ansible-unarchive-module-error-path-does-not-exist\/","title":{"rendered":"Ansible unarchive module error: path does not exist"},"content":{"rendered":"<p>I was working on deploying files to a host via Ansible&#8217;s <code>unarchive<\/code> module when I ran into an error message:<\/p>\n<pre><code>path \/tmp\/datafiles\/ does not exist<\/code><\/pre>\n<p>Here&#8217;s the relevant portion of my Ansible role&#8217;s <code>task\/main.yml<\/code>:<\/p>\n<pre><code>- name: copy datafiles\r\n  unarchive:\r\n    src: datafiles.tar.gz\r\n    dest: \/tmp\r\n    owner: root\r\n    group: datauser<\/code><\/pre>\n<p>Here&#8217;s the full result of running that task:<\/p>\n<pre><code>TASK [datafiles : copy datafiles] *******************************************************************************************************************************************\r\nfatal: [localhost]: FAILED! =&gt; {\"changed\": false, \"failed\": true, \"msg\": \"path \/tmp\/datafiles\/ does not exist\", \"path\": \"\/tmp\/datafiles\/\", \"state\": \"absent\"}<\/code><\/pre>\n<p>The error message confused me. The <code>datafiles<\/code> directory shouldn&#8217;t <em>need<\/em> to exist!<\/p>\n<p>The problem was completely unrelated to the error message. I had specified a group, <code>datauser<\/code>, that did not exist on the target host. Once I removed the <code>group<\/code> parameter, the task ran without error. (Another option would be to ensure that the specified group exists on the target host.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An error returned by Ansible&#8217;s unarchive package seems to indicate that an unnecessary directory needs to be present. However, the error message may be misleading and the root of the error may be something else entirely (in this example, a missing group entity).<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[439],"tags":[423],"class_list":["post-2401","post","type-post","status-publish","format-standard","hentry","category-ansible","tag-ansible"],"_links":{"self":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/comments?post=2401"}],"version-history":[{"count":5,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2401\/revisions"}],"predecessor-version":[{"id":2415,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2401\/revisions\/2415"}],"wp:attachment":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/media?parent=2401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/categories?post=2401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/tags?post=2401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}