File: default.txt

package info (click to toggle)
highlight.js 10.7.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,332 kB
  • sloc: javascript: 41,059; makefile: 157; python: 29; sh: 20
file content (33 lines) | stat: -rw-r--r-- 975 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# EC2 sample

class ec2utils {

    # This must include the path to the Amazon EC2 tools
    $ec2path = ["/usr/bin", "/bin", "/usr/sbin", "/sbin",
                "/opt/ec2/ec2-api-tools/bin",
                "/opt/ec2/aws-elb-tools/bin"]

    define elasticip ($instanceid, $ip)
    {
        exec { "ec2-associate-address-$name":
            logoutput   => on_failure,
            environment => $ec2utils::ec2env,
            path        => $ec2utils::ec2path,
            command     => "ec2assocaddr $ip \
                                         -i $instanceid",
            # Only do this when necessary
            unless => "test `ec2daddr $ip | awk '{print \$3}'` == $instanceid",
        }
    }

    mount { "$mountpoint":
        device  => $devicetomount,
        ensure  => mounted,
        fstype  => $fstype,
        options => $mountoptions,
        require => [ Exec["ec2-attach-volume-$name"],
                     File["$mountpoint"]
        ],
    }

}