biemond / biemond-oradb

Puppet Oracle Database Module
Apache License 2.0
59 stars 113 forks source link

How does one create multiple entries in the tnsnames.ora file? #292

Open bschonec opened 1 year ago

bschonec commented 1 year ago

I need to manage a tnsnames.ora file that has ninety entries. I've been successful in creating a single entry but now that I want multiple entries in the same tnsnames.ora file I'm running into what I believe is room for improvement in the Puppet module.

Take the example hiera data:

oradb::tnsnames:
  'MANCT16.EXAMPLE.COM':
    oracle_home: /root/test/oracle
    user: wmsadmin
    group: wmsadmin
    #loadbalance: 'ON'
    connect_service_name: DMANCT16
    server:
      myserver1:
        host: example1-ora-01
        port: 1556
        protocol: tcp 
      myserver2:
        host: example2-ora-02
        port: 1556
        protocol: tcp 

  'DMANCT16.EXAMPLE.COM':
    oracle_home: /root/test/oracle
    connect_service_name: DMANCT16
    server:
      myserver1:
        host: example2-ora-01
        port: 1556
        protocol: tcp 
      myserver2:
        host: example2-ora-02
        port: 1556
        protocol: tcp 

Shouldn't there be a better way of configuring this without having to specify the "oracle_home:" parameter for each item in the hash? If I have multiple entries, then it's implied that I'm modifying the same file. The same applies to the user: and group: parameters although omitting those parameters in "n+1" item of the hash doesn't cause an error in compiling.