Skip to content

Commit

Permalink
Merge pull request #66 from puppetlabs/fix_remove
Browse files Browse the repository at this point in the history
Make NFS mounts optional
  • Loading branch information
MartyEwings authored Jun 22, 2021
2 parents de956db + 4c2bb0d commit 2cff0ef
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ The Puppet Enterprise Support team is opening an exciting Beta to help us remove
The Remote Support Service Beta is a combination of a Service provided by the Support team and Puppet Module named RSAN (Remote Support Access Node).
Puppet Enterprise Support will work with you to see how your organization can access the RSAN deployment and how that process should be implemented. , Currently we have two access options; direct as an incoming VPN connection from the Puppet Support Member, or a simple screen share on the video conferencing software of your choice.

**How you can get involved**
How you can get involved


<br>
As an existing Puppet Enterprise customer with access to the [Support Portal](http://support.puppet.com), open a Priority 4 ticket with the subject “Participate in the RSAN beta” and a support engineer will engage with you regarding access methods and any help installing the module you may need.


Expand Down Expand Up @@ -123,6 +123,15 @@ Console Class Declaration
["1.2.3.4"]
```

The RSAN::Exporter class allows for the NFS mounts to be optionally available, to disable existing mounts, or prevent the mounts from installing in the first place set the following parameter:


In Hiera

```
rsan::exporter::nfsmount: false
```

### PE Client tools

The RSAN node will deploy Puppet Client tools for use by Puppet Enterprise on the RSAN platform, For More information please see the Puppet Enterprise Documentation:
Expand Down Expand Up @@ -172,6 +181,7 @@ Where valid options for <pe_db_name> are:

To Uninstall RSAN from your Puppet Enterprise Infrastructure.


- Remove the following Classification:
rsan::exporter\
rsan::importer
Expand Down
19 changes: 15 additions & 4 deletions manifests/exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# The postgres group PE uses the default is pg_user
# @param [Optional[String]] pg_psql_path
# The path to the postgres binary in pe
# @param [Boolean] nfsmount
# Trigger to turn NFS Mounts On Or Off
# @example
# include rsan::exporter
class rsan::exporter (
Expand All @@ -20,16 +22,26 @@
Optional[String] $pg_user = 'pe-postgres',
Optional[String] $pg_group = $pg_user,
Optional[String] $pg_psql_path = '/opt/puppetlabs/server/bin/psql',
Boolean $nfsmount = true,
){

########################1. Export Logging Function######################
# Need to determine automatically the Network Fact IP for the RSAN::importer node automatically, applies to all infrastructure nodes
#########################################################################



class { '::nfs':
server_enabled => true
}


$ensure = $nfsmount ? {
true => 'mounted',
false => 'absent',
}


# Convert the array of RSAN IP address into an list of clients with options for the NFS export.
# This reduce will return a string of space deliminated IP addresses with the NFS options.
# For example, the output for ['1.2.3.4'] is " 1.2.3.4(ro,insecure,async,no_root_squash)"
Expand All @@ -42,28 +54,27 @@
$clients = "${_rsan_clients} localhost(ro)"

nfs::server::export{ '/var/log/':
ensure => 'mounted',
ensure => $ensure,
clients => $clients,
mount => "/var/pesupport/${facts['fqdn']}/log",
options_nfs => 'tcp,nolock,rsize=32768,wsize=32768,soft,noatime,actimeo=3,retrans=1',
nfstag => 'rsan',
}
nfs::server::export{ '/opt/puppetlabs/':
ensure => 'mounted',
ensure => $ensure,
clients => $clients,
mount => "/var/pesupport/${facts['fqdn']}/opt",
options_nfs => 'tcp,nolock,rsize=32768,wsize=32768,soft,noatime,actimeo=3,retrans=1',
nfstag => 'rsan',
}
nfs::server::export{ '/etc/puppetlabs/':
ensure => 'mounted',
ensure => $ensure,
clients => $clients,
mount => "/var/pesupport/${facts['fqdn']}/etc",
options_nfs => 'tcp,nolock,rsize=32768,wsize=32768,soft,noatime,actimeo=3,retrans=1',
nfstag => 'rsan',
}


######################2. Metrics Dash Board deployment ###############
# Assuming use of puppet metrics dashboard for telemetry all nodes need
# include puppet_metrics_dashboard::profile::master::install
Expand Down
7 changes: 2 additions & 5 deletions manifests/remove_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
# include rsan::remove_exporter
class rsan::remove_exporter {

#Disable NFS Server and revert config
#Disable NFS Server

file { '/etc/exports':
ensure => absent,
}

service {'nfs':
service {'nfs-server':
ensure => stopped,
}

Expand Down

0 comments on commit 2cff0ef

Please sign in to comment.