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 resource fails when specifying user attribute different from execution user. #304

Open
dkam opened this issue Nov 19, 2019 · 1 comment

Comments

@dkam
Copy link

dkam commented Nov 19, 2019

Hi there,
Log:

INFO : Starting Itamae... 
 INFO : Loading node data from /Users/macuser/Development/deploy/nodes/pg.yml...
 INFO : Recipe: /Users/macuser/Development/deploy/cookbooks/app/app_user.rb
ERROR :     stdout | chmod: changing permissions of '/tmp/itamae_tmp/1574202178.8791308': Operation not permitted
ERROR :     Command `sudo -H -u app_user -- /bin/sh -c cd\ \~app_user\ \;\ chmod\ 0600\ /tmp/itamae_tmp/1574202178.8791308` failed. (exit status: 1)
ERROR :   remote_file[/home/app_user/.ssh/authorized_keys] Failed.
remote_file "/home/app_user/.ssh/authorized_keys" do
  action :create
  user 'app_user'
end
bundle exec itamae ssh  --host pg.myapp.info --user root -i ~/.ssh/id_ed25519 cookbooks/app/app_user.rb  -y nodes/pg.yml

Might be similar to this issue.

@dkam
Copy link
Author

dkam commented Nov 19, 2019

I worked around it like this:

remote_file "/home/app_user/.ssh/authorized_keys" do
  action :create
end
  
file "/home/app_user/.ssh/authorized_keys" do
  owner 'app_user'
end

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