[chef] Ho to restart service if aws_s3_file file changes


Chronological Thread 
  • From: David Montgomery < >
  • To:
  • Subject: [chef] Ho to restart service if aws_s3_file file changes
  • Date: Thu, 10 Jul 2014 11:09:54 +0800


Hi,

I am using aws s3 to download a file and if the file changes then restart a service


execute "restart-rexster" do
  command "supervisorctl restart rexster_server:"
  action :nothing
end

 aws_s3_file "/var/titan-#{feature}-#{version}/rexhome/scripts/VersionControl.groovy" do
    bucket "testbucket"
    remote_path "#{node.chef_environment}/VersionControl.groovy"
    aws_access_key_id aws['AWS_ACCESS_KEY_ID']
    aws_secret_access_key aws['AWS_SECRET_ACCESS_KEY']
    notifies :run, 'execute[restart-rexster]'
    creates "/var/titan-#{feature}-#{version}/rexhome/scripts/VersionControl.groovy"
  end


So..with the above....does the aws_s3 resource support 'creates'?  And...is it not the case that if the file checksum changes then 'execute[restart-rexster]' will be executed?

Thanks



Archive powered by MHonArc 2.6.16.

§