Skip to content

Commit

Permalink
Merge pull request #254 from voxpupuli/remove-legacy-top-scope-syntax
Browse files Browse the repository at this point in the history
Remove legacy top-scope syntax
  • Loading branch information
kenyon authored Nov 23, 2023
2 parents b06fc9f + e376107 commit eb366c9
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**
Expand Down Expand Up @@ -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:**
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
```
Expand All @@ -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',
}
```
Expand All @@ -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',
}
```
Expand Down Expand Up @@ -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',
}
Expand All @@ -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,
}

Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion examples/01_simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions examples/02_simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ 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,
version => '3.5.2',
}

# make sure the service is started
class { ::gluster::service:
class { gluster::service:
ensure => running,
require => Class[::gluster::install],
}
Expand Down
2 changes: 1 addition & 1 deletion examples/04_hiera.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions examples/05_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define gluster_mount (
$options = undef,
) {
if ! defined ( Class[::gluster::client] ) {
include ::gluster::client
include gluster::client
}
if ! defined ( File['/gluster'] ) {
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# optional list of volumes (and their properties) to create
#
# @example
# class { ::gluster:
# class { gluster:
# client => false,
# server => true,
# pool => 'production',
Expand Down
2 changes: 1 addition & 1 deletion manifests/peer.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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'] {
Expand Down
8 changes: 4 additions & 4 deletions manifests/volume.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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}.")
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
facts
end
let :pre_condition do
'require ::gluster::service'
'require gluster::service'
end

context 'with defaults' do
Expand Down

0 comments on commit eb366c9

Please sign in to comment.