Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ class { 'ngrok':
}
```

## Get rid of old configuration files if ngrok is already installed

If ngrok is already installed, older configuration files may be defined at /home/username/.ngrok2/ngrok.yml. You can use $manage_all_configs to remove these old configurations as they may apply prior to any configuration set by Puppet (the default is false and will leave these files intact).

```puppet
class { 'ngrok':
manage_all_configs => true,
}
```

## Start ngrok, but don't start tunnels

You might want to define a bunch of tunnels, and have ngrok running, but not have it automatically start any of those tunnels. Use the `service_tunnels` parameter to instruct ngrok to not automatically enable any tunnels.
Expand Down
12 changes: 12 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@

# Parameter to manage unzip which is required by the archive resource.
Boolean $manage_unzip = false,

# Parameter to manage existing configuration files, as these may interfere with this module
Boolean $manage_all_configs = false,
) {

# Let's make sure ..
Expand All @@ -45,6 +48,15 @@
}
}

# Remove existing ngrok configurations if they exist
if ( $manage_all_configs ) {
tidy { 'old ngrok configs':
path => '/home',
matches => 'ngrok.yml',
recurse => true,
}
}

# Download the package and uncompress it into a bin directory.
archive { '/tmp/ngrok.zip':
source => $download_url,
Expand Down