Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remote-file w/ content generates bash that assumes destination file already exists #266

Open
cap10morgan opened this issue Jul 25, 2013 · 0 comments

Comments

@cap10morgan
Copy link

When using the remote-file action w/ a :content key (example below), it generates bash script that assumes the pre-existence of the file you're trying to create.

(remote-file ".ssh/config" :content "Host github.com...")

#!/usr/bin/env bash
echo 'clone-repo: remote-file .ssh/config...';
{
dirpath=$(dirname /var/lib/pallet$(getent passwd wmorgan | cut -d: -f6)/.ssh/config.new)
templatepath=$(dirname $(readlink -f .ssh/config))

That last line is the culprit. readlink -f .ssh/config fails because there is no /home/vmfest/.ssh directory. There is a prior (remote-directory ".ssh") call in my code, but that creates the .ssh directory in my admin user's home directory, not in the vmfest user's home directory.

The culprit seems to be in src/pallet/actions/direct/remote_file.clj on line 116 where is calls (create-path-with-template path new-path) with the path (the destination file) as the first argument, template-path. I'm not clear on what the logic should be there, but this seems wrong. It's essentially saying, "the file you're trying to create is the template you should use to create the file."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant