Added the ability to manage tomcat & java setup
Added $manage_app_server and $install_java params in order to be able to whether install tomcat & java or not, and avoid puppet executions to fail because of duplicated class declarations. Change-Id: I644e448a28ca324a9c3be4866642db220db988f5
This commit is contained in:
parent
c34b43a248
commit
4b530c02c9
34
README.md
34
README.md
@ -139,6 +139,21 @@ You can alternatively use the Hiera's yaml style:
|
||||
- 'host2'
|
||||
- 'host3'
|
||||
|
||||
Note: midonet\_agent class already makes a call to midonet\_agent::install.
|
||||
This class allows to choose whether you want it to install and manage Java, or
|
||||
use an existing installations instead.
|
||||
|
||||
For this purpose a param has been added and its value has been defaulted to
|
||||
'true'. Should you want to manage the Java installation from another puppet
|
||||
module and avoid duplicated class declaration, change the value to 'false':
|
||||
|
||||
class { 'midonet::midonet_agent::install':
|
||||
install_java => false
|
||||
}
|
||||
|
||||
You can alternatively use the Hiera's yaml style:
|
||||
|
||||
midonet::midonet_agent::install::install_java: false
|
||||
|
||||
#### MidoNet API
|
||||
|
||||
@ -184,6 +199,25 @@ You can alternatively use the Hiera's yaml style:
|
||||
|
||||
Please note that Zookeeper port is not mandatory and defaulted to 2181.
|
||||
|
||||
Note: midonet\_api class already makes a call to midonet\_api::install. This
|
||||
class allows you to choose whether you want it to install and manage Tomcat and
|
||||
Java, or use existing installations of both instead.
|
||||
|
||||
For this purpose 2 parameters have been added and their values have been
|
||||
defaulted to 'true'. Should you want to manage Tomcat and Java installation
|
||||
from another puppet module and avoid duplicated class declaration, change the
|
||||
values to 'false':
|
||||
|
||||
class { 'midonet::midonet_api::install':
|
||||
install_java => false,
|
||||
manage_app_server => false
|
||||
}
|
||||
|
||||
You can alternatively use the Hiera's yaml style:
|
||||
|
||||
midonet::midonet_api::install::install_java: false
|
||||
midonet::midonet_api::install::manage_app_server: false
|
||||
|
||||
#### MidoNet CLI
|
||||
|
||||
Install the MidoNetCLI this way:
|
||||
|
@ -8,3 +8,9 @@ midonet::zookeeper::server_id: '1'
|
||||
midonet::cassandra::seeds:
|
||||
- 'localhost'
|
||||
midonet::cassandra::seed_address: 'localhost'
|
||||
|
||||
# Choose whether to manage Tomcat and Java installation (true) or use an
|
||||
# existing installation instead (false).
|
||||
midonet::midonet_agent::install::install_java: true
|
||||
midonet::midonet_api::install::manage_app_server: true
|
||||
midonet::midonet_api::install::install_java: true
|
||||
|
@ -22,19 +22,24 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
class midonet::midonet_agent::install {
|
||||
class midonet::midonet_agent::install (
|
||||
$install_java = true
|
||||
) {
|
||||
|
||||
require midonet::repository
|
||||
require midonet::repository
|
||||
|
||||
if ($install_java == true) {
|
||||
if ! defined(Class['java']) {
|
||||
class {'java':
|
||||
distribution => 'jre',
|
||||
require => Exec['update-midonet-repos']
|
||||
}
|
||||
class { 'java':
|
||||
distribution => 'jre',
|
||||
require => Exec['update-midonet-repos']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
package {'midolman':
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
package {'midolman':
|
||||
ensure => present,
|
||||
require => Class['java']
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,24 +22,35 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
class midonet::midonet_api::install {
|
||||
class midonet::midonet_api::install (
|
||||
$install_java = true,
|
||||
$manage_app_server = true
|
||||
) {
|
||||
|
||||
require midonet::repository
|
||||
require midonet::midonet_api::augeas
|
||||
|
||||
if ! defined(Class['java']) {
|
||||
class {'java':
|
||||
distribution => 'jre',
|
||||
require => Exec['update-midonet-repos']
|
||||
if ($manage_app_server == true) {
|
||||
if ($install_java == true) {
|
||||
if ! defined(Class['java']) {
|
||||
class { 'java':
|
||||
distribution => 'jre',
|
||||
require => Exec['update-midonet-repos']
|
||||
} ->
|
||||
|
||||
class { 'tomcat':
|
||||
install_from_source => false,
|
||||
require => Exec['update-midonet-repos']
|
||||
}
|
||||
} else {
|
||||
class { 'tomcat':
|
||||
install_from_source => false,
|
||||
require => Exec['update-midonet-repos']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class {'tomcat':
|
||||
install_from_source => false,
|
||||
require => [Class['java'],
|
||||
Exec['update-midonet-repos']]
|
||||
} ->
|
||||
|
||||
package {'midonet-api':
|
||||
ensure => present,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user