From e3761072faaef6c3b3065bbe15562c2e5e04f9af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 22 Nov 2023 16:35:07 -1000 Subject: [PATCH] Remove legacy top-scope syntax --- CHANGELOG.md | 4 ++-- README.md | 14 +++++++------- examples/01_simple.md | 2 +- examples/02_simple.md | 4 ++-- examples/04_hiera.md | 2 +- examples/05_client.md | 4 ++-- manifests/init.pp | 2 +- manifests/peer.pp | 2 +- manifests/volume.pp | 8 ++++---- spec/classes/install_spec.rb | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4d5e3e9..f31dee5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,7 @@ These should not affect the functionality of the module. **Breaking changes:** - modulesync 2.7.0 and drop puppet 4 [\#193](https://github.com/voxpupuli/puppet-gluster/pull/193) ([bastelfreak](https://github.com/bastelfreak)) -- Add arm64, remove i386 compatibility from ::gluster::repo:apt [\#189](https://github.com/voxpupuli/puppet-gluster/pull/189) ([jacksgt](https://github.com/jacksgt)) +- Add arm64, remove i386 compatibility from gluster::repo:apt [\#189](https://github.com/voxpupuli/puppet-gluster/pull/189) ([jacksgt](https://github.com/jacksgt)) - Remove 3.8 repo, use pl-apt 4.4 https support, clean coding [\#170](https://github.com/voxpupuli/puppet-gluster/pull/170) ([ekohl](https://github.com/ekohl)) **Implemented enhancements:** @@ -246,7 +246,7 @@ These should not affect the functionality of the module. - Mounts can be defined but mount point will not be created [\#16](https://github.com/voxpupuli/puppet-gluster/issues/16) - refreshes to gluster::mount fail to remount the volume [\#10](https://github.com/voxpupuli/puppet-gluster/issues/10) - Support yum priorities [\#4](https://github.com/voxpupuli/puppet-gluster/issues/4) -- ::gluster::volume doesn't create volumes from hosts included in the volume [\#3](https://github.com/voxpupuli/puppet-gluster/issues/3) +- gluster::volume doesn't create volumes from hosts included in the volume [\#3](https://github.com/voxpupuli/puppet-gluster/issues/3) - A stopped volume aborts a Puppet run [\#1](https://github.com/voxpupuli/puppet-gluster/issues/1) **Merged pull requests:** diff --git a/README.md b/README.md index 6800ce3f..b21c4999 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ gluster::repo => false For Debian, the latest packages of the latest release will be installed by default. Otherwise, specify a version: ```puppet -class { ::gluster::repo: +class { gluster::repo: version => '3.5.2', } ``` @@ -67,7 +67,7 @@ For Ubuntu, the [Gluster PPA](https://launchpad.net/~gluster) repositories only Therefore specify the release to install: ```puppet -class { ::gluster::repo: +class { gluster::repo: release => '10', } ``` @@ -76,10 +76,10 @@ class { ::gluster::repo: For systems using YUM, the latest package from the 3.8 release branch will be installed. You can specify a specific version and release: ```puppet -class { ::gluster::repo: +class { gluster::repo: release => '3.7', } -class { ::gluster: +class { gluster: version => '3.7.12', } ``` @@ -113,7 +113,7 @@ On Debian-based systems, only the first two version places are significant ("x.y ### client.pp This class installs **only** the Gluster client package(s). If you need to install both the server and client, please use the `install.pp` (or `init.pp`) classes. - class { ::gluster::client: + class { gluster::client: repo => true, version => '3.5.2', } @@ -123,7 +123,7 @@ Use of `gluster::client` is not supported with either `gluster::install` or `glu ### service.pp This class manages the `glusterd` service. - class { ::gluster::service: + class { gluster::service: ensure => running, } @@ -138,7 +138,7 @@ The use of exported resources assume you're using PuppetDB, or some other backin If a `volumes` parameter is passed, the defined Gluster volume(s) can be created at the same time as the storage pool. See the volume defined type below for more details. - class { ::gluster: + class { gluster: repo => true, client => false, pool => 'production', diff --git a/examples/01_simple.md b/examples/01_simple.md index fe556b58..70855918 100644 --- a/examples/01_simple.md +++ b/examples/01_simple.md @@ -9,7 +9,7 @@ To create a simple two-node replicated Gluster volume, you could use the followi node /srv[1-2].local/ { # first, install Gluster using upstream packages - class { ::gluster: + class { gluster: server => true, client => true, repo => true, diff --git a/examples/02_simple.md b/examples/02_simple.md index e3b740b8..832806b0 100644 --- a/examples/02_simple.md +++ b/examples/02_simple.md @@ -10,7 +10,7 @@ To create a simple two-node replicated Gluster volume, you could use the followi node /srv[1-2].local/ { # first, install the upstream Gluster packages - class { ::gluster::install: + class { gluster::install: server => true, client => true, repo => true, @@ -18,7 +18,7 @@ To create a simple two-node replicated Gluster volume, you could use the followi } # make sure the service is started - class { ::gluster::service: + class { gluster::service: ensure => running, require => Class[::gluster::install], } diff --git a/examples/04_hiera.md b/examples/04_hiera.md index 1fafe741..622ca289 100644 --- a/examples/04_hiera.md +++ b/examples/04_hiera.md @@ -22,7 +22,7 @@ Your `/etc/puppet/hieradata/common.yaml` file could then contain: gluster::repo: true gluster::version: '3.5.2-1.el6' -You can then simply apply `class { ::gluster: }` to any hosts and they will use the upstream Gluster repo, install version 3.5.2-1.el6 of both the server and client, and join the `production` pool. +You can then simply apply `class { gluster: }` to any hosts and they will use the upstream Gluster repo, install version 3.5.2-1.el6 of both the server and client, and join the `production` pool. In this way, you could have two servers (srv1.local and srv2.local) operating in a different pool, with a different version of Gluster, and without the client packages installed, while all your other servers use the values from common.yaml. diff --git a/examples/05_client.md b/examples/05_client.md index efb9e5cc..f2072d33 100644 --- a/examples/05_client.md +++ b/examples/05_client.md @@ -19,7 +19,7 @@ define gluster_mount ( $options = undef, ) { if ! defined ( Class[::gluster::client] ) { - include ::gluster::client + include gluster::client } if ! defined ( File['/gluster'] ) { @@ -49,7 +49,7 @@ define gluster_mount ( if ! defined ( Gluster::Mount["/gluster/${title}"] ) and has_key( $gluster_mounts, $title ) { - ::gluster::mount { "/gluster/${title}": + gluster::mount { "/gluster/${title}": ensure => 'mounted', volume => $gluster_mounts[$title], options => $_options, diff --git a/manifests/init.pp b/manifests/init.pp index 19a1197d..4538ea6b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -17,7 +17,7 @@ # optional list of volumes (and their properties) to create # # @example -# class { ::gluster: +# class { gluster: # client => false, # server => true, # pool => 'production', diff --git a/manifests/peer.pp b/manifests/peer.pp index 387f0f27..8a42dafc 100644 --- a/manifests/peer.pp +++ b/manifests/peer.pp @@ -41,7 +41,7 @@ # we can't do much without the Gluster binary # but we don't necessarily want the Puppet run to fail if the # gluster_binary fact is absent! - if getvar('::gluster_binary') { + if getvar('gluster_binary') { # we can't join to ourselves, so it only makes sense to operate # on other gluster servers in the same pool if $fqdn != $facts['networking']['fqdn'] { diff --git a/manifests/volume.pp b/manifests/volume.pp index 9516bc80..5c30f5ad 100644 --- a/manifests/volume.pp +++ b/manifests/volume.pp @@ -101,7 +101,7 @@ $args = join(delete($cmd_args, ''), ' ') - if getvar('::gluster_binary') { + if getvar('gluster_binary') { # we need the Gluster binary to do anything! if $facts['gluster_volume_list'] and member( split( $facts['gluster_volume_list'], ',' ), $title ) { @@ -249,14 +249,14 @@ if ! empty($to_remove) { # we have some options active that are not defined here. Remove them # - # the syntax to remove ::gluster::volume::options is a little different + # the syntax to remove gluster::volume::options is a little different # so build up the hash correctly # $remove_opts = prefix( $to_remove, "${title}:" ) $remove_yaml = join( regsubst( $remove_opts, ': .+$', ":\n ensure: absent", 'G' ), "\n" ) $remove = parseyaml($remove_yaml) if $remove_options { - create_resources( ::gluster::volume::option, $remove ) + create_resources( gluster::volume::option, $remove ) } else { $remove_str = join( keys($remove), ', ' ) notice("NOT REMOVING the following options for volume ${title}: ${remove_str}.") @@ -267,7 +267,7 @@ $add_opts = prefix( $to_add, "${title}:" ) $add_yaml = join( regsubst( $add_opts, ': ', ":\n value: ", 'G' ), "\n" ) $add = parseyaml($add_yaml) - create_resources( ::gluster::volume::option, $add ) + create_resources( gluster::volume::option, $add ) } } } else { diff --git a/spec/classes/install_spec.rb b/spec/classes/install_spec.rb index a610111d..c8f53fb3 100644 --- a/spec/classes/install_spec.rb +++ b/spec/classes/install_spec.rb @@ -9,7 +9,7 @@ facts end let :pre_condition do - 'require ::gluster::service' + 'require gluster::service' end context 'with defaults' do