If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Bare Metal Provisioning 2008 Puppet: Correct Gapi manifest

RESOLVED FIXED

Status

Infrastructure & Operations
RelOps: Puppet
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: markco, Assigned: markco)

Tracking

Details

(Whiteboard: [time=1:30])

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
> ::: 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)

Updated

3 years ago
Assignee: relops → mcornmesser
Blocks: 979540
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.
(Assignee)

Updated

3 years ago
Whiteboard: [time=1:30]
(Assignee)

Comment 2

3 years ago
Created attachment 8475225 [details] [diff] [review]
bug1035898.patch
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+
Attachment #8475225 - Flags: checked-in+
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.