Closed Bug 1035898 Opened 10 years ago Closed 10 years ago

Bare Metal Provisioning 2008 Puppet: Correct Gapi manifest

Categories

(Infrastructure & Operations :: RelOps: Puppet, task)

x86_64
Windows 7
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: markco, Assigned: markco)

Details

(Whiteboard: [time=1:30])

Attachments

(1 file)

> ::: modules/slave_secrets/manifests/google_api_key.pp
> @@ +12,2 @@
> >                  content => secret("google_api_key"),
> > +            }
> 
> This bit should be within the conditional for ensure == present and
> install_google_api_key.
> 
> ::: modules/ssh/manifests/winfiles.pp
> @@ +1,4 @@

Windows is now included within the conditional:

class slave_secrets::google_api_key($ensure=present) {
    include config
    include dirs::builds

        if ($ensure == 'present' and $config::install_google_api_key) {
            case $::operatingsystem {
                windows: {
                    file {
                        'C:/builds/gapi.data':
                            ensure => file,
                            content => secret("google_api_key"),
                    }
                }
                default: {
                    file {
                        "/builds/gapi.data":
                        content => secret("google_api_key"),
                        mode    => 0644,
                        show_diff => false;
                    }
                }
        }
        } else {
             case $::operatingsystem {
                windows: {
                    file {
                      'C:/builds/gapi.data':
                            ensure => absent;
                    }
                }
                default: {
                    file {
                        "/builds/gapi.data":
                            ensure => absent;
                }
            }
        }
    }
}
Assignee: relops → mcornmesser
Looks good.  You could shrink that a little with

  $gapi_file = $::operatingsystem? {
      windows => 'c:/builds/gapi.data',
      default => '/builds/gapi.data'
  }

..

                    file {
                        $gapi_file:
                            ensure => file,
                            content => secret("google_api_key"),
                    }

with no need for both conditionals.
Whiteboard: [time=1:30]
Attached patch bug1035898.patchSplinter Review
Attachment #8475225 - Flags: review?(dustin)
Comment on attachment 8475225 [details] [diff] [review]
bug1035898.patch

No need for the extra license header, but otherwise looks good.
Attachment #8475225 - Flags: review?(dustin) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: