default.txt 975 B

123456789101112131415161718192021222324252627282930313233
  1. # EC2 sample
  2. class ec2utils {
  3. # This must include the path to the Amazon EC2 tools
  4. $ec2path = ["/usr/bin", "/bin", "/usr/sbin", "/sbin",
  5. "/opt/ec2/ec2-api-tools/bin",
  6. "/opt/ec2/aws-elb-tools/bin"]
  7. define elasticip ($instanceid, $ip)
  8. {
  9. exec { "ec2-associate-address-$name":
  10. logoutput => on_failure,
  11. environment => $ec2utils::ec2env,
  12. path => $ec2utils::ec2path,
  13. command => "ec2assocaddr $ip \
  14. -i $instanceid",
  15. # Only do this when necessary
  16. unless => "test `ec2daddr $ip | awk '{print \$3}'` == $instanceid",
  17. }
  18. }
  19. mount { "$mountpoint":
  20. device => $devicetomount,
  21. ensure => mounted,
  22. fstype => $fstype,
  23. options => $mountoptions,
  24. require => [ Exec["ec2-attach-volume-$name"],
  25. File["$mountpoint"]
  26. ],
  27. }
  28. }