Skip to content

Instantly share code, notes, and snippets.

@matsumotory
Last active November 16, 2015 07:35
Show Gist options
  • Select an option

  • Save matsumotory/eb0e276466ce90b4f256 to your computer and use it in GitHub Desktop.

Select an option

Save matsumotory/eb0e276466ce90b4f256 to your computer and use it in GitHub Desktop.
execute "pwd" do
user "norikra"
cwd "/tmp"
not_if "pwd; false"
only_if "pwd; true"
end
$ itamae ssh --vagrant cwd.rb -l debug
INFO : Starting Itamae...
DEBUG : Executing `mkdir -p /tmp/itamae_tmp`...
DEBUG : exited with 0
DEBUG : Executing `chmod 777 /tmp/itamae_tmp`...
DEBUG : exited with 0
INFO : Recipe: /Users/matsumoto_r/DEV/PEPABO/build-itamae-fng/cwd.rb
DEBUG : execute[pwd]
DEBUG : Executing `sudo -H -u norikra -- /bin/sh -c pwd\;\ true`...
DEBUG : stdout | /home/vagrant
DEBUG : exited with 0
DEBUG : Executing `sudo -H -u norikra -- /bin/sh -c pwd\;\ false`...
DEBUG : stdout | /home/vagrant
DEBUG : exited with 1
DEBUG : execute[pwd] action: run
DEBUG : (in pre_action)
DEBUG : (in set_current_attributes)
DEBUG : (in show_differences)
INFO : execute[pwd] executed will change from 'false' to 'true'
DEBUG : Executing `sudo -H -u norikra -- /bin/sh -c cd\ /tmp\ \&\&\ pwd`...
DEBUG : stdout | /tmp
DEBUG : exited with 0
DEBUG : This resource is updated.
DEBUG : This resource is updated.
$ itamae version
Itamae v1.3.6
@matsumotory
Copy link
Author

バージョンアップすると無事解決しました!お騒がせしてすみません。

$ itamae version
Itamae v1.6.3
$ itamae ssh --vagrant cwd.rb -l debug
 INFO : Starting Itamae...
DEBUG : Executing `mkdir -p /tmp/itamae_tmp`...
DEBUG :   exited with 0
DEBUG : Executing `chmod 777 /tmp/itamae_tmp`...
DEBUG :   exited with 0
 INFO : Recipe: /Users/matsumoto_r/DEV/PEPABO/build-itamae-fng/cwd.rb
DEBUG :   execute[pwd]
DEBUG :     Executing `sudo -H -u norikra -- /bin/sh -c cd\ \~norikra\ \;\ cd\ /tmp\ \&\&\ pwd\;\ true`...
DEBUG :       stdout | /tmp
DEBUG :       exited with 0
DEBUG :     Executing `sudo -H -u norikra -- /bin/sh -c cd\ \~norikra\ \;\ cd\ /tmp\ \&\&\ pwd\;\ false`...
DEBUG :       stdout | /tmp
DEBUG :       exited with 1
DEBUG :     execute[pwd] action: run
DEBUG :       (in pre_action)
DEBUG :       (in set_current_attributes)
DEBUG :       (in show_differences)
 INFO :       execute[pwd] executed will change from 'false' to 'true'
DEBUG :       Executing `sudo -H -u norikra -- /bin/sh -c cd\ \~norikra\ \;\ cd\ /tmp\ \&\&\ pwd`...
DEBUG :         stdout | /tmp
DEBUG :         exited with 0
DEBUG :       This resource is updated.
DEBUG :       This resource is updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment