biemond/biemond-oradb — pull request #35 by ricciocri (2014-11-20 22:38:52+00:00)
Title: Modified tnsnames management to allow a balanced configuration

Hello and thanks for your great module.
In our puppet environment we manage some oracle client that have a configuration similar to:

mydb =
(DESCRIPTION =
(ADDRESS_LIST=
(LOAD_BALANCE = ON)
(FAILOVER = ON)
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.1)(PORT = 1522))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = myservice)
)
)

So, to be able to use your tnsnames define I've done some small changes.
The biggest change it's the fact that instead of 3 variables (host,port and protocol) I configure an hash, and when we have multiple hash I write a "balanced" configuration.

I've tested this with 1 hash (will write a file like your before) and with 2, and everything seem to work fine (tested on debian 7).

Also there were a small typo on templates/tnsnames.erb that I've fixed:

- (SERVER = <%= @connectServiceName %>)
+ (SERVER = <%= @connectServer %>)

Best regards

Riccardo