Sha256: 008aacb7c7d3d1b6ac18ac1a3e9519723c0b6c841de1d6fccd6d81f894e0fe0d
Contents?: true
Size: 852 Bytes
Versions: 109
Compression:
Stored size: 852 Bytes
Contents
#!/usr/bin/env ruby # WANT_JSON # ^ i think this is something telling ansible to provide JSON args? require 'json' require 'shellwords' require 'pp' def main input = nil args = nil changed = false begin input = File.read ARGV[0] args = JSON.load input eval <<-END def in_sync? #{ args['pre'] || '' } #{ args['in_sync?'] } end END eval <<-END def sync #{ args['pre'] || '' } #{ args['sync'] } end END unless in_sync? sync changed = true end print JSON.dump({ 'changed' => changed, }) rescue Exception => e print JSON.dump({ 'failed' => true, 'msg' => e, # 'input' => input, 'args' => args, # 'ARGV' => ARGV, # 'ruby' => RUBY_VERSION, }) end end main if __FILE__ == $0
Version data entries
109 entries across 109 versions & 1 rubygems