geerlingguy / geerlingguy/ansible-for-devops

Ch4 Node.js playbook; Fatal error "Failed to get information on remote file ... not a directory" when run task "Copy example Node.js app to server

Open
#485 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
9.9k
Forks
3.8k
PR merge metrics
No merged PRs in 30d

Description

RockyLinux 8.6
Ansible core 2.12.2

When that step is reached using the YAML from the book, ansible throws the following:

`fatal: [anstarget3]: FAILED! => {"msg": "Failed to get information on remote file (/usr/local/opt/node/app/app.js): Not a directory"}`

It looks like this is down to passing in the var `node_apps_location: /usr/local/opt/node`

leaves us with no "app" directory into which files can be copied.

Changing line 32 from

`file: "path={{ node_apps_location }} state=directory"`

to

`file: "path={{ node_apps_location }}/app state=directory"`

sets it up correctly and all files are copied over as expected.

Contributor guide

No contributing guide indexed for this repository

Research direction

Review the Chapter 4 Node.js playbook at line 32 and the task "Copy example Node.js app to server," focusing on how node_apps_location is used for the destination. Confirm the directory setup and copy behavior on the stated Ansible and Rocky Linux versions; done means the app directory exists and all files copy without the "Not a directory" error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible
Domain
devops
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.