Skip to content

Instantly share code, notes, and snippets.

@logicminds
Created May 1, 2014 15:27
Show Gist options
  • Save logicminds/4357821679592bfaef1e to your computer and use it in GitHub Desktop.
Save logicminds/4357821679592bfaef1e to your computer and use it in GitHub Desktop.
puppet provider issue
#!/usr/bin/env bash
# first create the file with puppet just like sensu does
puppet apply --verbose -e 'file{"/tmp/testfile.txt": ensure => present, content => "foobar"}'
# now try to write to the file from ruby code (aka. the provide) just like puppet
cat > /tmp/providertest.rb << 'EOF'
#!/usr/bin/env ruby
File.open('/tmp/testfile.txt', 'w') do |file|
file.write('hello world')
end
EOF
ruby /tmp/providertest.rb
/tmp/testfile.txt
/tmp/providertest.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment