Inspecting WebLogic with Puppet

Published on: Category: Oracle

I recently discussed Puppet with some colleagues and the added value it adds to infrastructure-related issues. The reason we focused on Puppet was because of the superb WebLogic and Oracle database support that exists for it. There are modules for WebLogic in Chef, but these only install the software. With Puppet, you can manage much more.

Many blogs that mention Puppet tend to focus on how you can provision the software. In almost all of my customer cases, WebLogic is already responsible for serving applications like SOA Suite, ADF or bespoke Java applications. Surely we should be able to show the power of Puppet for existing systems as well!

In this blog, I’ll discuss the Oracle SOA Suite 12.1.3 box, which you can download here. All I had to do was start SOA Suite using the desktop shortcuts.

Step 1: install Puppet

Installing Puppet on RHEL was easy. I only needed to import the Yum repository used by Puppet – the company – to serve the RPM and then install the Puppet agent. In the SOA Suite Box, a proxy was active, which prevented me from connecting.  

  1. [oracle@soa-training ~]$ yum search puppet
  2. Loaded plugins: refresh-packagekit, ulninfo
  3. http://public-yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 5 - "Couldn't resolve proxy 'www-proxy.us.oracle.com'"
  4. Trying other mirror.
  5. Error: Cannot retrieve repository metadata (repomd.xml) for repository: public_ol6_UEK_latest. Please verify its path and try again

