# Note: This example is for /etc/salt/cloud.providers.d/gce.confgce-config: # Set up the Project name and Service Account authorization # project: "your_project_name" service_account_email_address: "123-a5gt@developer.gserviceaccount.com" service_account_private_key: "/path/to/your/NEW.pem" # Set up the location of the salt master # minion: master: saltmaster.example.com # Set up grains information, which will be common for all nodes # using this provider grains: node_type: broker release: 1.0.1 provider: gce
# Compute Engine.ppgce_instance { 'ryan-compute': ensure => present, machine_type => 'n1-standard-1', zone => 'us-central1-a', network => 'default', image => 'projects/centos-cloud/global/images/centos-6-v20131120',}ryan:gce ryan$ puppet apply Compute Engine.ppNotice: /Stage[main]//gce_instance[ryan-compute]/ensure: created
gce_instance { ['web1', 'web2']: ensure => present, description => 'web server', machine_type => 'n1-standard-1', zone => 'us-central1-a', network => 'default', image => 'projects/centos-cloud/global/images/centos-6-v20131120', tags => ['web'], modules => ['puppetlabs-apache', 'puppetlabs-stdlib', 'puppetlabs-concat', 'puppetlabs-firewall'], manifest => 'include apache firewall { "100 allow http access on host": port => 80, proto => tcp, action => accept, }', }gce_firewall { 'allow-http': ensure => present, network => 'default', description => 'allows incoming HTTP connections', allowed => 'tcp:80',}gce_httphealthcheck { 'basic-http': ensure => present, require => gce_instance['web1', 'web2'], description => 'basic http health check',}gce_targetpool { 'web-pool': ensure => present, require => gce_httphealthcheck['basic-http'], health_checks => 'basic-http', instances => 'us-central1-a/web1,us-central1-b/web2', region => 'us-central1',}gce_forwardingrule { 'web-lb': ensure => present, description => 'Forward HTTP to web instances', port_range => '80', region => 'us-central1', target => 'web-pool', require => gce_targetpool['web-pool'],}
gce_instance { 'puppet-enterprise-master': ensure => present, description => 'An evaluation Puppet Enterprise Master and Console', machine_type => 'n1-standard-1', zone => 'us-central1-a', network => 'default', image => 'projects/centos-cloud/global/images/centos-6-v20131120', tags => ['puppet', 'master'], startupscript => 'puppet-enterprise.sh', metadata => { 'pe_role' => 'master', 'pe_version' => '3.2.0', 'pe_consoleadmin' => 'admin@example.com', 'pe_consolepwd' => 'puppetize', }, block_for_startup_script => true,}gce_instance { 'agent1': ensure => present, zone => 'us-central1-a', machine_type => 'f1-micro', network => 'default', image => 'projects/centos-cloud/global/images/centos-6-v20131120', startupscript => 'puppet-enterprise.sh', metadata => { 'pe_role' => 'agent', 'pe_master' => 'puppet-enterprise-master', 'pe_version' => '3.2.0', }, tags => ['puppet', 'agent'], require => gce_instance["puppet-enterprise-master"],}
gem install knife-googleknife google setup
knife
knife google server create jenkins1 -Z us-central1-a -m n1-highcpu-2 -I centos-6-v20140415 -r 'java,jenkins::master' -x $USER -i $HOME/.ssh/google_compute_engine
Chef Client finished, 19/21 resources updated in 40.207903203 seconds
# Commands like this destroy unneeded nodesknife google server delete tester1 -y --purge
Use promo code NEXT1720 to save $300 off general admission