puppetlabs/puppetlabs-gce_compute — pull request #12 by erjohnso (2013-05-13 21:37:21+00:00)
Title: Updating to latest gcutil 1.7.2 release

A few minor changes were necessary to support the latest version of gcutil 1.7.2. Most notably were that --project_id has been renamed to --project. I also changed "machine" to "machine_type" to better match upstream documentation.

Note that I also made a few changes to the RSpec tests to get them to work with the latest releases of mocha and rspec. This proved to be the most challenging aspect of updating the project. Development was done on a current Debian "wheezy", puppet v2.7.18-4 that ships with wheezy, mocha 0.13.3, rake 10.0.4, rspec* 2.13.x.

Sample manifest used during development [/etc/puppet/manifests/site.pp]:
```
gce_network { 'test-puppet-network':
ensure => present,
description => 'network created with puppet',
range => '192.168.0.0/16',
gateway => '192.168.0.1',
}
gce_disk { 'test-puppet-disk':
ensure => present,
description => 'small test disk',
size_gb => '2',
zone => 'us-central2-a',
}
gce_firewall { 'test-puppet-firewall':
ensure => present,
network => 'test-puppet-network',
description => 'allows incoming finger connections',
allowed => 'tcp:79',
}
gce_instance { 'test-puppet-1':
ensure => present,
description => 'a test VM',
disk => 'test-puppet-disk',
machine_type => 'n1-standard-1',
zone => 'us-central2-a',
network => 'test-puppet-network',
image => 'projects/google/global/images/gcel-12-04-v20130325',
tags => [test, 'one']
}
```

Example output:
```
# puppet apply --certname erjohnso_project /etc/puppet/manifests/site.pp
notice: /Stage[main]//Gce_disk[test-puppet-disk]/ensure: created
notice: /Stage[main]//Gce_network[test-puppet-network]/ensure: created
notice: /Stage[main]//Gce_instance[test-puppet-1]/ensure: created
notice: /Stage[main]//Gce_firewall[test-puppet-firewall]/ensure: created
notice: Finished catalog run in 65.74 seconds
```