Skip to content

Commit f3897b9

Browse files
committed
Update mongodb to 030100a176a72a32e265b77790d8d15407a13729
030100a176a72a32e265b77790d8d15407a13729 Merge pull request redhat-openstack#205 from puppetlabs/travisci_update 1e6836103b5bbb5d737ee66677b6ad2ad04a791b Updated travisci file for Puppet 4 c50bdb74bed827d023ba885af2daa1082a96150e Merge pull request redhat-openstack#179 from atrepca/MODULES-1712 ab566b666bf02ff61bedc2fb83ab2715429f5053 Add $restart param to control service restarts Change-Id: I38c3aa2478e149d0af3a4b65b026b78c0f139cb9
1 parent 0bd5c10 commit f3897b9

8 files changed

Lines changed: 41 additions & 17 deletions

File tree

Puppetfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ mod 'module-data',
103103
:git => 'https://github.com/ripienaar/puppet-module-data.git'
104104

105105
mod 'mongodb',
106-
:commit => '14117ae3391862021555df8139c66fd04c13c0c3',
106+
:commit => '030100a176a72a32e265b77790d8d15407a13729',
107107
:git => 'https://github.com/puppetlabs/puppetlabs-mongodb.git'
108108

109109
mod 'mysql',

mongodb/.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,5 @@ matrix:
2020
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
2121
- rvm: 1.8.7
2222
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
23-
allow_failures:
24-
- rvm: 2.1.6
25-
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes"
2623
notifications:
2724
email: false

mongodb/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,13 @@ Default: <>
430430
#####`ssl_ca`
431431
Default: <>
432432

433-
434433
#####`service_manage`
435434
Whether or not the MongoDB service resource should be part of the catalog.
436435
Default: true
437436

437+
#####`restart`
438+
Specifies whether the service should be restarted on config changes. Default: 'true'
439+
438440
####Class: mongodb::mongos
439441
class. This class should only be used if you want to implement sharding within
440442
your mongodb deployment.
@@ -486,6 +488,9 @@ This setting can be used to specify if puppet should install the package or not
486488
This setting can be used to specify the name of the package that should be installed.
487489
If not specified, the module will use whatever service name is the default for your OS distro.
488490

491+
#####`restart`
492+
Specifies whether the service should be restarted on config changes. Default: 'true'
493+
489494
### Definitions
490495

491496
#### Definition: mongodb:db

mongodb/manifests/mongos.pp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,25 @@
1818
$fork = $mongodb::params::mongos_fork,
1919
$bind_ip = undef,
2020
$port = undef,
21+
$restart = $mongodb::params::mongos_restart,
2122
) inherits mongodb::params {
2223

2324
if ($ensure == 'present' or $ensure == true) {
24-
anchor { 'mongodb::mongos::start': }->
25-
class { '::mongodb::mongos::install': }->
26-
class { '::mongodb::mongos::config': }->
27-
class { '::mongodb::mongos::service': }->
28-
anchor { 'mongodb::mongos::end': }
25+
if $restart {
26+
anchor { 'mongodb::mongos::start': }->
27+
class { 'mongodb::mongos::install': }->
28+
# If $restart is true, notify the service on config changes (~>)
29+
class { 'mongodb::mongos::config': }~>
30+
class { 'mongodb::mongos::service': }->
31+
anchor { 'mongodb::mongos::end': }
32+
} else {
33+
anchor { 'mongodb::mongos::start': }->
34+
class { 'mongodb::mongos::install': }->
35+
# If $restart is false, config changes won't restart the service (->)
36+
class { 'mongodb::mongos::config': }->
37+
class { 'mongodb::mongos::service': }->
38+
anchor { 'mongodb::mongos::end': }
39+
}
2940
} else {
3041
anchor { 'mongodb::mongos::start': }->
3142
class { '::mongodb::mongos::service': }->

mongodb/manifests/mongos/config.pp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
owner => 'root',
2121
group => 'root',
2222
mode => '0644',
23-
notify => Class['mongodb::mongos::service']
2423
}
2524

2625
}

mongodb/manifests/params.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
$service_enable = pick($mongodb::globals::service_enable, true)
88
$service_ensure = pick($mongodb::globals::service_ensure, 'running')
99
$service_status = $mongodb::globals::service_status
10+
$restart = true
1011

1112
$mongos_service_manage = pick($mongodb::globals::mongos_service_manage, true)
1213
$mongos_service_enable = pick($mongodb::globals::mongos_service_enable, true)
1314
$mongos_service_ensure = pick($mongodb::globals::mongos_service_ensure, 'running')
1415
$mongos_service_status = $mongodb::globals::mongos_service_status
1516
$mongos_configdb = '127.0.0.1:27019'
17+
$mongos_restart = true
1618

1719
# Amazon Linux's OS Family is 'Linux', operating system 'Amazon'.
1820
case $::osfamily {

mongodb/manifests/server.pp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
$ssl = undef,
6565
$ssl_key = undef,
6666
$ssl_ca = undef,
67+
$restart = $mongodb::params::restart,
6768

6869
# Deprecated parameters
6970
$master = undef,
@@ -78,11 +79,21 @@
7879
}
7980

8081
if ($ensure == 'present' or $ensure == true) {
81-
anchor { 'mongodb::server::start': }->
82-
class { '::mongodb::server::install': }->
83-
class { '::mongodb::server::config': }->
84-
class { '::mongodb::server::service': }->
85-
anchor { 'mongodb::server::end': }
82+
if $restart {
83+
anchor { 'mongodb::server::start': }->
84+
class { 'mongodb::server::install': }->
85+
# If $restart is true, notify the service on config changes (~>)
86+
class { 'mongodb::server::config': }~>
87+
class { 'mongodb::server::service': }->
88+
anchor { 'mongodb::server::end': }
89+
} else {
90+
anchor { 'mongodb::server::start': }->
91+
class { 'mongodb::server::install': }->
92+
# If $restart is false, config changes won't restart the service (->)
93+
class { 'mongodb::server::config': }->
94+
class { 'mongodb::server::service': }->
95+
anchor { 'mongodb::server::end': }
96+
}
8697
} else {
8798
anchor { 'mongodb::server::start': }->
8899
class { '::mongodb::server::service': }->

mongodb/manifests/server/config.pp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
owner => 'root',
9898
group => 'root',
9999
mode => '0644',
100-
notify => Class['mongodb::server::service']
101100
}
102101

103102
file { $dbpath:

0 commit comments

Comments
 (0)