Commit 2df3e966 authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

trigger service restart on options file change

parent 3da75b43
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
[[_TOC_]]
# GCP Cloud SQL Proxy Puppet module

This module installs the GCP Cloud SQL Proxy software and configures its
@@ -6,7 +7,9 @@ instance of the Cloud SQL Proxy service. For more information on
configuration, see the [Cloud SQL Proxy Github
page](https://github.com/GoogleCloudPlatform/cloudsql-proxy).

Example:
## Examples
The `instances` is required parameter. It is an array to allow
multiple instances to be configured:
```
gcp_cloudsql_proxy { 'example1':
  instances => ["myg-gcp-project:us-west1:mysql-1=tcp:3306"],
+9 −6
Original line number Diff line number Diff line
@@ -26,17 +26,20 @@ define gcp_cloudsql_proxy(
    }
  }

  file { '/etc/cloudsql-proxy/options':
    ensure  => $ensure,
    content => template('gcp_cloudsql_proxy/etc/cloudsql-proxy/options.erb'),
  }

  # Make Sure cloudsql-proxy service is running.
  # Make sure the cloudsql-proxy service is running.
  service { 'cloudsql-proxy':
    ensure  => running,
    require => Package['cloudsql-proxy'],
  }

  # Configure the options file. If the options file changes, restart the
  # service.
  file { '/etc/cloudsql-proxy/options':
    ensure  => $ensure,
    content => template('gcp_cloudsql_proxy/etc/cloudsql-proxy/options.erb'),
    notify  => Service['cloudsql-proxy'],
  }

  file { '/etc/filter-syslog/cloudsql-proxy':
    ensure => $ensure,
    source => 'puppet:///modules/gcp_cloudsql_proxy/etc/filter-syslog/cloudsql-proxy',