The solution to this problem was to open /etc/yum.conf and comment or delete the proxy entry. After I did this, I could connect to the public repositories. Make sure to accept the key Puppet uses to identify and sign their packages.

  1. [root@soa-training ~]# sudo rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
  2. Retrieving https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
  3. Preparing... ########################################### [100%]
  4. 1:puppetlabs-release ########################################### [100%]
  5. [root@soa-training ~]# yum install puppet
  6. Loaded plugins: refresh-packagekit, ulninfo
  7. Setting up Install Process
  8. public_ol6_UEK_latest | 1.2 kB 00:00
  9. public_ol6_UEK_latest/primary | 31 MB 00:25
  10. public_ol6_UEK_latest 652/652
  11. public_ol6_addons | 1.2 kB 00:00
  12. public_ol6_addons/primary | 136 kB 00:00
  13. public_ol6_addons 431/431
  14. public_ol6_latest | 1.4 kB 00:00
  15. public_ol6_latest/primary | 62 MB 00:37
  16. public_ol6_latest 37021/37021
  17. puppetlabs-deps | 2.5 kB 00:00
  18. puppetlabs-deps/primary_db | 27 kB 00:00
  19. puppetlabs-products | 2.5 kB 00:00
  20. puppetlabs-products/primary_db | 170 kB 00:00
  21. Resolving Dependencies
  22. --> Running transaction check
  23. ---> Package puppet.noarch 0:3.8.7-1.el6 will be installed
  24. --> Processing Dependency: ruby >= 1.8.7 for package: puppet-3.8.7-1.el6.noarch
  25. --> Processing Dependency: ruby >= 1.8 for package: puppet-3.8.7-1.el6.noarch
  26. --> Processing Dependency: facter >= 1:1.7.0 for package: puppet-3.8.7-1.el6.noarch
  27. --> Processing Dependency: hiera >= 1.0.0 for package: puppet-3.8.7-1.el6.noarch
  28. --> Processing Dependency: ruby-shadow for package: puppet-3.8.7-1.el6.noarch
  29. --> Processing Dependency: ruby-augeas for package: puppet-3.8.7-1.el6.noarch
  30. --> Processing Dependency: rubygem-json for package: puppet-3.8.7-1.el6.noarch
  31. --> Processing Dependency: ruby(selinux) for package: puppet-3.8.7-1.el6.noarch
  32. --> Processing Dependency: /usr/bin/ruby for package: puppet-3.8.7-1.el6.noarch
  33. --> Running transaction check
  34. ---> Package facter.x86_64 1:2.4.6-1.el6 will be installed
  35. --> Processing Dependency: pciutils for package: 1:facter-2.4.6-1.el6.x86_64
  36. --> Processing Dependency: virt-what for package: 1:facter-2.4.6-1.el6.x86_64
  37. ---> Package hiera.noarch 0:1.3.4-1.el6 will be installed
  38. ---> Package libselinux-ruby.x86_64 0:2.0.94-7.el6 will be installed
  39. --> Processing Dependency: libselinux = 2.0.94-7.el6 for package: libselinux-ruby-2.0.94-7.el6.x86_64
  40. ---> Package ruby.x86_64 0:1.8.7.374-4.el6_6 will be installed
  41. --> Processing Dependency: ruby-libs = 1.8.7.374-4.el6_6 for package: ruby-1.8.7.374-4.el6_6.x86_64
  42. --> Processing Dependency: libruby.so.1.8()(64bit) for package: ruby-1.8.7.374-4.el6_6.x86_64
  43. ---> Package ruby-augeas.x86_64 0:0.4.1-3.el6 will be installed
  44. --> Processing Dependency: augeas-libs >= 0.8.0 for package: ruby-augeas-0.4.1-3.el6.x86_64
  45. --> Processing Dependency: libaugeas.so.0(AUGEAS_0.11.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64
  46. --> Processing Dependency: libaugeas.so.0(AUGEAS_0.8.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64
  47. --> Processing Dependency: libaugeas.so.0(AUGEAS_0.12.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64
  48. --> Processing Dependency: libaugeas.so.0(AUGEAS_0.10.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64
  49. --> Processing Dependency: libaugeas.so.0(AUGEAS_0.1.0)(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64
  50. --> Processing Dependency: libaugeas.so.0()(64bit) for package: ruby-augeas-0.4.1-3.el6.x86_64
  51. ---> Package ruby-shadow.x86_64 1:2.2.0-2.el6 will be installed
  52. ---> Package rubygem-json.x86_64 0:1.5.5-3.el6 will be installed
  53. --> Processing Dependency: rubygems >= 1.3.7 for package: rubygem-json-1.5.5-3.el6.x86_64
  54. --> Running transaction check
  55. ---> Package augeas-libs.x86_64 0:1.0.0-10.el6 will be installed
  56. ---> Package libselinux.x86_64 0:2.0.94-5.8.el6 will be updated
  57. --> Processing Dependency: libselinux = 2.0.94-5.8.el6 for package: libselinux-utils-2.0.94-5.8.el6.x86_64
  58. --> Processing Dependency: libselinux = 2.0.94-5.8.el6 for package: libselinux-python-2.0.94-5.8.el6.x86_64
  59. ---> Package libselinux.x86_64 0:2.0.94-7.el6 will be an update
  60. ---> Package pciutils.x86_64 0:3.1.10-4.el6 will be installed
  61. ---> Package ruby-libs.x86_64 0:1.8.7.374-4.el6_6 will be installed
  62. --> Processing Dependency: libreadline.so.5()(64bit) for package: ruby-libs-1.8.7.374-4.el6_6.x86_64
  63. ---> Package rubygems.noarch 0:1.3.7-5.el6 will be installed
  64. --> Processing Dependency: ruby-rdoc for package: rubygems-1.3.7-5.el6.noarch
  65. ---> Package virt-what.x86_64 0:1.11-1.2.el6 will be installed
  66. --> Running transaction check
  67. ---> Package compat-readline5.x86_64 0:5.2-17.1.el6 will be installed
  68. ---> Package libselinux-python.x86_64 0:2.0.94-5.8.el6 will be updated
  69. ---> Package libselinux-python.x86_64 0:2.0.94-7.el6 will be an update
  70. ---> Package libselinux-utils.x86_64 0:2.0.94-5.8.el6 will be updated
  71. ---> Package libselinux-utils.x86_64 0:2.0.94-7.el6 will be an update
  72. ---> Package ruby-rdoc.x86_64 0:1.8.7.374-4.el6_6 will be installed
  73. --> Processing Dependency: ruby-irb = 1.8.7.374-4.el6_6 for package: ruby-rdoc-1.8.7.374-4.el6_6.x86_64
  74. --> Running transaction check
  75. ---> Package ruby-irb.x86_64 0:1.8.7.374-4.el6_6 will be installed
  76. --> Finished Dependency Resolution
  77.  
  78. Dependencies Resolved
  79.  
  80. =============================================================================================================================================================================================================================================
  81. Package Arch Version Repository Size
  82. =============================================================================================================================================================================================================================================
  83. Installing:
  84. puppet noarch 3.8.7-1.el6 puppetlabs-products 1.6 M
  85. Installing for dependencies:
  86. augeas-libs x86_64 1.0.0-10.el6 public_ol6_latest 315 k
  87. compat-readline5 x86_64 5.2-17.1.el6 public_ol6_latest 129 k
  88. facter x86_64 1:2.4.6-1.el6 puppetlabs-products 99 k
  89. hiera noarch 1.3.4-1.el6 puppetlabs-products 23 k
  90. libselinux-ruby x86_64 2.0.94-7.el6 public_ol6_latest 99 k
  91. pciutils x86_64 3.1.10-4.el6 public_ol6_latest 85 k
  92. ruby x86_64 1.8.7.374-4.el6_6 public_ol6_latest 538 k
  93. ruby-augeas x86_64 0.4.1-3.el6 puppetlabs-deps 21 k
  94. ruby-irb x86_64 1.8.7.374-4.el6_6 public_ol6_latest 317 k
  95. ruby-libs x86_64 1.8.7.374-4.el6_6 public_ol6_latest 1.7 M
  96. ruby-rdoc x86_64 1.8.7.374-4.el6_6 public_ol6_latest 380 k
  97. ruby-shadow x86_64 1:2.2.0-2.el6 puppetlabs-deps 13 k
  98. rubygem-json x86_64 1.5.5-3.el6 puppetlabs-deps 763 k
  99. rubygems noarch 1.3.7-5.el6 public_ol6_latest 206 k
  100. virt-what x86_64 1.11-1.2.el6 public_ol6_latest 23 k
  101. Updating for dependencies:
  102. libselinux x86_64 2.0.94-7.el6 public_ol6_latest 108 k
  103. libselinux-python x86_64 2.0.94-7.el6 public_ol6_latest 202 k
  104. libselinux-utils x86_64 2.0.94-7.el6 public_ol6_latest 82 k
  105.  
  106. Transaction Summary
  107. =============================================================================================================================================================================================================================================
  108. Install 16 Package(s)
  109. Upgrade 3 Package(s)
  110.  
  111. Total download size: 6.6 M
  112. Is this ok [y/N]: y
  113. Downloading Packages:
  114. (1/19): augeas-libs-1.0.0-10.el6.x86_64.rpm | 315 kB 00:00
  115. (2/19): compat-readline5-5.2-17.1.el6.x86_64.rpm | 129 kB 00:00
  116. (3/19): facter-2.4.6-1.el6.x86_64.rpm | 99 kB 00:00
  117. (4/19): hiera-1.3.4-1.el6.noarch.rpm | 23 kB 00:00
  118. (5/19): libselinux-2.0.94-7.el6.x86_64.rpm | 108 kB 00:00
  119. (6/19): libselinux-python-2.0.94-7.el6.x86_64.rpm | 202 kB 00:00
  120. (7/19): libselinux-ruby-2.0.94-7.el6.x86_64.rpm | 99 kB 00:00
  121. (8/19): libselinux-utils-2.0.94-7.el6.x86_64.rpm | 82 kB 00:00
  122. (9/19): pciutils-3.1.10-4.el6.x86_64.rpm | 85 kB 00:00
  123. (10/19): puppet-3.8.7-1.el6.noarch.rpm | 1.6 MB 00:00
  124. (11/19): ruby-1.8.7.374-4.el6_6.x86_64.rpm | 538 kB 00:00
  125. (12/19): ruby-augeas-0.4.1-3.el6.x86_64.rpm | 21 kB 00:00
  126. (13/19): ruby-irb-1.8.7.374-4.el6_6.x86_64.rpm | 317 kB 00:00
  127. (14/19): ruby-libs-1.8.7.374-4.el6_6.x86_64.rpm | 1.7 MB 00:01
  128. (15/19): ruby-rdoc-1.8.7.374-4.el6_6.x86_64.rpm | 380 kB 00:00
  129. (16/19): ruby-shadow-2.2.0-2.el6.x86_64.rpm | 13 kB 00:00
  130. (17/19): rubygem-json-1.5.5-3.el6.x86_64.rpm | 763 kB 00:00
  131. (18/19): rubygems-1.3.7-5.el6.noarch.rpm | 206 kB 00:00
  132. (19/19): virt-what-1.11-1.2.el6.x86_64.rpm | 23 kB 00:00
  133. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  134. Total 432 kB/s | 6.6 MB 00:15
  135. warning: rpmts_HdrFromFdno: Header V4 RSA/SHA512 Signature, key ID 4bd6ec30: NOKEY
  136. Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
  137. Importing GPG key 0x4BD6EC30:
  138. Userid : Puppet Labs Release Key (Puppet Labs Release Key) <info@puppetlabs.com>
  139. Package: puppetlabs-release-22.0-2.noarch (installed)
  140. From : /etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
  141. Is this ok [y/N]: y
  142. Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet
  143. Importing GPG key 0xEF8D349F:
  144. Userid : Puppet, Inc. Release Key (Puppet, Inc. Release Key) <release@puppet.com>
  145. Package: puppetlabs-release-22.0-2.noarch (installed)
  146. From : /etc/pki/rpm-gpg/RPM-GPG-KEY-puppet
  147. Is this ok [y/N]: y
  148. Running rpm_check_debug
  149. Running Transaction Test
  150. Transaction Test Succeeded
  151. Running Transaction
  152. Warning: RPMDB altered outside of yum.
  153. Updating : libselinux-2.0.94-7.el6.x86_64 1/22
  154. Installing : libselinux-ruby-2.0.94-7.el6.x86_64 2/22
  155. Updating : libselinux-utils-2.0.94-7.el6.x86_64 3/22
  156. Installing : augeas-libs-1.0.0-10.el6.x86_64 4/22
  157. Installing : compat-readline5-5.2-17.1.el6.x86_64 5/22
  158. Installing : ruby-libs-1.8.7.374-4.el6_6.x86_64 6/22
  159. Installing : ruby-1.8.7.374-4.el6_6.x86_64 7/22
  160. Installing : 1:ruby-shadow-2.2.0-2.el6.x86_64 8/22
  161. Installing : ruby-irb-1.8.7.374-4.el6_6.x86_64 9/22
  162. Installing : ruby-rdoc-1.8.7.374-4.el6_6.x86_64 10/22
  163. Installing : rubygems-1.3.7-5.el6.noarch 11/22
  164. Installing : rubygem-json-1.5.5-3.el6.x86_64 12/22
  165. Installing : hiera-1.3.4-1.el6.noarch 13/22
  166. Installing : ruby-augeas-0.4.1-3.el6.x86_64 14/22
  167. Installing : virt-what-1.11-1.2.el6.x86_64 15/22
  168. Installing : pciutils-3.1.10-4.el6.x86_64 16/22
  169. Installing : 1:facter-2.4.6-1.el6.x86_64 17/22
  170. Installing : puppet-3.8.7-1.el6.noarch 18/22
  171. Updating : libselinux-python-2.0.94-7.el6.x86_64 19/22
  172. Cleanup : libselinux-utils-2.0.94-5.8.el6.x86_64 20/22
  173. Cleanup : libselinux-python-2.0.94-5.8.el6.x86_64 21/22
  174. Cleanup : libselinux-2.0.94-5.8.el6.x86_64 22/22
  175. Verifying : ruby-rdoc-1.8.7.374-4.el6_6.x86_64 1/22
  176. Verifying : 1:ruby-shadow-2.2.0-2.el6.x86_64 2/22
  177. Verifying : pciutils-3.1.10-4.el6.x86_64 3/22
  178. Verifying : libselinux-ruby-2.0.94-7.el6.x86_64 4/22
  179. Verifying : ruby-augeas-0.4.1-3.el6.x86_64 5/22
  180. Verifying : virt-what-1.11-1.2.el6.x86_64 6/22
  181. Verifying : compat-readline5-5.2-17.1.el6.x86_64 7/22
  182. Verifying : rubygem-json-1.5.5-3.el6.x86_64 8/22
  183. Verifying : rubygems-1.3.7-5.el6.noarch 9/22
  184. Verifying : puppet-3.8.7-1.el6.noarch 10/22
  185. Verifying : ruby-libs-1.8.7.374-4.el6_6.x86_64 11/22
  186. Verifying : ruby-irb-1.8.7.374-4.el6_6.x86_64 12/22
  187. Verifying : libselinux-python-2.0.94-7.el6.x86_64 13/22
  188. Verifying : libselinux-utils-2.0.94-7.el6.x86_64 14/22
  189. Verifying : 1:facter-2.4.6-1.el6.x86_64 15/22
  190. Verifying : ruby-1.8.7.374-4.el6_6.x86_64 16/22
  191. Verifying : libselinux-2.0.94-7.el6.x86_64 17/22
  192. Verifying : hiera-1.3.4-1.el6.noarch 18/22
  193. Verifying : augeas-libs-1.0.0-10.el6.x86_64 19/22
  194. Verifying : libselinux-utils-2.0.94-5.8.el6.x86_64 20/22
  195. Verifying : libselinux-2.0.94-5.8.el6.x86_64 21/22
  196. Verifying : libselinux-python-2.0.94-5.8.el6.x86_64 22/22
  197.  
  198. Installed:
  199. puppet.noarch 0:3.8.7-1.el6
  200.  
  201. Dependency Installed:
  202. augeas-libs.x86_64 0:1.0.0-10.el6 compat-readline5.x86_64 0:5.2-17.1.el6 facter.x86_64 1:2.4.6-1.el6 hiera.noarch 0:1.3.4-1.el6 libselinux-ruby.x86_64 0:2.0.94-7.el6 pciutils.x86_64 0:3.1.10-4.el6
  203. ruby.x86_64 0:1.8.7.374-4.el6_6 ruby-augeas.x86_64 0:0.4.1-3.el6 ruby-irb.x86_64 0:1.8.7.374-4.el6_6 ruby-libs.x86_64 0:1.8.7.374-4.el6_6 ruby-rdoc.x86_64 0:1.8.7.374-4.el6_6 ruby-shadow.x86_64 1:2.2.0-2.el6
  204. rubygem-json.x86_64 0:1.5.5-3.el6 rubygems.noarch 0:1.3.7-5.el6 virt-what.x86_64 0:1.11-1.2.el6
  205.  
  206. Dependency Updated:
  207. libselinux.x86_64 0:2.0.94-7.el6 libselinux-python.x86_64 0:2.0.94-7.el6 libselinux-utils.x86_64 0:2.0.94-7.el6
  208.  
  209. Complete!

When I first install Puppet on a host, I’m always interested in inspecting the local host facts. Facts are the key / value pairs that Puppet exposes to the Puppet Master or Agent, which can be used to make decisions on what needs to be applied to the system in question. These facts are also inserted into the PuppetDB, which normally is present in a Puppet Enterprise environment and can be queried to learn more about certain hosts.

The way you inspect these facts is by using a command line tool called facter.

  1. [root@soa-training ~]# facter
  2. architecture => x86_64
  3. augeasversion => 1.0.0
  4. bios_release_date => 12/01/2006
  5. bios_vendor => innotek GmbH
  6. bios_version => VirtualBox
  7. blockdevice_sda_model => VBOX HARDDISK
  8. blockdevice_sda_size => 26843545600
  9. blockdevice_sda_vendor => ATA
  10. blockdevice_sdb_model => VBOX HARDDISK
  11. blockdevice_sdb_size => 26843545600
  12. blockdevice_sdb_vendor => ATA
  13. blockdevice_sdc_model => VBOX HARDDISK
  14. blockdevice_sdc_size => 34359738368
  15. blockdevice_sdc_vendor => ATA
  16. blockdevice_sr0_model => CD-ROM
  17. blockdevice_sr0_size => 1073741312
  18. blockdevice_sr0_vendor => VBOX
  19. blockdevices => sda,sdb,sdc,sr0
  20. boardmanufacturer => Oracle Corporation
  21. boardproductname => VirtualBox
  22. boardserialnumber => 0
  23. domain => home
  24. facterversion => 2.4.6
  25. filesystems => ext4,iso9660
  26. fqdn => soa-training.home
  27. gid => root
  28. hardwareisa => x86_64
  29. hardwaremodel => x86_64
  30. hostname => soa-training
  31. id => root
  32. interfaces => eth4,lo
  33. ipaddress => 10.0.2.15
  34. ipaddress_eth4 => 10.0.2.15
  35. ipaddress_lo => 127.0.0.1
  36. is_virtual => true
  37. kernel => Linux
  38. kernelmajversion => 3.8
  39. kernelrelease => 3.8.13-44.el6uek.x86_64
  40. kernelversion => 3.8.13
  41. lsbdistcodename => n/a
  42. lsbdistdescription => Oracle Linux Server release 6.7
  43. lsbdistid => OracleServer
  44. lsbdistrelease => 6.7
  45. lsbmajdistrelease => 6
  46. lsbminordistrelease => 7
  47. lsbrelease => :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
  48. macaddress => 08:00:27:7D:1B:86
  49. macaddress_eth4 => 08:00:27:7D:1B:86
  50. manufacturer => innotek GmbH
  51. memoryfree => 4.15 GB
  52. memoryfree_mb => 4245.78
  53. memorysize => 7.80 GB
  54. memorysize_mb => 7988.01
  55. mtu_eth4 => 1500
  56. mtu_lo => 65536
  57. netmask => 255.255.255.0
  58. netmask_eth4 => 255.255.255.0
  59. netmask_lo => 255.0.0.0
  60. network_eth4 => 10.0.2.0
  61. network_lo => 127.0.0.0
  62. operatingsystem => OracleLinux
  63. operatingsystemmajrelease => 6
  64. operatingsystemrelease => 6.7
  65. os => {"name"=>"OracleLinux", "lsb"=>{"majdistrelease"=>"6", "distrelease"=>"6.7", "minordistrelease"=>"7", "distid"=>"OracleServer", "distdescription"=>"Oracle Linux Server release 6.7", "distcodename"=>"n/a", "release"=>":base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch"}, "release"=>{"major"=>"6", "minor"=>"7", "full"=>"6.7"}, "family"=>"RedHat"}
  66. osfamily => RedHat
  67. partitions => {"sdb1"=>{"filesystem"=>"ext4", "uuid"=>"104d0e7f-e4ff-4ebb-9282-6bf59a5dd1a9", "size"=>"52426752", "mount"=>"/u01"}, "sda1"=>{"filesystem"=>"ext4", "uuid"=>"10e949d3-7099-4e7e-a89a-398f10d083e3", "size"=>"1024000", "mount"=>"/boot"}, "sda2"=>{"filesystem"=>"LVM2_member", "size"=>"51402752"}}
  68. path => /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
  69. physicalprocessorcount => 1
  70. processor0 => Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
  71. processor1 => Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
  72. processorcount => 2
  73. processors => {"models"=>["Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz", "Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz"], "count"=>2, "physicalcount"=>1}
  74. productname => VirtualBox
  75. ps => ps -ef
  76. puppetversion => 3.8.7
  77. rubyplatform => x86_64-linux
  78. rubysitedir => /usr/lib/ruby/site_ruby/1.8
  79. rubyversion => 1.8.7
  80. selinux => true
  81. selinux_config_mode => enforcing
  82. selinux_config_policy => targeted
  83. selinux_current_mode => enforcing
  84. selinux_enforced => true
  85. selinux_policyversion => 28
  86. serialnumber => 0
  87. sshdsakey => AAAAB3NzaC1kc3MAAACBAKZRL6z7cWPGJoD2cnMCrRTDbis4RiNZrZe3PKs/sNUvDqWNjBksNDW49SJ1xTtbCpwKrODG4qN6zXtY/eJGT+kwBf+edcNvWQqzwo7fPbEMVIkX5tRyAzZAu7YvWrrhxHuC6oSSa0rSWyHExlxgP4aYKKF9LbB/TAOzRUSQY++xAAAAFQD2QJq0WovnGViFYIrxpYPFwOoMkwAAAIBPvM6kN5RbdOetS1qWVk0DG67C6rhDNEWkR2/Yll8TA6o/aQRVIfykmo5DLvyjgTzGeiPpPLpghTWLjEgtBjxO7dHMRhnedDo8PhG2AQeWUDrU/4ipdVwQUPCxOXJdJrAIjnPJqVYkpDEmoWvr5l6hPQSBraKmfUh8wGGwupXQgwAAAIBqlmC57XE26a78zuJjZksXuPcDjSv/PhruTBhtyKGZnNHRYeTZs1fU7tNRTntaF0USdeJq+yIm3BYkBh3cr3gVdC5R287gmc1LYmGI47srcXwq69QVwaO9nLY//uOID+d8E8+aw97sXo1Pf6oGq87Zy+EZqp0RF62KAM6VmFl6MA==
  88. sshfp_dsa => SSHFP 2 1 5d30663a5341205d264e6f137057943367ef1535
  89. SSHFP 2 2 8596647f5ac7e96306419fb61a48be5847256c81c5b9585e8efa67a58a922853
  90. sshfp_rsa => SSHFP 1 1 c38d3cbd68a1b45935406ac65dbf16fce4851529
  91. SSHFP 1 2 5ee3dd20d281a52493d8a191299c0dd855f7ab85aa2ee9be0d6e27de0e1f3cfc
  92. sshrsakey => AAAAB3NzaC1yc2EAAAABIwAAAQEA0mehVvIWW021Obm9Mo7qycPlzMFdAju1piRoaEkCLIUqToLesxkUByzcAvwF8p9EsZ5GDjH4rpS4fZsfUl3JejGTpzb1eHEl5M9P5nmNmCYZSR3wtgtyo56zR0r5AeAa/9RIM6iGkU3mGrunzp1cfLmZmK+SaTE9OmSdzVHBnWzilkVWRZqTzYtptcYbWLlbjCSlCuTg/c8rVn9qq/9jte/qwtPYQYKdc3mjqBvLBNej02r3T8C/uMhN/GxFdUahZLjkLqRnA8c/w3kbMuhBGsxWXO3S6NYRgSPughQhU3hDlHTtdvMjhXOPaidjc91vnE6pyyfNDRZhwDad+2g2vw==
  93. swapfree => 6.00 GB
  94. swapfree_mb => 6144.00
  95. swapsize => 6.00 GB
  96. swapsize_mb => 6144.00
  97. system_uptime => {"seconds"=>2538, "uptime"=>"0:42 hours", "days"=>0, "hours"=>0}
  98. timezone => PST
  99. type => Other
  100. uniqueid => 007f0100
  101. uptime => 0:42 hours
  102. uptime_days => 0
  103. uptime_hours => 0
  104. uptime_seconds => 2538
  105. uuid => E13F417C-AE61-4632-ABAB-594A87BA82D6
  106. virtual => virtualbox
  107. [root@soa-training ~]#

The reason I installed Puppet in a preconfigured WebLogic boss is because I want to inspect WebLogic data with Puppet. For this, we need external modules, which are quick to install, but Puppet has a lot of built-in options as well. As a sneak peak, we will look at some file resources below.

  1. [root@soa-training ~]# puppet resource file /etc/passwd
  2. file { '/etc/passwd':
  3. ensure => 'file',
  4. content => '{md5}943982ae9c22abaeaeeed023983adddd',
  5. ctime => 'Mon Mar 06 12:13:24 -0800 2017',
  6. group => '0',
  7. mode => '644',
  8. mtime => 'Mon Mar 06 12:13:24 -0800 2017',
  9. owner => '0',
  10. selrange => 's0',
  11. selrole => 'object_r',
  12. seltype => 'etc_t',
  13. seluser => 'system_u',
  14. type => 'file',
  15. }
  16. [root@soa-training ~]# puppet resource file /etc
  17. file { '/etc':
  18. ensure => 'directory',
  19. ctime => 'Mon Mar 06 12:13:39 -0800 2017',
  20. group => '0',
  21. mode => '755',
  22. mtime => 'Mon Mar 06 12:13:39 -0800 2017',
  23. owner => '0',
  24. selrange => 's0',
  25. selrole => 'object_r',
  26. seltype => 'etc_t',
  27. seluser => 'system_u',
  28. type => 'directory',
  29. }
  30. [root@soa-training ~]# puppet resource file
  31. Error: Could not run: Listing all file instances is not supported. Please specify a file or directory, e.g. puppet resource file /etc

As you can see, we inspected the /etc/passwd file, the /etc directory, and tried to do a Puppet resource file on all of the files Puppet could find. This last command would have shown us thousands of files, which is not desirable.

Step 2: configure Puppet to connect to the WebLocig domain

Puppet is not shipped with the modules needed to inspect WebLogic out of the box. In order to be able to see these resources, we need to install the Orawls module written by Edwin Biemond, which is the most comprehensive module I know of.

  1. [root@soa-training Desktop]# puppet module install biemond-orawls
  2. Notice: Preparing to install into /home/oracle/.puppetlabs/etc/code/modules ...
  3. Notice: Created target directory /home/oracle/.puppetlabs/etc/code/modules
  4. Notice: Downloading from https://forgeapi.puppet.com ...
  5. Notice: Installing -- do not interrupt ...
  6. /home/oracle/.puppetlabs/etc/code/modules
  7. └─┬ biemond-orawls (v2.0.3)
  8. ├── adrien-filemapper (v1.1.3)
  9. ├── fiddyspence-sleep (v1.2.0)
  10. ├── hajee-easy_type (v0.15.5)
  11. ├── puppetlabs-stdlib (v4.15.0)
  12. └── reidmv-yamlfile (v0.2.0)

Although this blog post is not about writing Puppet code, we need to do it anyway. Orawls needs to know how to connect to WebLogic. To do so, it stores a YAML file on the system containing connection details in a file that is readable by the root user only.

The manifest required for the demo box look like this:

  1. wls_setting { 'default':
  2. user => 'oracle',
  3. weblogic_home_dir => '/u01/fmw/soa/wlserver',
  4. connect_url => "t3://localhost:7001",
  5. weblogic_user => 'weblogic',
  6. weblogic_password => 'welcome1',
  7. use_default_value_when_empty => true
  8. }

Apply the manifest using Puppet apply: 

  1. [root@soa-training Desktop]# puppet apply soaenv.pp
  2. Notice: Compiled catalog for soa-training.home in environment production in 0.09 seconds
  3. Notice: /Stage[main]/Main/Wls_setting[default]/user: defined 'user' as 'oracle'
  4. Notice: /Stage[main]/Main/Wls_setting[default]/weblogic_home_dir: defined 'weblogic_home_dir' as '/u01/fmw/soa/wlserver'
  5. Notice: /Stage[main]/Main/Wls_setting[default]/weblogic_user: defined 'weblogic_user' as 'weblogic'
  6. Notice: /Stage[main]/Main/Wls_setting[default]/connect_url: defined 'connect_url' as 't3://localhost:7001'
  7. Notice: /Stage[main]/Main/Wls_setting[default]/weblogic_password: created password
  8. Notice: /Stage[main]/Main/Wls_setting[default]/debug_module: defined 'debug_module' as 'false'
  9. Notice: /Stage[main]/Main/Wls_setting[default]/archive_path: defined 'archive_path' as '/tmp/orawls-archive'
  10. Notice: /Stage[main]/Main/Wls_setting[default]/custom_trust: defined 'custom_trust' as 'false'
  11. Notice: /Stage[main]/Main/Wls_setting[default]/use_default_value_when_empty: defined 'use_default_value_when_empty' as 'true'
  12. Notice: Finished catalog run in 0.10 seconds

Step 3: inspect resources

We’re finally done making preparations and can now take a look at our beloved WebLogic resources. I’ve included some examples below.

  1. [root@soa-training ~]# puppet resource wls_jms_topic
  2. wls_jms_topic { 'default/BAMJMSSystemResource:oracle.beam.cqs.activedata':
  3. ensure => 'present',
  4. consumptionpaused => '0',
  5. defaulttargeting => '0',
  6. deliverymode => 'No-Delivery',
  7. distributed => '0',
  8. expirationpolicy => 'Discard',
  9. insertionpaused => '0',
  10. jndiname => 'topic/oracle.beam.cqs.activedata',
  11. productionpaused => '0',
  12. redeliverydelay => '-1',
  13. redeliverylimit => '-1',
  14. subdeployment => 'BAMJMSSubDeployment',
  15. timetodeliver => '-1',
  16. timetolive => '-1',
  17. }
  18. wls_jms_topic { 'default/BAMJMSSystemResource:oracle.beam.persistence.activedata':
  19. ensure => 'present',
  20. consumptionpaused => '0',
  21. defaulttargeting => '0',
  22. deliverymode => 'No-Delivery',
  23. distributed => '0',
  24. expirationpolicy => 'Discard',
  25. insertionpaused => '0',
  26. jndiname => 'topic/oracle.beam.server.event.dataobject',
  27. productionpaused => '0',
  28. redeliverydelay => '-1',
  29. redeliverylimit => '-1',
  30. subdeployment => 'BAMJMSSubDeployment',
  31. timetodeliver => '-1',
  32. timetolive => '-1',
  33. }
  1. [root@soa-training Desktop]# puppet resource wls_domain
  2. wls_domain { 'default/compact_domain':
  3. ensure => 'present',
  4. credential => '<encrypted credential>',
  5. exalogicoptimizationsenabled => '0',
  6. jmx_platform_mbean_server_enabled => '0',
  7. jmx_platform_mbean_server_used => '1',
  8. jpa_default_provider => 'org.eclipse.persistence.jpa.PersistenceProvider',
  9. jta_max_transactions => '10000',
  10. jta_transaction_timeout => '30',
  11. log_date_pattern => 'MMM d, yyyy h:mm:ss a z',
  12. log_domain_log_broadcast_severity => 'Notice',
  13. log_file_min_size => '500',
  14. log_filecount => '7',
  15. log_filename => 'logs/compact_domain.log',
  16. log_number_of_files_limited => '1',
  17. log_rotate_logon_startup => '1',
  18. log_rotationtype => 'bySize',
  19. security_crossdomain => '0',
  20. setconfigurationaudittype => 'none',
  21. setinternalappdeploymentondemandenable => '0',
  22. web_app_container_show_archived_real_path_enabled => '0',
  23. }
  1. [root@soa-training Desktop]# puppet resource wls_server
  2. wls_server { 'default/AdminServer':
  3. ensure => 'present',
  4. auto_restart => '1',
  5. autokillwfail => '0',
  6. client_certificate_enforced => '0',
  7. custom_identity => '0',
  8. frontendhttpport => '0',
  9. frontendhttpsport => '0',
  10. jsseenabled => '1',
  11. listenport => '7001',
  12. listenportenabled => '1',
  13. log_datasource_filename => 'logs/datasource.log',
  14. log_date_pattern => 'MMM d, yyyy h:mm:ss a z',
  15. log_file_min_size => '500',
  16. log_filecount => '7',
  17. log_http_file_count => '7',
  18. log_http_filename => 'logs/access.log',
  19. log_http_format => 'date time cs-method ctx-ecid ctx-rid cs-uri sc-status bytes',
  20. log_http_format_type => 'extended',
  21. log_http_number_of_files_limited => '1',
  22. log_log_file_severity => 'Trace',
  23. log_number_of_files_limited => '1',
  24. log_redirect_stderr_to_server => '0',
  25. log_redirect_stdout_to_server => '0',
  26. log_rotate_logon_startup => '1',
  27. log_rotationtype => 'bySize',
  28. log_stdout_severity => 'Notice',
  29. logfilename => 'logs/AdminServer.log',
  30. logintimeout => '5000',
  31. max_message_size => '10000000',
  32. restart_max => '2',
  33. server_parameters => 'None',
  34. sslenabled => '0',
  35. sslhostnameverificationignored => '0',
  36. sslhostnameverifier => 'None',
  37. ssllistenport => '7002',
  38. tunnelingenabled => '0',
  39. two_way_ssl => '0',
  40. useservercerts => '0',
  41. weblogic_plugin_enabled => '0',
  42. }

The fun part is that this is valid Puppet code! Copy the output from the Puppet resource, paste it into a file and change what you want to change. The do a ‘Puppet apply FILENAME.pp’ and the changes should populate. This way you can start out small by managing WebLogic with Puppet and discover the available parameters in a non-destructive way.

Bas Langenberg
About the author Bas Langenberg

Bas Langenberg is a WebLogic and Oracle Fusion Middleware consultant.

More posts by Bas Langenberg
Comments
Reply