Skip to content

Instantly share code, notes, and snippets.

@Sauraus
Created October 4, 2016 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sauraus/1960f986b3ce59aac6e42bede15bc2ad to your computer and use it in GitHub Desktop.
Save Sauraus/1960f986b3ce59aac6e42bede15bc2ad to your computer and use it in GitHub Desktop.
get command output back to recipe var
launchctl_list = ''
ruby_block 'Retrieve launchctl list' do
block do
Chef::Resource::RubyBlock.send(:include,Chef::Mixin::ShellOut)
launchctl_list = shell_out('launchctl list|awk \'{print $3}\'')
end
end
lazy launch_ctl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment