├── .fixtures.yml ├── .gitignore ├── .rspec ├── .travis.yml ├── CHANGELOG.md ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── files ├── InclExcl.AIX ├── InclExcl.debian ├── InclExcl.redhat ├── InclExcl.sles ├── InclExcl.solaris ├── dsmcad.debian ├── dsmcad.redhat ├── dsmcad.redhat7 ├── dsmcad.sles ├── dsmcad.sles12 ├── dsmsched.debian ├── dsmsched.redhat ├── dsmsched.redhat7 ├── dsmsched.sles ├── dsmsched.sles12 ├── tsmcad.solaris ├── tsmcad.xml ├── tsmsched.solaris └── tsmsched.xml ├── lib └── puppet │ └── parser │ └── functions │ └── tsm_generate_rand_string.rb ├── manifests ├── config.pp ├── config │ ├── full_template.pp │ ├── stanza.pp │ └── stanzas.pp ├── init.pp ├── install.pp ├── installpkg.pp ├── params.pp ├── service.pp └── service │ ├── aix.pp │ ├── debian.pp │ ├── redhat.pp │ ├── sles.pp │ └── solaris.pp ├── metadata.json ├── spec ├── classes │ ├── config_spec.rb │ ├── coverage_spec.rb │ └── tsm_spec.rb ├── defines │ └── installpkg_spec.rb ├── fixtures │ └── classes │ │ └── config │ │ ├── dsm_sys_fragment │ │ ├── dsm_sys_fragment_tsm │ │ ├── dsm_sys_fragment_tsmserver1 │ │ └── dsm_sys_fragment_tsmserver2 └── spec_helper.rb ├── templates ├── dsm.opt.erb ├── dsm.sys_global.erb ├── dsm.sys_header.erb ├── dsm.sys_stanza.erb └── inclexcl_hash.erb └── tests └── init.pp /.fixtures.yml: -------------------------------------------------------------------------------- 1 | fixtures: 2 | forge_modules: 3 | stdlib: 4 | repo: puppetlabs-stdlib 5 | ref: 4.11.0 6 | concat: 7 | repo: puppetlabs-concat 8 | ref: 2.1.0 9 | symlinks: 10 | "tsm": "#{source_dir}" 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /spec/fixtures/modules/ 2 | /spec/fixtures/manifests/ 3 | /pkg/ 4 | .project 5 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | sudo: false 3 | branches: 4 | only: 5 | - master 6 | language: ruby 7 | script: "bundle exec rake validate lint spec" 8 | matrix: 9 | fast_finish: true 10 | include: 11 | - rvm: 2.1.6 12 | env: PUPPET_GEM_VERSION="~> 3.0" 13 | - rvm: 2.1.6 14 | env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" 15 | - rvm: 2.2.5 16 | env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes" 17 | notification: 18 | email: false 19 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2017-04-13 release 1.2.0 2 | ### Summary 3 | 4 | I call this release 'what took you so long'. It includes the following 5 | fixes and enhancements: 6 | 7 | - Accept hash from Hiera to build an additional InclExcl.hash by GerbenWelter 8 | - Include service_enable to class parameters by Marc Haber 9 | - Add initial dsmcad support by mms-segu 10 | - Support arrays in config_opt_hash allowing for multiple DOMAIN entries in dsm.opt by Marc Haber 11 | - A small fix by rndmh3ro 12 | - We now add InclExcl.local (empty per default) to the standard dsm.sys 13 | 14 | ### Features 15 | 16 | - You can now set the service enable parameter with ::tsm::service_enable 17 | - It is possible to add InclExcl entries via hiera and the ::tsm::inclexcl_hash option 18 | - You can change the standard dsmsched service to dsmscad (see the readme for details) 19 | - ::tsm::config_opt_hash now supports arrays for multiple entries are possible (e.g. for DOMAIN) 20 | 21 | ### Bugfixes 22 | 23 | - various lint fixes 24 | - service_enable parameter was missing from init.pp 25 | - InclExcl.local should be added to the default dsm.sys 26 | 27 | ## 2016-04-26 release 1.1.3 28 | ### Summary 29 | 30 | After fixing #27 the dsm.sys template did no longer use `$config_hash` 31 | for extra settings on newer puppet versions (reported by Gerben 32 | Welter). Using the scope function in the template fixes this issue. 33 | 34 | ## Bugfixes 35 | - dsm.sys.erb does not include config_hash after fixing #27 (GH-35) 36 | 37 | 38 | ## 2016-04-14 release 1.1.2 39 | ### Summary 40 | 41 | Fix usage of InclExcl file in default dsm.sys (thanks to Gerben 42 | Welter). Up until now `InclExcl.local` was included in the dsm.sys 43 | template, this should have been `InclExcl`. 44 | 45 | Cleanup inherits usage and fixes for puppet 4. 46 | 47 | ##Bugfixes 48 | - puppet 4 tests fail (GH-30) 49 | - remove inherits from manifests (GH-27) 50 | - use correct config_opt_hash variable dsm.opt.erb template 51 | 52 | ## 2015-09-09 release 1.1.0 53 | ### Summary 54 | 55 | Added AIX support and run test with the future parser enabled. 56 | 57 | If there is no `dsm.opt` this release will create an emtpy one to 58 | avoid the warning message 59 | 60 | `ANS0990W Options file '/opt/tivoli/tsm/client/ba/bin/dsm.opt' could not be found` 61 | 62 | and return code `8`. 63 | 64 | ###Features 65 | - added AIX 7.1 support provided by purgemerge (mrvdijk at gmail.com) 66 | - Added Puppet 4 to the test matrix 67 | - Create empty dsm.opt to avoid TSM warnings 68 | 69 | ###Bugfixes 70 | 71 | - AIX support (GH-20) 72 | - Puppet master reporting issue with config_opt_hash (GH-19) 73 | - Issue with service dependency on dsm.sys (GH-14) 74 | - Create empty dsm.opt to avoid return code 8 (GH-24) 75 | 76 | ## 2015-04-29 release 1.0.1 77 | ###Summary 78 | 79 | Fixed module compatibility matrix (RedHat 7). 80 | 81 | ## 2015-04-29 release 1.0.0 82 | ###Summary 83 | 84 | The tsm scheduler gets now restarted on config file changes. We've also 85 | included inclexcl.local in the default dsm.sys template. This means 86 | when upgrading to 1.0.0 the dsm scheduler is going to be restarted. 87 | 88 | ###Features 89 | - we now use a systemd service under redhat 7 for starting/stopping 90 | the dsmc scheduler, kindly provided by Lorenzo Dalrio (GH-9). 91 | - restart the tsm scheduler on config file changes (GH-11) 92 | - added inclexcl.local to the default dsm.sys options (GH-8) 93 | 94 | ###Bugfixes 95 | 96 | - option config_replace is now also valid for dsm.sys (GH-12) 97 | 98 | ## 2014-11-26 release 0.3.1 99 | ###Summary 100 | 101 | Integrated Debian 7 support, kindly provided by David orn Johannsson. 102 | 103 | ###Features 104 | - this module now supports Debian 7 105 | 106 | ###Bugfixes 107 | - various lint and documentation fixes 108 | - removed deprecated Modulefile 109 | 110 | ## 2014-09-08 release 0.2.2 111 | ###Summary 112 | 113 | create tag after changing the modulefile 114 | 115 | ## 2014-09-08 release 0.2.1 116 | ###Summary 117 | 118 | fixed a mistake in the changelog 119 | 120 | ## 2014-09-08 release 0.2.0 121 | 122 | manage dsm.opt, solaris inclexcl fixes 123 | 124 | ###Bugfixes 125 | - removed /etc/shadow from solaris exclude list 126 | so the behavior is the same as on redhat 127 | 128 | ###Features 129 | - dsm.opt is now managed via ::tsm::config_opt_hash 130 | 131 | ## 2014-07-23 release 0.1.0 132 | ###Summary 133 | Support multiple values for the inclexcl option in config_hash 134 | 135 | ####Features 136 | - Multiple values for option in config_hash 137 | 138 | ## 2014-06-12 release 0.0.2 139 | ###Summary 140 | Documentation update (README.md, init.pp) 141 | 142 | ## 2014-06-11 Initial release 0.0.1 143 | ###Summary 144 | Initial release of the module 145 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source ENV['GEM_SOURCE'] || "https://rubygems.org" 2 | 3 | group :development, :unit_test do 4 | gem 'rake', :require => false 5 | gem 'metadata-json-lint', :require => false 6 | gem 'puppetlabs_spec_helper', :require => false 7 | gem 'rspec-puppet', '>= 2.3.2', :require => false 8 | gem 'rspec-puppet-facts', :require => false 9 | gem 'puppet-lint', :require => false 10 | gem 'coveralls', :require => false 11 | gem 'simplecov', :require => false 12 | gem 'simplecov-console', :require => false 13 | gem 'semantic_puppet', :require => false 14 | end 15 | 16 | if puppetversion = ENV['PUPPET_GEM_VERSION'] 17 | gem 'puppet', puppetversion, :require => false 18 | else 19 | gem 'puppet', :require => false 20 | end 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # puppet-tsm [![Build Status](https://travis-ci.org/nosolutions/puppet-tsm.svg?branch=master)](https://travis-ci.org/nosolutions/puppet-tsm) [![Coverage Status](https://coveralls.io/repos/nosolutions/puppet-tsm/badge.png)](https://coveralls.io/r/nosolutions/puppet-tsm) 2 | 3 | 1. [Overview](#overview) 4 | 2. [Module Description - What the module does and why it is useful](#module-description) 5 | 3. [Setup - The basics of getting started with tsm](#setup) 6 | * [What tsm affects](#what-tsm-affects) 7 | * [Setup requirements](#setup-requirements) 8 | * [Beginning with tsm](#beginning-with-tsm) 9 | 4. [Usage - Configuration options and additional functionality](#usage) 10 | 5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) 11 | 5. [Limitations - OS compatibility, etc.](#limitations) 12 | 6. [Development - Guide for contributing to the module](#development) 13 | 14 | ## Overview 15 | 16 | Install and manage TSM (Tivoli Storage Manager) client with puppet. It's 17 | heavily inspired by the puppetlabs-ntp module. 18 | 19 | ## Module Description 20 | 21 | This module handles installing, configuring and running the IBM Tivoli 22 | Storage Manager (TSM) client on the following operating systems: 23 | 24 | * RedHat Linux 5/6/7 25 | * CentOS 5/6/7 26 | * Oracle Linux 5/6/7 27 | * Scientific Linux 5/6/7 28 | * Solaris 10/11 29 | * Debian 6/7 30 | * AIX 7.1 31 | * SLES 11/12 32 | 33 | ## Setup 34 | 35 | ### What tsm effects 36 | 37 | * TSM package (TIVsm-Ba and TIVsm-API) 38 | * TSM configuration files (dsm.sys and InclExcl) 39 | * TSM service (dsmsched) 40 | 41 | ### Setup requirements 42 | 43 | #### RedHat 44 | 45 | For RedHat Linux you need a yum repository that contains the rpm 46 | packages IBM provides in the TSM installation tar.gz. 47 | 48 | These usually are 49 | 50 | * TIVsm-API64.x86_64.rpm 51 | * gskssl64-8.0.14.26.linux.x86_64.rpm 52 | * gskcrypt64-8.0.14.26.linux.x86_64.rpm 53 | * TIVsm-BA.x86_64.rpm 54 | 55 | #### Debian 56 | 57 | For Debian you need an apt repository that contains the deb packages. 58 | IBM only provides rpms so you might need to use alien to convert the 59 | rpms IBM provides in the TSM installation tar.gz. 60 | For info on converting rpms to debs consult: 61 | http://www.planetcobalt.net/sdb/tsm_debian.shtml 62 | 63 | These usually are 64 | 65 | * tivsm-api64.deb 66 | * tivsm-ba.deb 67 | * gskcrypt64.deb 68 | * gskssl64.deb 69 | 70 | #### Solaris 71 | 72 | For Solaris 10 and 11 you need a HTTP server that provides the 73 | following packages for downloading: 74 | 75 | * TIVsmCapi.pkg 76 | * TIVsmCba.pkg 77 | * gsk8cry32.pkg 78 | * gsk8cry64.pkg 79 | * gsk8ssl32.pkg 80 | * gsk8ssl64.pkg 81 | 82 | IBM provides the gsk packages as file systems packages (thanks IBM!), 83 | so you have to translate them with pkgtrans: 84 | 85 | ``` 86 | $ pkgtrans . gskssl32.pkg gsk8ssl32/ 87 | ``` 88 | 89 | and copy them to your HTTP download location. You are going to need two 90 | download locations: one for sparc and one for i386 (see params.pp for 91 | an example). 92 | 93 | #### AIX 94 | 95 | For AIX TSM is shipped by IBM as LPP in BFF format. The package can be 96 | installed using the 'nim' (default) or 'aix' provider. Installing 97 | from a NIM repository, the variable `package_uri` must contain a valid 98 | lpp_source in order to make the installation work. This module will 99 | then install `tivoli.tsm.client.ba.64bit.base` and its requesite 100 | software. 101 | 102 | By setting the 'service_manage' variable to true, 'dsmc sched' will be 103 | added as a subsystem definition to the subsystem object class in AIX. 104 | 105 | ### Beginning with TSM 106 | 107 | Include class TSM on hosts where you would like to install the TSM 108 | client packages. By default no config files will be replaced. The 109 | TSM class just makes sure the TSM packages are installed. 110 | 111 | ```puppet 112 | include tsm 113 | ``` 114 | 115 | If there is no dsm.sys this module creates a new one from the default 116 | template. Be sure to set *config_replace* to true if you would like 117 | to manage dsm.sys after the default template has been deployed. 118 | 119 | ## Usage 120 | 121 | All available options (see [init.pp](manifests/init.pp)) should be 122 | changed via the main tsm class. 123 | 124 | The default *dsm.sys* template only sets 125 | 126 | * COMMMethod 127 | * TCPPort 128 | * TCPServeraddress 129 | * INCLExcl 130 | 131 | if you would like to add additional default options for nodes, you 132 | have to use a hash (parameter *config_hash*) or hiera. Here's a hiera 133 | example: 134 | 135 | tsm::config_hash: 136 | errorlogname: "/var/log/dsmerror.log" 137 | errorlogretention: "31 D" 138 | schedlogname: "/var/log/dsmsched.log" 139 | schedlogretention: "30 d" 140 | nodename: "%{::hostname}" 141 | passwordaccess: "generate" 142 | domain: "all-local" 143 | makesparsefile: "no" 144 | 145 | There is also the possibility to add node local options to 146 | *dsm.sys.local*. Settings in *dsm.sys.local* are going to be merged 147 | into the global *dsm.sys* on the next puppet run. 148 | 149 | Use the parameter *config_opt_hash* to manage *dsm.opt* in a similar way 150 | as *dsm.sys*. There is currently no support for a local *dsm.opt* file. 151 | 152 | ### Defining multiple stanzas 153 | 154 | You can also define your multiple servers by defining multiple 155 | configuration stanzas. 156 | 157 | example: 158 | 159 | tsm::stanzas: 160 | tsmserver1: 161 | tcp_server_address: "tsmserver1" 162 | config_hash: 163 | errorlogname: "/var/log/dsmerror.log" 164 | errorlogretention: "31 D" 165 | schedlogname: "/var/log/dsmsched.log" 166 | schedlogretention: "30 d" 167 | nodename: "%{::hostname}" 168 | passwordaccess: "generate" 169 | domain: "all-local" 170 | makesparsefile: "no" 171 | tsmserver2: 172 | tcp_server_address: "tsmserver2" 173 | 174 | ### The Include/Exclude file 175 | 176 | If there is no */opt/tivoli/tsm/client/ba/bin/InclExcl* file 177 | available, this module also deploys a default *InclExcl* file. 178 | 179 | For a puppet managed include/exclude file set *inclexcl_replace* to 180 | *true*. 181 | 182 | In the case of a puppet managed include/exclude file, you can add 183 | local include/exclude rules to 184 | */opt/tivoli/tsm/clien/ba/bin/InclExcl.local* 185 | 186 | The default dsm.sys template already includes the *InclExcl.local* 187 | file. 188 | 189 | It is also possible to add InclExcl entries via hiera. Please use the 190 | *inclexcl_hash* option for this: 191 | 192 | ```hiera 193 | tsm::inclexcl_hash 194 | exclude: 195 | - /var/log/.../* 196 | - /var/tmp/.../* 197 | ``` 198 | 199 | The default location for the file generated with *tsm::inclexcl_hash* 200 | is /opt/tivoli/tsm/client/ba/bin/InclExcl.hash. You can change this 201 | with the *tsm::inclexcl_hash_source* option. 202 | 203 | ### Using the Client Acceptor Daemon (dsmcad) 204 | 205 | If you want to use the Client Acceptor Daemon (dsmcad) instead of the Scheduler (dsmsched), 206 | you have to overwrite the following variables. 207 | 208 | Example for RedHat 7: 209 | 210 | tsm::service_script: "/etc/systemd/system/dsmcad.service" 211 | tsm::service_name: "dsmcad" 212 | tsm::service_script_source: 'puppet:///modules/tsm/dsmcad.redhat7' 213 | 214 | ## Reference 215 | 216 | Please see [init.pp](manifests/init.pp) for an explanation of all available options. 217 | 218 | ## Limitations 219 | 220 | This module has been built on and tested against Puppet 3.1.0 and higher. 221 | 222 | The module has been tested on: 223 | 224 | * RedHat Enterprise Linux 5/6/7 225 | * Solaris 10 i386/sparc 226 | * Solaris 11 i386/sparc 227 | * Debian 6/7 228 | * AIX 7.1 229 | 230 | ## Development 231 | 232 | [Fork me](https://github.com/nosolutions/puppet-tsm/fork) and create pull requests. 233 | 234 | ### Contributors 235 | 236 | The list of contributors can be found at: 237 | [https://github.com/nosolutions/puppet-tsm/graphs/contributors](https://github.com/nosolutions/puppet-tsm/graphs/contributors) 238 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'puppetlabs_spec_helper/rake_tasks' 2 | require 'puppet-lint/tasks/puppet-lint' 3 | 4 | PuppetLint.configuration.send("disable_80chars") 5 | PuppetLint.configuration.send("disable_class_inherits_from_params_class") 6 | 7 | -------------------------------------------------------------------------------- /files/InclExcl.AIX: -------------------------------------------------------------------------------- 1 | exclude /var/run/.../* 2 | exclude /var/spool/.../* 3 | exclude /.../core 4 | exclude /.../tmp/.../* 5 | exclude.dir /mnt 6 | exclude.dir /proc 7 | exclude /cdrom/* 8 | exclude /cdrom/.../* 9 | exclude /unix/ 10 | exclude.dir /unix/ 11 | 12 | 13 | -------------------------------------------------------------------------------- /files/InclExcl.debian: -------------------------------------------------------------------------------- 1 | exclude /var/cache/.../* 2 | exclude /var/crash/.../* 3 | exclude /var/lib/slocate/* 4 | exclude /var/lock/.../* 5 | exclude /var/log/.../* 6 | exclude /var/run/.../* 7 | exclude /var/spool/.../* 8 | exclude /.../core 9 | exclude /.../lost+found 10 | exclude /.../tmp/.../* 11 | exclude.dir /mnt 12 | exclude.dir /proc 13 | exclude.dir /sys 14 | exclude.fs /dev/shm 15 | exclude.fs /dev/pts -------------------------------------------------------------------------------- /files/InclExcl.redhat: -------------------------------------------------------------------------------- 1 | exclude /var/cache/.../* 2 | exclude /var/crash/.../* 3 | exclude /var/lib/slocate/* 4 | exclude /var/lock/.../* 5 | exclude /var/log/.../* 6 | exclude /var/run/.../* 7 | exclude /var/spool/.../* 8 | exclude /.../core 9 | exclude /.../tmp/.../* 10 | exclude.dir /mnt 11 | exclude.dir /proc 12 | exclude.dir /sys 13 | exclude.fs /dev/shm 14 | exclude.fs /dev/pts 15 | -------------------------------------------------------------------------------- /files/InclExcl.sles: -------------------------------------------------------------------------------- 1 | exclude /var/cache/.../* 2 | exclude /var/crash/.../* 3 | exclude /var/lib/slocate/* 4 | exclude /var/lock/.../* 5 | exclude /var/log/.../* 6 | exclude /var/run/.../* 7 | exclude /var/spool/.../* 8 | exclude /.../core 9 | exclude /.../tmp/.../* 10 | exclude.dir /mnt 11 | exclude.dir /proc 12 | exclude.dir /sys 13 | exclude.fs /dev/shm 14 | exclude.fs /dev/pts 15 | include /.../* inc_10v 16 | -------------------------------------------------------------------------------- /files/InclExcl.solaris: -------------------------------------------------------------------------------- 1 | exclude.fs /system/contract 2 | exclude.fs /proc 3 | exclude.fs /etc/mnttab 4 | exclude.fs /etc/svc/volatile 5 | exclude.fs /system/volatile 6 | exclude.fs /system/object 7 | exclude.fs /dev/fd 8 | exclude.fs /var/run 9 | exclude /var/log/dsmsched.log 10 | exclude /var/log/tsmsched.out 11 | exclude /var/adm/pacct* 12 | exclude /tmp/* 13 | exclude /tmp/.../* 14 | exclude /var/tmp/* 15 | exclude /var/tmp/.../* 16 | exclude /cdrom/* 17 | exclude /cdrom/.../* 18 | exclude /mnt/* 19 | exclude /mnt/.../* 20 | -------------------------------------------------------------------------------- /files/dsmcad.debian: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | ### BEGIN INIT INFO 4 | # Provides: dsmcad 5 | # Required-Start: $local_fs $remote_fs $syslog networking 6 | # Required-Stop: 7 | # Default-Start: 2 3 4 5 8 | # Default-Stop: 0 1 6 9 | # Short-Description: dsmcad 10 | # Description: IBM Tivoli Backup Client 11 | ### END INIT INFO 12 | # 13 | 14 | # PATH=${PATH}:/usr/adsm:/usr/local/sbin 15 | # export PATH 16 | export LANG=is_IS 17 | DSM_DIR=/opt/tivoli/tsm/client/ba/bin 18 | DSM_CONFIG=/opt/tivoli/tsm/client/ba/bin/dsm.opt 19 | export DSM_DIR DSM_CONFIG 20 | linke=`ls -d /opt/tivoli/tsm/client/ba/bin/is_IS` 21 | if test "$linke" 22 | then 23 | sleep 0 24 | else 25 | ln -s /opt/tivoli/tsm/client/ba/bin/en_US /opt/tivoli/tsm/client/ba/bin/is_IS 26 | fi 27 | # See how we were called. 28 | case "$1" in 29 | start) 30 | echo -n "Starting dsmcad. " 31 | dsmc sch -RunAsService > /dev/null 2>&1 & 32 | echo 33 | ;; 34 | stop) 35 | echo -n "Stopping dsmcad: " 36 | pid=`/bin/ps ax | /bin/grep -w dsmc | /bin/grep -v grep | /bin/grep -v dsmcad | /usr/bin/awk '{print $1}'` 37 | if test "$pid" 38 | then 39 | kill $pid 40 | echo 41 | fi 42 | ;; 43 | restart) 44 | $0 stop 45 | $0 start 46 | ;; 47 | status) 48 | pid=`/bin/ps ax | /bin/grep -w dsmc | /bin/grep -v grep | /bin/grep -v dsmcad | /usr/bin/awk '{print $1}'` 49 | if test "$pid" 50 | then 51 | echo "dsmcad is running with PID: "$pid 52 | else 53 | echo "dsmcad is not running " 54 | exit 1 55 | fi 56 | ;; 57 | *) 58 | echo "Usage: dsmcad {start|stop|restart|status}" 59 | exit 1 60 | esac 61 | 62 | exit 0 63 | -------------------------------------------------------------------------------- /files/dsmcad.redhat: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # (C) Copyright IBM Corporation 2011 4 | # 5 | # chkconfig: 35 95 5 6 | # description: TSM Client Acceptor Daemon 7 | # 8 | ### BEGIN INIT INFO 9 | # Provides: dsmcad 10 | # Required-Start: $local_fs $remote_fs $network 11 | # Required-Stop: 12 | # Default-Start: 3 5 13 | # Default-Stop: 0 1 2 6 14 | # Short-Description: TSM Client Acceptor Daemon 15 | # Description: Start dsmcad to enable scheduler and Web GUI. 16 | ### END INIT INFO 17 | 18 | DSMCAD_DIR=/opt/tivoli/tsm/client/ba/bin 19 | DSMCAD_BIN=$DSMCAD_DIR/dsmcad 20 | if [ ! -x $DSMCAD_BIN ] 21 | then 22 | echo "$DSMCAD_BIN is not installed" 23 | if [ "$1" = "stop" ] 24 | then 25 | exit 0 26 | else 27 | exit 5 28 | fi 29 | fi 30 | 31 | if [ -f /etc/redhat-release ] 32 | then 33 | . /etc/init.d/functions 34 | 35 | start_() 36 | { 37 | echo -n "Starting dsmcad:" 38 | cd $DSMCAD_DIR 39 | daemon $DSMCAD_BIN 40 | echo 41 | } 42 | 43 | stop_() 44 | { 45 | echo -n "Stopping dsmcad:" 46 | killproc -d 10 dsmcad 47 | echo 48 | return $? 49 | } 50 | 51 | status_() 52 | { 53 | status dsmcad 54 | } 55 | 56 | elif [ -f /etc/SuSE-release ] 57 | then 58 | . /etc/rc.status 59 | 60 | rc_reset 61 | 62 | export LANG=en_US.UTF-8 63 | export LC_ALL=en_US.UTF-8 64 | 65 | start_() 66 | { 67 | echo -n "Starting dsmcad:" 68 | cd $DSMCAD_DIR 69 | startproc $DSMCAD_BIN 70 | rc_status -v 71 | } 72 | 73 | stop_() 74 | { 75 | echo -n "Stopping dsmcad:" 76 | killproc $DSMCAD_BIN 77 | rc_status -v 78 | } 79 | 80 | status_() 81 | { 82 | echo -n "Checking dsmcad:" 83 | checkproc $DSMCAD_BIN 84 | rc_status -v 85 | } 86 | 87 | elif [ -f /etc/os-release ] 88 | then 89 | . /etc/os-release 90 | 91 | if [ $NAME = "Ubuntu" ] 92 | then 93 | 94 | start_() 95 | { 96 | cd $DSMCAD_DIR 97 | if start-stop-daemon --status --exec $DSMCAD_BIN 98 | then 99 | echo "dsmcad is already running, pid" `pidof $DSMCAD_BIN` 100 | else 101 | if start-stop-daemon --start --exec $DSMCAD_BIN 102 | then 103 | echo "dsmcad is started, pid" `pidof $DSMCAD_BIN` 104 | else 105 | echo "dsmcad could not be started" 106 | fi 107 | fi 108 | } 109 | 110 | stop_() 111 | { 112 | if start-stop-daemon --status --exec $DSMCAD_BIN 113 | then 114 | if start-stop-daemon --stop --exec $DSMCAD_BIN 115 | then 116 | echo "dsmcad is stopped" 117 | else 118 | echo "dsmcad could not be stopped" 119 | fi 120 | else 121 | echo "dsmcad is not running" 122 | fi 123 | } 124 | 125 | status_() 126 | { 127 | if start-stop-daemon --status --exec $DSMCAD_BIN 128 | then 129 | echo "dsmcad is running, pid" `pidof $DSMCAD_BIN` 130 | else 131 | echo "dsmcad is not running" 132 | fi 133 | } 134 | 135 | fi 136 | 137 | else 138 | echo "This distribution is not supported" 139 | exit 2 140 | fi 141 | 142 | 143 | 144 | case "$1" in 145 | start) 146 | start_ 147 | ;; 148 | 149 | stop) 150 | stop_ 151 | ;; 152 | 153 | restart) 154 | stop_ 155 | sleep 2 156 | start_ 157 | ;; 158 | 159 | status) 160 | status_ 161 | ;; 162 | 163 | *) 164 | echo "Usage: $0 {start|stop|restart|status}" 165 | exit 1 166 | ;; 167 | esac 168 | 169 | -------------------------------------------------------------------------------- /files/dsmcad.redhat7: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=IBM Tivoli Storage Manager Client dsmcad systemd-style sample service description 3 | Documentation=http://www-01.ibm.com/support/knowledgecenter/SSGSG7_7.1.4/client/t_protect_wf.html?lang=en 4 | After=local-fs.target network-online.target 5 | 6 | [Service] 7 | Type=forking 8 | GuessMainPID=no 9 | Environment="DSM_LOG=/opt/tivoli/tsm/client/ba/bin" "LD_LIBRARY_PATH=/opt/tivoli/tsm/client/ba/bin" 10 | ExecStart=/opt/tivoli/tsm/client/ba/bin/dsmcad 11 | Restart=on-failure 12 | 13 | [Install] 14 | WantedBy=multi-user.target 15 | -------------------------------------------------------------------------------- /files/dsmcad.sles: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # (C) Copyright IBM Corporation 2011 4 | # 5 | # chkconfig: 35 95 5 6 | # description: TSM Client Acceptor Daemon 7 | # 8 | ### BEGIN INIT INFO 9 | # Provides: dsmcad 10 | # Required-Start: $local_fs $remote_fs $network 11 | # Required-Stop: 12 | # Default-Start: 3 5 13 | # Default-Stop: 0 1 2 6 14 | # Short-Description: TSM Client Acceptor Daemon 15 | # Description: Start dsmcad to enable scheduler and Web GUI. 16 | ### END INIT INFO 17 | 18 | DSMCAD_DIR=/opt/tivoli/tsm/client/ba/bin 19 | DSMCAD_BIN=$DSMCAD_DIR/dsmcad 20 | if [ ! -x $DSMCAD_BIN ] 21 | then 22 | echo "$DSMCAD_BIN is not installed" 23 | if [ "$1" = "stop" ] 24 | then 25 | exit 0 26 | else 27 | exit 5 28 | fi 29 | fi 30 | 31 | if [ -f /etc/redhat-release ] 32 | then 33 | . /etc/init.d/functions 34 | 35 | start_() 36 | { 37 | echo -n "Starting dsmcad:" 38 | cd $DSMCAD_DIR 39 | daemon $DSMCAD_BIN 40 | echo 41 | } 42 | 43 | stop_() 44 | { 45 | echo -n "Stopping dsmcad:" 46 | killproc -d 10 dsmcad 47 | echo 48 | return $? 49 | } 50 | 51 | status_() 52 | { 53 | status dsmcad 54 | } 55 | 56 | elif [ -f /etc/SuSE-release ] 57 | then 58 | . /etc/rc.status 59 | 60 | rc_reset 61 | 62 | export LANG=en_US.UTF-8 63 | export LC_ALL=en_US.UTF-8 64 | 65 | start_() 66 | { 67 | echo -n "Starting dsmcad:" 68 | cd $DSMCAD_DIR 69 | startproc $DSMCAD_BIN 70 | rc_status -v 71 | } 72 | 73 | stop_() 74 | { 75 | echo -n "Stopping dsmcad:" 76 | killproc $DSMCAD_BIN 77 | rc_status -v 78 | } 79 | 80 | status_() 81 | { 82 | echo -n "Checking dsmcad:" 83 | checkproc $DSMCAD_BIN 84 | rc_status -v 85 | } 86 | 87 | elif [ -f /etc/os-release ] 88 | then 89 | . /etc/os-release 90 | 91 | if [ $NAME = "Ubuntu" ] 92 | then 93 | 94 | start_() 95 | { 96 | cd $DSMCAD_DIR 97 | if start-stop-daemon --status --exec $DSMCAD_BIN 98 | then 99 | echo "dsmcad is already running, pid" `pidof $DSMCAD_BIN` 100 | else 101 | if start-stop-daemon --start --exec $DSMCAD_BIN 102 | then 103 | echo "dsmcad is started, pid" `pidof $DSMCAD_BIN` 104 | else 105 | echo "dsmcad could not be started" 106 | fi 107 | fi 108 | } 109 | 110 | stop_() 111 | { 112 | if start-stop-daemon --status --exec $DSMCAD_BIN 113 | then 114 | if start-stop-daemon --stop --exec $DSMCAD_BIN 115 | then 116 | echo "dsmcad is stopped" 117 | else 118 | echo "dsmcad could not be stopped" 119 | fi 120 | else 121 | echo "dsmcad is not running" 122 | fi 123 | } 124 | 125 | status_() 126 | { 127 | if start-stop-daemon --status --exec $DSMCAD_BIN 128 | then 129 | echo "dsmcad is running, pid" `pidof $DSMCAD_BIN` 130 | else 131 | echo "dsmcad is not running" 132 | fi 133 | } 134 | 135 | fi 136 | 137 | else 138 | echo "This distribution is not supported" 139 | exit 2 140 | fi 141 | 142 | 143 | 144 | case "$1" in 145 | start) 146 | start_ 147 | ;; 148 | 149 | stop) 150 | stop_ 151 | ;; 152 | 153 | restart) 154 | stop_ 155 | sleep 2 156 | start_ 157 | ;; 158 | 159 | status) 160 | status_ 161 | ;; 162 | 163 | *) 164 | echo "Usage: $0 {start|stop|restart|status}" 165 | exit 1 166 | ;; 167 | esac 168 | 169 | -------------------------------------------------------------------------------- /files/dsmcad.sles12: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Tivoli Storage Manager Client Daemon 3 | Documentation=http://www-01.ibm.com/support/knowledgecenter/SSGSG7_7.1.4/client/t_protect_wf.html?lang=en 4 | After=local-fs.target network-online.target 5 | 6 | [Service] 7 | Type=forking 8 | GuessMainPID=no 9 | Environment="DSM_LOG=/opt/tivoli/tsm/client/ba/bin" "LD_LIBRARY_PATH=/opt/tivoli/tsm/client/ba/bin" 10 | ExecStart=/opt/tivoli/tsm/client/ba/bin/dsmcad 11 | Restart=on-failure 12 | 13 | [Install] 14 | WantedBy=multi-user.target 15 | -------------------------------------------------------------------------------- /files/dsmsched.debian: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | ### BEGIN INIT INFO 4 | # Provides: dsmcsched 5 | # Required-Start: $local_fs $remote_fs $syslog networking 6 | # Required-Stop: 7 | # Default-Start: 2 3 4 5 8 | # Default-Stop: 0 1 6 9 | # Short-Description: dsmc scheduler 10 | # Description: IBM Tivoli Backup Client 11 | ### END INIT INFO 12 | # 13 | 14 | # PATH=${PATH}:/usr/adsm:/usr/local/sbin 15 | # export PATH 16 | export LANG=is_IS 17 | DSM_DIR=/opt/tivoli/tsm/client/ba/bin 18 | DSM_CONFIG=/opt/tivoli/tsm/client/ba/bin/dsm.opt 19 | export DSM_DIR DSM_CONFIG 20 | linke=`ls -d /opt/tivoli/tsm/client/ba/bin/is_IS` 21 | if test "$linke" 22 | then 23 | sleep 0 24 | else 25 | ln -s /opt/tivoli/tsm/client/ba/bin/en_US /opt/tivoli/tsm/client/ba/bin/is_IS 26 | fi 27 | # See how we were called. 28 | case "$1" in 29 | start) 30 | echo -n "Starting dsmc. " 31 | dsmc sch -RunAsService > /dev/null 2>&1 & 32 | echo 33 | ;; 34 | stop) 35 | echo -n "Stopping dsmc: " 36 | pid=`/bin/ps ax | /bin/grep -w dsmc | /bin/grep -v grep | /bin/grep -v dsmcsched | /usr/bin/awk '{print $1}'` 37 | if test "$pid" 38 | then 39 | kill $pid 40 | echo 41 | fi 42 | ;; 43 | restart) 44 | $0 stop 45 | $0 start 46 | ;; 47 | status) 48 | pid=`/bin/ps ax | /bin/grep -w dsmc | /bin/grep -v grep | /bin/grep -v dsmcsched | /usr/bin/awk '{print $1}'` 49 | if test "$pid" 50 | then 51 | echo "dsmc is running with PID: "$pid 52 | else 53 | echo "dsmc is not running " 54 | exit 1 55 | fi 56 | ;; 57 | *) 58 | echo "Usage: dsmcsched {start|stop|restart|status}" 59 | exit 1 60 | esac 61 | 62 | exit 0 63 | -------------------------------------------------------------------------------- /files/dsmsched.redhat: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # chkconfig: 345 99 99 4 | # description: starts the tsm scheduler at system boot 5 | # config: 6 | # pidfile: 7 | # 8 | prog="/opt/tivoli/tsm/client/ba/bin/dsmc" 9 | 10 | [ ! -x "$prog" ] && exit 0 11 | 12 | # Source function library. 13 | . /etc/rc.d/init.d/functions 14 | 15 | case "$1" in 16 | 'start') 17 | PID=`pidofproc dsmc` 18 | if [ "$PID" != "" ]; then 19 | echo 'tsm scheduler already running.' 20 | exit 1 21 | fi 22 | echo -n "Starting dsmc" 23 | if [ -x /opt/tivoli/tsm/client/ba/bin/dsmc ]; then 24 | /opt/tivoli/tsm/client/ba/bin/dsmc sched \ 25 | > /var/log/dsmc.out 2>&1 & 26 | echo_success Starting dsmc 27 | echo 28 | else 29 | echo_failure 30 | exit 1 31 | fi 32 | ;; 33 | 34 | 'stop') 35 | killproc $prog 36 | echo "Stopping dsmc" 37 | ;; 38 | 39 | 'restart') 40 | $0 stop 41 | $0 start 42 | ;; 43 | 44 | 'status') 45 | status $prog 46 | ;; 47 | 48 | *) 49 | echo "Usage: $0 { start | stop }" 50 | exit 1 51 | ;; 52 | esac 53 | -------------------------------------------------------------------------------- /files/dsmsched.redhat7: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Dsm Scheduler 3 | After=syslog.target network.target 4 | 5 | [Service] 6 | Type=simple 7 | ExecStart=/opt/tivoli/tsm/client/ba/bin/dsmc sched 8 | Restart=always 9 | 10 | [Install] 11 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /files/dsmsched.sles: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # chkconfig: 345 99 99 4 | # description: starts the tsm scheduler at system boot 5 | # config: 6 | # pidfile: 7 | # 8 | prog="/opt/tivoli/tsm/client/ba/bin/dsmc" 9 | 10 | [ ! -x "$prog" ] && exit 0 11 | 12 | # Source function library. 13 | . /etc/rc.d/init.d/functions 14 | 15 | case "$1" in 16 | 'start') 17 | PID=`pidofproc dsmc` 18 | if [ "$PID" != "" ]; then 19 | echo 'tsm scheduler already running.' 20 | exit 1 21 | fi 22 | echo -n "Starting dsmc" 23 | if [ -x /opt/tivoli/tsm/client/ba/bin/dsmc ]; then 24 | /opt/tivoli/tsm/client/ba/bin/dsmc sched \ 25 | > /var/log/dsmc.out 2>&1 & 26 | echo_success Starting dsmc 27 | echo 28 | else 29 | echo_failure 30 | exit 1 31 | fi 32 | ;; 33 | 34 | 'stop') 35 | killproc $prog 36 | echo "Stopping dsmc" 37 | ;; 38 | 39 | 'restart') 40 | $0 stop 41 | $0 start 42 | ;; 43 | 44 | 'status') 45 | status $prog 46 | ;; 47 | 48 | *) 49 | echo "Usage: $0 { start | stop }" 50 | exit 1 51 | ;; 52 | esac 53 | -------------------------------------------------------------------------------- /files/dsmsched.sles12: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Dsm Scheduler 3 | After=syslog.target network.target 4 | 5 | [Service] 6 | Type=simple 7 | ExecStart=/opt/tivoli/tsm/client/ba/bin/dsmc sched 8 | Restart=always 9 | 10 | [Install] 11 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /files/tsmcad.solaris: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | # 3 | #tm 01.10.2001 bsd teufel austreiben. sysv rules. 4 | #be 04.12.2006 bisschen angepasst fuer solaris smf 5 | #ts 11.06.2014 ja, wir verwenden auch zonen... 6 | #sg 03.08.2016 dsmcad 7 | ################################################## 8 | 9 | getpid() 10 | { 11 | PID="" 12 | ZONENAME=`zonename` 13 | PID=`pgrep -z $ZONENAME -f 'dsmcad'` 14 | } 15 | 16 | cad_start() 17 | { 18 | getpid 19 | 20 | if [ "$PID" != "" ]; then 21 | echo "tsm cad already running (pid $PID)." 22 | exit 1 23 | fi 24 | if [ -x /opt/tivoli/tsm/client/ba/bin/dsmcad ]; then 25 | echo 'starting tsm cad.' 26 | /opt/tivoli/tsm/client/ba/bin/dsmcad \ 27 | > /var/log/tsmcad.out 2>&1 & 28 | else 29 | echo 'cant find tsm executable!' 30 | exit 1 31 | fi 32 | } 33 | 34 | cad_stop() 35 | { 36 | getpid 37 | 38 | if [ "$PID" = "" ]; then 39 | echo 'tsm cad not running.' 40 | #exit 1 41 | else 42 | echo 'stopping tsm cad.' 43 | [ "$PID" -gt 0 ] && kill -15 $PID 44 | fi 45 | } 46 | 47 | case "$1" in 48 | 'start') 49 | cad_start 50 | ;; 51 | 'restart') 52 | cad_stop 53 | sleep 3 #wichtig 54 | cad_start 55 | ;; 56 | 'stop') 57 | cad_stop 58 | ;; 59 | *) 60 | echo "Usage: $0 { start | restart | stop }" 61 | exit 1 62 | ;; 63 | esac 64 | 65 | exit 0 66 | -------------------------------------------------------------------------------- /files/tsmcad.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 18 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 40 | 42 | 43 | 44 | 48 | 50 | 51 | 52 | 61 | 66 | 67 | 72 | 73 | 78 | 79 | 81 | 82 | 84 | 85 | 86 | 87 | 88 | 90 | 91 | 92 | 93 | 94 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /files/tsmsched.solaris: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | # 3 | #tm 01.10.2001 bsd teufel austreiben. sysv rules. 4 | #be 04.12.2006 bisschen angepasst fuer solaris smf 5 | #ts 11.06.2014 ja, wir verwenden auch zonen... 6 | ################################################## 7 | 8 | getpid() 9 | { 10 | PID="" 11 | ZONENAME=`zonename` 12 | PID=`pgrep -z $ZONENAME -f 'dsmc sched'` 13 | } 14 | 15 | sch_start() 16 | { 17 | getpid 18 | 19 | if [ "$PID" != "" ]; then 20 | echo "tsm scheduler already running (pid $PID)." 21 | exit 1 22 | fi 23 | if [ -x /opt/tivoli/tsm/client/ba/bin/dsmc ]; then 24 | echo 'starting tsm scheduler.' 25 | /opt/tivoli/tsm/client/ba/bin/dsmc sched \ 26 | > /var/log/tsmsched.out 2>&1 & 27 | else 28 | echo 'cant find tsm executable!' 29 | exit 1 30 | fi 31 | } 32 | 33 | sch_stop() 34 | { 35 | getpid 36 | 37 | if [ "$PID" = "" ]; then 38 | echo 'tsm scheduler not running.' 39 | #exit 1 40 | else 41 | echo 'stopping tsm scheduler.' 42 | [ "$PID" -gt 0 ] && kill -15 $PID 43 | fi 44 | } 45 | 46 | case "$1" in 47 | 'start') 48 | sch_start 49 | ;; 50 | 'restart') 51 | sch_stop 52 | sleep 3 #wichtig 53 | sch_start 54 | ;; 55 | 'stop') 56 | sch_stop 57 | ;; 58 | *) 59 | echo "Usage: $0 { start | restart | stop }" 60 | exit 1 61 | ;; 62 | esac 63 | 64 | exit 0 65 | -------------------------------------------------------------------------------- /files/tsmsched.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 18 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 40 | 42 | 43 | 44 | 48 | 50 | 51 | 52 | 61 | 66 | 67 | 72 | 73 | 78 | 79 | 81 | 82 | 84 | 85 | 86 | 87 | 88 | 90 | 91 | 92 | 93 | 94 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /lib/puppet/parser/functions/tsm_generate_rand_string.rb: -------------------------------------------------------------------------------- 1 | module Puppet::Parser::Functions 2 | newfunction(:tsm_generate_rand_string, :type => :rvalue) do |args| 3 | len = args[0] ? args[0].to_i : 24 4 | 5 | flags = File::RDONLY 6 | flags |= File::NONBLOCK if defined? File::NONBLOCK 7 | flags |= File::NOCTTY if defined? File::NOCTTY 8 | File.open('/dev/urandom', flags) do |urandom| 9 | urandom.readpartial(len).unpack("H*")[0] 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /manifests/config.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::config 2 | # 3 | # Configures the tsm client 4 | # 5 | # === Authors 6 | # 7 | # Toni Schmidbauer 8 | # 9 | # === Copyright 10 | # 11 | # Copyright 2013-2017 Toni Schmidbauer 12 | # 13 | class tsm::config { 14 | 15 | concat { $::tsm::config: 16 | ensure => present, 17 | replace => $::tsm::config_replace, 18 | owner => 'root', 19 | group => $::tsm::rootgroup, 20 | mode => '0644', 21 | } 22 | 23 | if $::tsm::config_template { 24 | contain tsm::config::full_template 25 | } else { 26 | contain tsm::config::stanzas 27 | } 28 | 29 | concat::fragment { 'dsm_sys_local_banner': 30 | target => $::tsm::config, 31 | content => "* settings included from dsm.sys.local (if any)\n", 32 | order => '30', 33 | } 34 | file { "${::tsm::config}.local": 35 | ensure => file, 36 | owner => 'root', 37 | group => $::tsm::rootgroup, 38 | mode => '0644', 39 | } 40 | -> concat::fragment { 'dsm_sys_local': 41 | target => $::tsm::config, 42 | source => "${::tsm::config}.local", 43 | order => '31', 44 | } 45 | 46 | if $::tsm::config_opt_hash { 47 | file { $::tsm::config_opt: 48 | ensure => file, 49 | replace => $::tsm::config_replace, 50 | owner => 'root', 51 | group => $::tsm::rootgroup, 52 | mode => '0644', 53 | content => template($::tsm::config_opt_template), 54 | } 55 | } 56 | else { 57 | file { $::tsm::config_opt: 58 | ensure => present, 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /manifests/config/full_template.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::config::full_template 2 | # 3 | # This class is used if the user replaces the whole 4 | # template and does not use the partials for header, 5 | # global and stanza templates. 6 | # 7 | # === Authors 8 | # 9 | # Toni Schmidbauer 10 | # 11 | # === Copyright 12 | # 13 | # Copyright 2013-2017 Toni Schmidbauer 14 | # 15 | class tsm::config::full_template { 16 | validate_string($::tsm::server_name) 17 | validate_string($::tsm::comm_method) 18 | validate_integer($::tsm::tcp_port, 65535, 1) 19 | validate_string($::tsm::tcp_server_address) 20 | validate_absolute_path($::tsm::inclexcl) 21 | validate_absolute_path($::tsm::inclexcl_local) 22 | validate_string($::tsm::inclexcl_source) 23 | validate_bool($::tsm::inclexcl_replace) 24 | 25 | concat::fragment { 'dsm_sys_template': 26 | target => $::tsm::config, 27 | content => template($::tsm::config_template), 28 | order => '10', 29 | } 30 | 31 | file { $::tsm::inclexcl: 32 | ensure => file, 33 | replace => $::tsm::inclexcl_replace, 34 | owner => 'root', 35 | group => $::tsm::rootgroup, 36 | mode => '0644', 37 | source => $::tsm::inclexcl_source, 38 | } 39 | 40 | file { $::tsm::inclexcl_hash_source: 41 | ensure => file, 42 | owner => 'root', 43 | group => $::tsm::rootgroup, 44 | mode => '0644', 45 | content => template('tsm/inclexcl_hash.erb'), 46 | } 47 | 48 | file { $::tsm::inclexcl_local: 49 | ensure => file, 50 | replace => $::tsm::inclexcl_replace, 51 | owner => 'root', 52 | group => $::tsm::rootgroup, 53 | mode => '0644', 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /manifests/config/stanza.pp: -------------------------------------------------------------------------------- 1 | # == Define: tsm::config::stanza 2 | # 3 | # Will create a stanza fragment for inclusion in 4 | # the dms.sys config file. 5 | # 6 | # === Parameters 7 | # 8 | # [*server_name*] 9 | # server_name - optional, server id in the config file 10 | # Default: tsm 11 | # 12 | # [*comm_method*] 13 | # TSM communication method 14 | # comm_method - optional 15 | # Default: TCPip 16 | # 17 | # [*tcp_port*] 18 | # TCP port used for connecting to the tsm server 19 | # tcp_port - optional 20 | # Default: 1500 21 | # 22 | # [*inclexcl*] 23 | # Path to the include/exclude file 24 | # inclexcl - optional 25 | # Default: /opt/tivoli/tsm/client/ba/bin/InclExcl_${name} 26 | # 27 | # [*inclexcl_hash*] 28 | # Hash from Hiera to build contents of inclexcl_hash_source 29 | # inclexcl_hash - optional 30 | # Default: {} 31 | # 32 | # [*inclexcl_hash_source*] 33 | # Path to the include/exclude file built from hiera 34 | # inclexcl_hash_source - optional 35 | # Default: 36 | # Redhat, Debian, Solaris: /opt/tivoli/tsm/client/ba/bin/InclExcl_${name}.hash 37 | # AIX: /usr/tivoli/tsm/client/ba/bin64/InclExcl_${name}.hash 38 | # 39 | # [*inclexcl_local*] 40 | # Path to the local include/exclude file 41 | # inclexcl_local - optional 42 | # Default: /opt/tivoli/tsm/client/ba/bin/InclExcl_${name}.local 43 | # 44 | # [*inclexcl_replace*] 45 | # Whether or not to replace a existing InclExcl file 46 | # inclexcl_replace - optional 47 | # Default: false 48 | # 49 | # [*inclexcl_source*] 50 | # Where to find a default include/exclude file 51 | # inclexcl_source - optional 52 | # Default: 53 | # Redhat: puppet://modules/tsm/InclExcl.redhat 54 | # Debian: puppet://modules/tsm/InclExcl.debian 55 | # Solaris: puppet://modules/tsm/InclExcl.solaris 56 | # 57 | # [*config_hash*] 58 | # config_hash - hash with extended parameters 59 | # keys => value 60 | # Default: {} 61 | # 62 | # === Authors 63 | # 64 | # Toni Schmidbauer 65 | # 66 | # === Copyright 67 | # 68 | # Copyright 2013-2017 Toni Schmidbauer 69 | # 70 | define tsm::config::stanza( 71 | $tcp_server_address, 72 | $server_name = $name, 73 | $comm_method = $::tsm::comm_method, 74 | $tcp_port = $::tsm::tcp_port, 75 | $inclexcl = "${::tsm::config_dir}/InclExcl_${name}", 76 | $inclexcl_source = $::tsm::inclexcl_source, 77 | $inclexcl_local = "${::tsm::config_dir}/InclExcl_${name}.local", 78 | $inclexcl_hash = {}, 79 | $inclexcl_hash_source = "${::tsm::config_dir}/InclExcl_${name}.hash", 80 | $inclexcl_replace = $::tsm::inclexcl_replace, 81 | $config_hash = {}, 82 | ){ 83 | validate_string($server_name) 84 | validate_string($comm_method) 85 | validate_integer($tcp_port, 65535, 1) 86 | validate_string($tcp_server_address) 87 | validate_absolute_path($inclexcl) 88 | validate_absolute_path($inclexcl_local) 89 | validate_string($inclexcl_source) 90 | validate_bool($inclexcl_replace) 91 | 92 | concat::fragment { "dsm_sys_stanza_${name}": 93 | target => $::tsm::config, 94 | content => template($::tsm::config_stanza_template), 95 | order => "20_${name}", 96 | } 97 | 98 | file { $inclexcl: 99 | ensure => file, 100 | replace => $inclexcl_replace, 101 | owner => 'root', 102 | group => $::tsm::rootgroup, 103 | mode => '0644', 104 | source => $inclexcl_source, 105 | } 106 | 107 | file { $inclexcl_hash_source: 108 | ensure => file, 109 | owner => 'root', 110 | group => $::tsm::rootgroup, 111 | mode => '0644', 112 | content => template('tsm/inclexcl_hash.erb'), 113 | } 114 | 115 | file { $inclexcl_local: 116 | ensure => file, 117 | replace => $inclexcl_replace, 118 | owner => 'root', 119 | group => $::tsm::rootgroup, 120 | mode => '0644', 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /manifests/config/stanzas.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::config::stanzas 2 | # 3 | # This class creates the dsm.sys config with the partial 4 | # header, global and stanza templates. 5 | # 6 | # If the stanzas hash is not used it will create a single 7 | # stanza from the tsm class parameters. 8 | # 9 | # === Authors 10 | # 11 | # Toni Schmidbauer 12 | # 13 | # === Copyright 14 | # 15 | # Copyright 2013-2017 Toni Schmidbauer 16 | # 17 | class tsm::config::stanzas { 18 | 19 | concat::fragment { 'dsm_sys_header': 20 | target => $::tsm::config, 21 | content => template($::tsm::config_header_template), 22 | order => '00', 23 | } 24 | 25 | concat::fragment { 'dsm_sys_global': 26 | target => $::tsm::config, 27 | content => template($::tsm::config_global_template), 28 | order => '20', 29 | } 30 | 31 | if empty($::tsm::stanzas) { 32 | 33 | # create a single stanza from the tsm class params 34 | tsm::config::stanza{$::tsm::server_name: 35 | comm_method => $::tsm::comm_method, 36 | tcp_port => $::tsm::tcp_port, 37 | tcp_server_address => $::tsm::tcp_server_address, 38 | inclexcl => $::tsm::inclexcl, 39 | inclexcl_source => $::tsm::inclexcl_source, 40 | inclexcl_local => $::tsm::inclexcl_local, 41 | inclexcl_hash => $::tsm::inclexcl_hash, 42 | inclexcl_hash_source => $::tsm::inclexcl_hash_source, 43 | inclexcl_replace => $::tsm::inclexcl_replace, 44 | config_hash => $::tsm::config_hash, 45 | } 46 | 47 | } else { 48 | 49 | create_resources('tsm::config::stanza', $::tsm::stanzas) 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /manifests/init.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm 2 | # 3 | # Full description of class tsm here. 4 | # 5 | # === Parameters 6 | # 7 | # [*server_name*] 8 | # server_name - optional, server id in the config file 9 | # Default: tsm 10 | # 11 | # [*comm_method*] 12 | # TSM communication method 13 | # comm_method - optional 14 | # Default: TCPip 15 | # 16 | # [*tcp_port*] 17 | # TCP port used for connecting to the tsm server 18 | # tcp_port - optional 19 | # Default: 1500 20 | # 21 | # [*package_ensure*] 22 | # State of the tsm packages 23 | # package_ensure - optional 24 | # Default: 'installed' 25 | # 26 | # [*packages*] 27 | # List of tsm package to be installed 28 | # packages - optional 29 | # Default: 30 | # Redhat: ['TIVsm-BA'] 31 | # Debian: ['tivsm-api64', 'tivsm-ba', 'gskcrypt64', 'gskssl64'] 32 | # Solaris i386: ['gsk8cry32','gsk8cry64','gsk8ssl32','gsk8ssl64','TIVsmCapi', 'TIVsmCba'] 33 | # Solaris sparc: ['gsk8cry64','gsk8ssl64','TIVsmCapi', 'TIVsmCba'] 34 | # 35 | # [*package_adminfile*] 36 | # Solaris SysV package admin file, required for an unattended installation 37 | # package_adminfile - optional 38 | # Default: /var/sadm/install/admin/puppet 39 | # 40 | # [*package_uri*] 41 | # HTTP URI where to find the package, required for Solaris 42 | # package_uri - optional 43 | # Default: http://server/pkgs/solaris/${::hardwareisa}/5.10 44 | # 45 | # [*service_manage*] 46 | # If we should manage the tsm service 47 | # service_manage - optional 48 | # Default: false 49 | # 50 | # [*service_ensure*] 51 | # Default state of the tsm service 52 | # service_manage - optional 53 | # Default: 'running' 54 | # 55 | # [*service_enable*] 56 | # Default state of the tsm service 57 | # service_manage - optional 58 | # Default: 'true' 59 | # 60 | # [*service_name*] 61 | # Name of the tsm service we manage 62 | # service_name - optional 63 | # Default: 64 | # Linux: dsmsched 65 | # Solaris: tsmsched 66 | # 67 | # [*service_manifest*] 68 | # Path to the solaris smf manifest for tsm 69 | # service_manifest - optional 70 | # Default: /var/svc/manifest/site/tsmsched.xml 71 | # 72 | # [*service_manifest_source*] 73 | # We do we get the solaris smf manifest from 74 | # service_manifest_source - optional 75 | # Default: puppet://modules/tsm/tsmsched.xml 76 | # 77 | # [*service_script*] 78 | # Start/stop script for the tsm service 79 | # service_script - optional 80 | # Default: 81 | # Linux: /etc/init.d/dsmsched 82 | # Solaris: /lib/svc/method/tsmsched 83 | # 84 | # [*service_script_source*] 85 | # Where to find the tsm service script for deployment 86 | # service_script_source - optional 87 | # Default: 88 | # Redhat: puppet://modules/tsm/dsmsched.redhat 89 | # Debian: puppet://modules/tsm/dsmsched.debian 90 | # Solaris: puppet://modules/tsm/tsmsched.solaris 91 | # 92 | # [*tsm_pwd*] 93 | # Path to the TSM password file 94 | # config - optional 95 | # Default: /etc/adsm/TSM.PWD 96 | # 97 | # [*tsm_pwd_kdb*] 98 | # Path to the TSM GSKit password file used since 7.1.8 99 | # config - optional 100 | # Default: /etc/adsm/TSM.KDB 101 | # 102 | # [*initial_password*] 103 | # First time password for connecting to the tsm server 104 | # config - optional 105 | # Default: 'start' 106 | # 107 | # [*config_dir*] 108 | # Path where the per stanza InclExcl files will be deployed 109 | # config - optional 110 | # Default: 111 | # RedHat: /opt/tivoli/tsm/client/ba/bin 112 | # Debian: /opt/tivoli/tsm/client/ba/bin 113 | # Solaris: /opt/tivoli/tsm/client/ba/bin 114 | # AIX: /usr/tivoli/tsm/client/ba/bin64 115 | # 116 | # [*config*] 117 | # Path to dsm.sys 118 | # config - optional 119 | # Default: /opt/tivoli/tsm/client/ba/bin/dsm.sys 120 | # 121 | # [*config_opt*] 122 | # Path to dsm.opt 123 | # config - optional 124 | # Default: /opt/tivoli/tsm/client/ba/bin/dsm.opt 125 | # 126 | # [*config_replace*] 127 | # Whether or not to replace dsm.sys 128 | # config_replace - optional 129 | # Default: false 130 | # 131 | # [*config_template*] 132 | # Where to find the full ERB template for dsm.sys 133 | # config_template - optional 134 | # Default: 'tsm/dsm.sys.erb' 135 | # 136 | # [*config_header_template*] 137 | # Where to find the partial header ERB template for dsm.sys 138 | # config_template - optional 139 | # Default: tsm/dsm.sys_header.erb 140 | # 141 | # [*config_global_template*] 142 | # Where to find the partial global ERB template for dsm.sys 143 | # config_template - optional 144 | # Default: tsm/dsm.sys_global.erb 145 | # 146 | # [*config_stanza_template*] 147 | # Where to find the partial stanza ERB template for dsm.sys 148 | # config_template - optional 149 | # Default: tsm/dsm.sys_stanza.erb 150 | # 151 | # [*inclexcl*] 152 | # Path to the include/exclude file 153 | # inclexcl - optional 154 | # Default: /opt/tivoli/tsm/client/ba/bin/InclExcl 155 | # 156 | # [*inclexcl_hash*] 157 | # Hash from Hiera to build contents of inclexcl_hash_source 158 | # inclexcl_hash - optional 159 | # Default: {} 160 | # 161 | # [*inclexcl_hash_source*] 162 | # Path to the include/exclude file built from hiera 163 | # inclexcl_hash_source - optional 164 | # Default: 165 | # Redhat, Debian, Solaris: /opt/tivoli/tsm/client/ba/bin/InclExcl.hash 166 | # AIX: /usr/tivoli/tsm/client/ba/bin64/InclExcl.hash 167 | # 168 | # [*inclexcl_local*] 169 | # Path to the local include/exclude file 170 | # inclexcl_local - optional 171 | # Default: /opt/tivoli/tsm/client/ba/bin/InclExcl.local 172 | # 173 | # [*inclexcl_replace*] 174 | # Whether or not to replace a existing InclExcl file 175 | # inclexcl_replace - optional 176 | # Default: false 177 | # 178 | # [*inclexcl_source*] 179 | # Where to find a default include/exclude file 180 | # inclexcl_source - optional 181 | # Default: 182 | # Redhat: puppet://modules/tsm/InclExcl.redhat 183 | # Debian: puppet://modules/tsm/InclExcl.debian 184 | # Solaris: puppet://modules/tsm/InclExcl.solaris 185 | # Suse: puppet://modules/tsm/InclExcl.sles 186 | # 187 | # [*config_global_hash*] 188 | # config_hash - hash with global parameters for the dms.sys file 189 | # keys => value 190 | # Default: {} 191 | # 192 | # [*config_hash*] 193 | # config_hash - hash with extended parameters 194 | # keys => value 195 | # Default: {} 196 | # 197 | # [*config_opt_hash*] 198 | # config_opt_hash - hash with opt parameters 199 | # keys => value 200 | # Default: undef 201 | # 202 | # [*tcp_server_address*] 203 | # TSM server used for this client 204 | # tcp_server_address - obligatory 205 | # 206 | # [*stanzas*] 207 | # Define multiple server stanzas as a hash. 208 | # config_hash - hash of tsm::config::stanza instances 209 | # Default: undef 210 | # 211 | # === Examples 212 | # 213 | # Single server configuration: 214 | # 215 | # class { tsm: 216 | # tcp_server_address => 'tsmserver1' 217 | # } 218 | # 219 | # Configure multiple stanzas: 220 | # 221 | # class { tsm: 222 | # stanzas => { 223 | # 'tsmserver1' => { 224 | # 'tcp_server_address' => 'tsmserver1' 225 | # }, 226 | # 'tsmserver2' => { 227 | # 'tcp_server_address' => 'tsmserver2' 228 | # }, 229 | # } 230 | # 231 | # === Authors 232 | # 233 | # Toni Schmidbauer 234 | # 235 | # === Copyright 236 | # 237 | # Copyright 2014-2015 Toni Schmidbauer 238 | # 239 | class tsm ( 240 | $server_name = $name, 241 | $tcp_server_address = undef, 242 | $comm_method = $::tsm::params::comm_method, 243 | $tcp_port = $::tsm::params::tcp_port, 244 | $package_ensure = $::tsm::params::package_ensure, 245 | $packages = $::tsm::params::packages, 246 | $package_adminfile = $::tsm::params::package_adminfile, 247 | $package_uri = $::tsm::params::package_uri, 248 | $package_provider = $::tsm::params::package_provider, 249 | $service_manage = $::tsm::params::service_manage, 250 | $service_ensure = $::tsm::params::service_ensure, 251 | $service_enable = $::tsm::params::service_enable, 252 | $service_name = $::tsm::params::service_name, 253 | $service_manifest = $::tsm::params::service_manifest, 254 | $service_manifest_source = $::tsm::params::service_manifest_source, 255 | $service_script = $::tsm::params::service_script, 256 | $service_script_source = $::tsm::params::service_script_source, 257 | $tsm_pwd = $::tsm::params::tsm_pwd, 258 | $tsm_pwd_kdb = $::tsm::params::tsm_pwd_kdb, 259 | $initial_password = $::tsm::params::initial_password, 260 | $set_initial_password = $::tsm::params::set_initial_password, 261 | $config_dir = $::tsm::params::config_dir, 262 | $config = $::tsm::params::config, 263 | $config_opt = $::tsm::params::config_opt, 264 | $config_replace = $::tsm::params::config_replace, 265 | $config_template = undef, 266 | $config_header_template = $::tsm::params::config_header_template, 267 | $config_global_template = $::tsm::params::config_global_template, 268 | $config_stanza_template = $::tsm::params::config_stanza_template, 269 | $rootgroup = $::tsm::params::rootgroup, 270 | $inclexcl = $::tsm::params::inclexcl, 271 | $inclexcl_hash = {}, 272 | $inclexcl_hash_source = $::tsm::params::inclexcl_hash_source, 273 | $inclexcl_local = $::tsm::params::inclexcl_local, 274 | $inclexcl_replace = $::tsm::params::inclexcl_replace, 275 | $inclexcl_source = $::tsm::params::inclexcl_source, 276 | $config_global_hash = {}, 277 | $config_hash = {}, 278 | $config_opt_hash = undef, 279 | $stanzas = {}, 280 | ) inherits tsm::params { 281 | 282 | validate_string($package_ensure) 283 | validate_array($packages) 284 | validate_string($package_uri) 285 | validate_bool($service_manage) 286 | validate_re($service_ensure,'^true$|^false$|^running$|^stopped$') 287 | validate_bool($service_enable) 288 | validate_string($service_name) 289 | validate_absolute_path($tsm_pwd) 290 | validate_absolute_path($tsm_pwd_kdb) 291 | validate_string($initial_password) 292 | validate_bool($set_initial_password) 293 | validate_absolute_path($config) 294 | validate_absolute_path($config_opt) 295 | validate_bool($config_replace) 296 | validate_string($rootgroup) 297 | 298 | case $::osfamily { 299 | 'solaris': { 300 | validate_absolute_path($package_adminfile) 301 | validate_absolute_path($service_manifest) 302 | validate_string($service_manifest_source) 303 | validate_absolute_path($service_script) 304 | validate_string($service_script_source) 305 | validate_string($package_provider) 306 | } 307 | 'redhat': { 308 | validate_string($service_manifest_source) 309 | validate_absolute_path($service_script) 310 | validate_string($service_script_source) 311 | } 312 | 'suse': { 313 | validate_string($service_manifest_source) 314 | validate_absolute_path($service_script) 315 | validate_string($service_script_source) 316 | } 317 | 'debian': { 318 | validate_string($service_manifest_source) 319 | validate_absolute_path($service_script) 320 | validate_string($service_script_source) 321 | } 322 | 'AIX': { 323 | validate_string($package_provider) 324 | } 325 | default: { 326 | # do nothing 327 | } 328 | } 329 | 330 | anchor {'tsm::begin': } 331 | -> class { '::tsm::install': } 332 | -> class { '::tsm::config': } 333 | -> class { '::tsm::service': } 334 | -> anchor {'tsm::end': } 335 | } 336 | -------------------------------------------------------------------------------- /manifests/install.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::packages 2 | # 3 | # install tsm packages and set package dependencies for solaris 4 | # 5 | # === Authors 6 | # 7 | # Toni Schmidbauer 8 | # David Orn Johannsson 9 | # 10 | # === Copyright 11 | # 12 | # Copyright 2013-2015 Toni Schmidbauer 13 | # 14 | class tsm::install { 15 | tsm::installpkg { $::tsm::packages: 16 | ensure => $::tsm::package_ensure, 17 | uri => $::tsm::package_uri, 18 | adminfile => $::tsm::package_adminfile, 19 | provider => $::tsm::package_provider, 20 | } 21 | 22 | case $::osfamily { 23 | solaris: { 24 | case $::hardwareisa { 25 | i386: { 26 | Package['gsk8cry32'] 27 | -> Package['gsk8ssl32'] 28 | -> Package['gsk8cry64'] 29 | -> Package['gsk8ssl64'] 30 | -> Package['TIVsmCapi'] 31 | -> Package['TIVsmCba'] 32 | } 33 | sparc: { 34 | Package['gsk8cry64'] 35 | -> Package['gsk8ssl64'] 36 | -> Package['TIVsmCapi'] 37 | -> Package['TIVsmCba'] 38 | } 39 | default: { 40 | fail("Unsupported hardwareisa ${::hardwareisa} for osfamily ${::osfamily} in install.pp!") 41 | } 42 | } 43 | } 44 | default: {} 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /manifests/installpkg.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::installpkg 2 | # 3 | # Install the tsm package on Linux and Solaris 4 | # 5 | # === Parameters 6 | # 7 | # [*ensure*] 8 | # What should be done with the package 9 | # Default: installed 10 | # 11 | # [*adminfile*] 12 | # Solaris sysv package adminfile for a seemless installation, only required 13 | # on Solaris. 14 | # Default: /dev/null 15 | # 16 | # [*uri*] 17 | # Where to get the TSM package from, only required on Solaris 18 | # Default: empty string 19 | # 20 | # === Authors 21 | # 22 | # Toni Schmidbauer 23 | # 24 | # === Copyright 25 | # 26 | # Copyright 2014-2015 Toni Schmidbauer 27 | # 28 | 29 | define tsm::installpkg ( 30 | $ensure = 'installed', 31 | $adminfile = '/dev/null', 32 | $uri = '', 33 | $provider = undef, 34 | ) { 35 | validate_string($ensure) 36 | validate_absolute_path($adminfile) 37 | validate_string($uri) 38 | validate_string($provider) 39 | 40 | package { $title: 41 | ensure => $ensure, 42 | } 43 | 44 | case $::osfamily { 45 | solaris: { 46 | Package[$title] { 47 | source => "${uri}/${title}.pkg", 48 | adminfile => $adminfile, 49 | install_options => ['-G', ], 50 | provider => 'sun', 51 | } 52 | } 53 | 'AIX': { 54 | Package[$title] { 55 | source => $uri, 56 | provider => $provider, 57 | } 58 | } 59 | default: { 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /manifests/params.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::params 2 | # 3 | # Default parameters for tsm 4 | # 5 | # For a documentation of all variables see init.pp 6 | # 7 | # === Authors 8 | # 9 | # Toni Schmidbauer 10 | # 11 | # === Copyright 12 | # 13 | # Copyright 2013-2015 Toni Schmidbauer 14 | # 15 | class tsm::params { 16 | $package_ensure = 'installed' 17 | 18 | $service_manage = false 19 | $service_enable = true 20 | $service_ensure = 'running' 21 | 22 | # default password file 23 | $tsm_pwd = '/etc/adsm/TSM.PWD' 24 | $tsm_pwd_kdb = '/etc/adsm/TSM.KDB' 25 | $initial_password = 'start' 26 | $set_initial_password = true 27 | 28 | # default parameters for dsm.sys 29 | $comm_method = 'TCPip' 30 | $tcp_port = '1500' 31 | 32 | $config_header_template = 'tsm/dsm.sys_header.erb' 33 | $config_global_template = 'tsm/dsm.sys_global.erb' 34 | $config_stanza_template = 'tsm/dsm.sys_stanza.erb' 35 | $config_opt_template = 'tsm/dsm.opt.erb' 36 | $config_replace = false 37 | 38 | $inclexcl_replace = false 39 | 40 | case $::osfamily { 41 | 'redhat': { 42 | if $::operatingsystemmajrelease == '7' { 43 | $config_dir = '/opt/tivoli/tsm/client/ba/bin' 44 | $config = '/opt/tivoli/tsm/client/ba/bin/dsm.sys' 45 | $config_opt = '/opt/tivoli/tsm/client/ba/bin/dsm.opt' 46 | $inclexcl = '/opt/tivoli/tsm/client/ba/bin/InclExcl' 47 | $inclexcl_hash_source = '/opt/tivoli/tsm/client/ba/bin/InclExcl.hash' 48 | $inclexcl_local = '/opt/tivoli/tsm/client/ba/bin/InclExcl.local' 49 | $packages = ['TIVsm-BA'] 50 | $package_adminfile = undef 51 | $package_uri = undef 52 | $package_provider = undef 53 | $service_name = 'dsmsched' 54 | $service_script = '/etc/systemd/system/dsmsched.service' 55 | $service_script_source = 'puppet:///modules/tsm/dsmsched.redhat7' 56 | $service_manifest = undef 57 | $service_manifest_source = undef 58 | $inclexcl_source = 'puppet:///modules/tsm/InclExcl.redhat' 59 | $rootgroup = 'root' 60 | } 61 | else { 62 | $config_dir = '/opt/tivoli/tsm/client/ba/bin' 63 | $config = '/opt/tivoli/tsm/client/ba/bin/dsm.sys' 64 | $config_opt = '/opt/tivoli/tsm/client/ba/bin/dsm.opt' 65 | $inclexcl = '/opt/tivoli/tsm/client/ba/bin/InclExcl' 66 | $inclexcl_hash_source = '/opt/tivoli/tsm/client/ba/bin/InclExcl.hash' 67 | $inclexcl_local = '/opt/tivoli/tsm/client/ba/bin/InclExcl.local' 68 | $packages = ['TIVsm-BA'] 69 | $package_adminfile = undef 70 | $package_uri = undef 71 | $package_provider = undef 72 | $service_name = 'dsmsched' 73 | $service_script = '/etc/init.d/dsmsched' 74 | $service_script_source = 'puppet:///modules/tsm/dsmsched.redhat' 75 | $service_manifest = undef 76 | $service_manifest_source = undef 77 | $inclexcl_source = 'puppet:///modules/tsm/InclExcl.redhat' 78 | $rootgroup = 'root' 79 | } 80 | } 81 | 'debian': { 82 | $config_dir = '/opt/tivoli/tsm/client/ba/bin' 83 | $config = '/opt/tivoli/tsm/client/ba/bin/dsm.sys' 84 | $config_opt = '/opt/tivoli/tsm/client/ba/bin/dsm.opt' 85 | $inclexcl = '/opt/tivoli/tsm/client/ba/bin/InclExcl' 86 | $inclexcl_hash_source = '/opt/tivoli/tsm/client/ba/bin/InclExcl.hash' 87 | $inclexcl_local = '/opt/tivoli/tsm/client/ba/bin/InclExcl.local' 88 | $packages = ['tivsm-api64', 'tivsm-ba', 'gskcrypt64', 'gskssl64'] 89 | $package_adminfile = undef 90 | $package_uri = undef 91 | $package_provider = undef 92 | $service_name = 'dsmsched' 93 | $service_script = '/etc/init.d/dsmsched' 94 | $service_script_source = 'puppet:///modules/tsm/dsmsched.debian' 95 | $service_manifest = undef 96 | $service_manifest_source = undef 97 | $inclexcl_source = 'puppet:///modules/tsm/InclExcl.debian' 98 | $rootgroup = 'root' 99 | } 100 | 'suse': { 101 | if $::operatingsystemmajrelease == '12' { 102 | $config_dir = '/opt/tivoli/tsm/client/ba/bin' 103 | $config = '/opt/tivoli/tsm/client/ba/bin/dsm.sys' 104 | $config_opt = '/opt/tivoli/tsm/client/ba/bin/dsm.opt' 105 | $inclexcl = '/opt/tivoli/tsm/client/ba/bin/InclExcl' 106 | $inclexcl_hash_source = '/opt/tivoli/tsm/client/ba/bin/InclExcl.hash' 107 | $inclexcl_local = '/opt/tivoli/tsm/client/ba/bin/InclExcl.local' 108 | $packages = ['TIVsm-BA'] 109 | $package_adminfile = undef 110 | $package_uri = undef 111 | $package_provider = undef 112 | $service_name = 'dsmcad' 113 | $service_script = '/etc/systemd/system/dsmsched.service' 114 | $service_script_source = 'puppet:///modules/tsm/dsmsched.sles12' 115 | $service_manifest = undef 116 | $service_manifest_source = undef 117 | $inclexcl_source = 'puppet:///modules/tsm/InclExcl.sles' 118 | $rootgroup = 'root' 119 | } 120 | else { 121 | $config_dir = '/opt/tivoli/tsm/client/ba/bin' 122 | $config = '/opt/tivoli/tsm/client/ba/bin/dsm.sys' 123 | $config_opt = '/opt/tivoli/tsm/client/ba/bin/dsm.opt' 124 | $inclexcl = '/opt/tivoli/tsm/client/ba/bin/InclExcl' 125 | $inclexcl_hash_source = '/opt/tivoli/tsm/client/ba/bin/InclExcl.hash' 126 | $inclexcl_local = '/opt/tivoli/tsm/client/ba/bin/InclExcl.local' 127 | $packages = ['TIVsm-BA'] 128 | $package_adminfile = undef 129 | $package_uri = undef 130 | $package_provider = undef 131 | $service_name = 'dsmsched' 132 | $service_script = '/etc/init.d/dsmsched' 133 | $service_script_source = 'puppet:///modules/tsm/dsmsched.sles' 134 | $service_manifest = undef 135 | $service_manifest_source = undef 136 | $inclexcl_source = 'puppet:///modules/tsm/InclExcl.sles' 137 | $rootgroup = 'root' 138 | } 139 | } 140 | 'solaris': { 141 | case $::hardwareisa { 142 | 'i386': { 143 | $config_dir = '/opt/tivoli/tsm/client/ba/bin' 144 | $config = '/opt/tivoli/tsm/client/ba/bin/dsm.sys' 145 | $config_opt = '/opt/tivoli/tsm/client/ba/bin/dsm.opt' 146 | $inclexcl = '/opt/tivoli/tsm/client/ba/bin/InclExcl' 147 | $inclexcl_hash_source = '/opt/tivoli/tsm/client/ba/bin/InclExcl.hash' 148 | $inclexcl_local = '/opt/tivoli/tsm/client/ba/bin/InclExcl.local' 149 | $packages = ['gsk8cry32','gsk8cry64','gsk8ssl32','gsk8ssl64','TIVsmCapi', 'TIVsmCba'] 150 | $package_uri = "http://server/pkgs/solaris/${::hardwareisa}/5.10" 151 | $package_adminfile = '/var/sadm/install/admin/puppet' 152 | $package_provider = 'sun' 153 | $service_name = 'tsm' 154 | $service_manifest = '/var/svc/manifest/site/tsmsched.xml' 155 | $service_manifest_source = 'puppet:///modules/tsm/tsmsched.xml' 156 | $service_script = '/lib/svc/method/tsmsched' 157 | $service_script_source = 'puppet:///modules/tsm/tsmsched.solaris' 158 | $inclexcl_source = 'puppet:///modules/tsm/InclExcl.solaris' 159 | $rootgroup = 'root' 160 | } 161 | 'sparc': { 162 | $config_dir = '/opt/tivoli/tsm/client/ba/bin' 163 | $config = '/opt/tivoli/tsm/client/ba/bin/dsm.sys' 164 | $config_opt = '/opt/tivoli/tsm/client/ba/bin/dsm.opt' 165 | $inclexcl = '/opt/tivoli/tsm/client/ba/bin/InclExcl' 166 | $inclexcl_hash_source = '/opt/tivoli/tsm/client/ba/bin/InclExcl.hash' 167 | $inclexcl_local = '/opt/tivoli/tsm/client/ba/bin/InclExcl.local' 168 | $packages = ['gsk8cry64','gsk8ssl64','TIVsmCapi', 'TIVsmCba'] 169 | $package_uri = "http://server/pkgs/solaris/${::hardwareisa}/5.10" 170 | $package_adminfile = '/var/sadm/install/admin/puppet' 171 | $package_provider = 'sun' 172 | $service_name = 'tsm' 173 | $service_manifest = '/var/svc/manifest/site/tsmsched.xml' 174 | $service_manifest_source = 'puppet:///modules/tsm/tsmsched.xml' 175 | $service_script = '/lib/svc/method/tsmsched' 176 | $service_script_source = 'puppet:///modules/tsm/tsmsched.solaris' 177 | $inclexcl_source = 'puppet:///modules/tsm/InclExcl.solaris' 178 | $rootgroup = 'root' 179 | } 180 | default:{ 181 | fail("Unsupported hardwareisa ${::hardwareisa} for osfamily ${::osfamily} in config.pp!") 182 | } 183 | } 184 | } 185 | 'AIX': { 186 | $config_dir = '/usr/tivoli/tsm/client/ba/bin64' 187 | $config = '/usr/tivoli/tsm/client/ba/bin64/dsm.sys' 188 | $config_opt = '/usr/tivoli/tsm/client/ba/bin64/dsm.opt' 189 | $inclexcl = '/usr/tivoli/tsm/client/ba/bin64/InclExcl' 190 | $inclexcl_hash_source = '/usr/tivoli/tsm/client/ba/bin64/InclExcl.hash' 191 | $inclexcl_local = '/usr/tivoli/tsm/client/ba/bin64/InclExcl.local' 192 | $packages = ['tivoli.tsm.client.ba.64bit.base'] 193 | $package_provider = 'nim' 194 | $package_uri = undef 195 | $package_adminfile = undef 196 | $service_name = 'dsmsched' 197 | $service_manifest = undef 198 | $service_manifest_source = undef 199 | $service_script = undef 200 | $service_script_source = undef 201 | $inclexcl_source = 'puppet:///modules/tsm/InclExcl.AIX' 202 | $rootgroup = 'system' 203 | } 204 | default: { 205 | fail("Unsupported osfamily ${::osfamily} in params.pp!") 206 | } 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /manifests/service.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::service 2 | # 3 | # Manage the dsmsched process 4 | # 5 | # === Parameters 6 | # 7 | # === Variables 8 | # 9 | # === Examples 10 | # 11 | # class { tsm::service 12 | # } 13 | # 14 | # === Authors 15 | # 16 | # Toni Schmidbauer 17 | # 18 | # === Copyright 19 | # 20 | # Copyright 2014-2015 Toni Schmidbauer 21 | # 22 | class tsm::service { 23 | 24 | if ! ($::tsm::service_ensure in [ true, false, 'running', 'stopped' ]) { 25 | fail('service_ensure parameter must be running or stopped') 26 | } 27 | 28 | if $::tsm::service_manage == true { 29 | case $::osfamily { 30 | redhat: { 31 | contain tsm::service::redhat 32 | } 33 | debian: { 34 | contain tsm::service::debian 35 | } 36 | suse: { 37 | contain tsm::service::sles 38 | } 39 | solaris: { 40 | contain tsm::service::solaris 41 | } 42 | 'AIX': { 43 | contain tsm::service::aix 44 | } 45 | default: { 46 | fail("Unsupported osfamily ${::osfamily} for managing the service!") 47 | } 48 | } 49 | 50 | if $::tsm::set_initial_password == true { 51 | $password = tsm_generate_rand_string() 52 | 53 | exec {'generate-tsm.pwd': 54 | command => "dsmc set password ${::tsm::initial_password} ${password}", 55 | unless => ["test -f ${::tsm::tsm_pwd}", "test -f ${::tsm::tsm_pwd_kdb}"], 56 | path => ['/bin', '/usr/bin'] 57 | } 58 | Exec['generate-tsm.pwd'] -> Service[$::tsm::service_name] 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /manifests/service/aix.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::service::aix 2 | # 3 | # Manage tsm service on AIX 4 | # 5 | 6 | class tsm::service::aix { 7 | 8 | exec { 'mkssys': 9 | command => '/usr/bin/mkssys -s dsmsched -p /usr/bin/dsmc -u 0 -a "sched" -S -n 15 -f 9 -R -q', 10 | unless => "/usr/bin/lssrc -s ${::tsm::service_name}"; 11 | } 12 | 13 | service { $::tsm::service_name: 14 | ensure => $::tsm::service_ensure, 15 | enable => $::tsm::service_enable, 16 | hasstatus => true, 17 | hasrestart => false, 18 | subscribe => Concat[$::tsm::config], 19 | } 20 | 21 | Exec['mkssys'] -> Service[$::tsm::service_name] 22 | } 23 | -------------------------------------------------------------------------------- /manifests/service/debian.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::service::debian 2 | # 3 | # Manage tsm service on debian 4 | # 5 | # === Authors 6 | # 7 | # Toni Schmidbauer 8 | # David Orn Johannsson 9 | # 10 | # === Copyright 11 | # 12 | # Copyright 2014-2015 Toni Schmidbauer 13 | # 14 | class tsm::service::debian { 15 | 16 | file { $::tsm::service_script: 17 | ensure => file, 18 | owner => 'root', 19 | group => 'root', 20 | mode => '0755', 21 | source => $::tsm::service_script_source, 22 | } 23 | 24 | service { $::tsm::service_name: 25 | ensure => $::tsm::service_ensure, 26 | enable => $::tsm::service_enable, 27 | hasstatus => true, 28 | hasrestart => true, 29 | subscribe => Concat[$::tsm::config], 30 | } 31 | 32 | File[$::tsm::service_script] -> Service[$::tsm::service_name] 33 | } 34 | -------------------------------------------------------------------------------- /manifests/service/redhat.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::service::redhat 2 | # 3 | # Manage tsm service on redhat 4 | # 5 | # === Authors 6 | # 7 | # Toni Schmidbauer 8 | # 9 | # === Copyright 10 | # 11 | # Copyright 2014-2015 Toni Schmidbauer 12 | # 13 | class tsm::service::redhat { 14 | 15 | $service_script_mode = $::operatingsystemmajrelease ? { 16 | '7' => '0644', 17 | default => '0755' 18 | } 19 | 20 | file { $::tsm::service_script: 21 | ensure => file, 22 | owner => 'root', 23 | group => 'root', 24 | mode => $service_script_mode, 25 | source => $::tsm::service_script_source, 26 | } 27 | 28 | service { $::tsm::service_name: 29 | ensure => $::tsm::service_ensure, 30 | enable => $::tsm::service_enable, 31 | hasstatus => true, 32 | hasrestart => true, 33 | subscribe => Concat[$::tsm::config], 34 | } 35 | 36 | File[$::tsm::service_script] -> Service[$::tsm::service_name] 37 | } 38 | -------------------------------------------------------------------------------- /manifests/service/sles.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::service::sles 2 | # 3 | # Manage tsm service on sles 4 | # 5 | # === Authors 6 | # 7 | # Toni Schmidbauer 8 | # Sebastian Hempel 9 | # 10 | # === Copyright 11 | # 12 | # Copyright 2014-2015 Toni Schmidbauer 13 | # Copyright 2018 Sebastian Hempel 14 | # 15 | class tsm::service::sles { 16 | 17 | $service_script_mode = $::operatingsystemmajrelease ? { 18 | '12' => '0644', 19 | default => '0755' 20 | } 21 | 22 | file { $::tsm::service_script: 23 | ensure => file, 24 | owner => 'root', 25 | group => 'root', 26 | mode => $service_script_mode, 27 | source => $::tsm::service_script_source, 28 | } 29 | 30 | service { $::tsm::service_name: 31 | ensure => $::tsm::service_ensure, 32 | enable => $::tsm::service_enable, 33 | hasstatus => true, 34 | hasrestart => true, 35 | subscribe => Concat[$::tsm::config], 36 | } 37 | 38 | File[$::tsm::service_script] -> Service[$::tsm::service_name] 39 | } 40 | -------------------------------------------------------------------------------- /manifests/service/solaris.pp: -------------------------------------------------------------------------------- 1 | # == Class: tsm::service::solaris 2 | # 3 | # Manage the tsm service on solaris 4 | # 5 | # === Authors 6 | # 7 | # Toni Schmidbauer 8 | # 9 | # === Copyright 10 | # 11 | # Copyright 2014-2015 Toni Schmidbauer 12 | # 13 | class tsm::service::solaris { 14 | 15 | file { $::tsm::service_script: 16 | ensure => file, 17 | owner => 'root', 18 | group => 'root', 19 | mode => '0755', 20 | replace => true, 21 | source => $::tsm::service_script_source, 22 | } 23 | 24 | file { $::tsm::service_manifest: 25 | ensure => file, 26 | owner => 'root', 27 | group => 'root', 28 | mode => '0444', 29 | source => $::tsm::service_manifest_source, 30 | } 31 | 32 | service { $::tsm::service_name: 33 | ensure => $::tsm::service_ensure, 34 | enable => $::tsm::service_enable, 35 | manifest => $tsm::service_manifest, 36 | subscribe => Concat[$::tsm::config], 37 | } 38 | 39 | File[$::tsm::service_script] -> Service[$::tsm::service_name] 40 | File[$::tsm::service_manifest] -> Service[$::tsm::service_name] 41 | } 42 | -------------------------------------------------------------------------------- /metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nosolutions-tsm", 3 | "version": "1.2.0", 4 | "author": "Toni Schmidbauer", 5 | "summary": "Install and manage the TSM client", 6 | "license": "GPL-2.0", 7 | "source": "https://github.com/nosolutions/puppet-tsm", 8 | "tags": [ 9 | "tsm", 10 | "dsmsched", 11 | "tivoli" 12 | ], 13 | "operatingsystem_support": [ 14 | { 15 | "operatingsystem": "Debian", 16 | "operatingsystemrelease": [ 17 | "6", 18 | "7" 19 | ] 20 | }, 21 | { 22 | "operatingsystem": "RedHat", 23 | "operatingsystemrelease": [ 24 | "5", 25 | "6", 26 | "7" 27 | ] 28 | }, 29 | { 30 | "operatingsystem": "CentOS", 31 | "operatingsystemrelease": [ 32 | "5", 33 | "6", 34 | "7" 35 | ] 36 | }, 37 | { 38 | "operatingsystem": "OracleLinux", 39 | "operatingsystemrelease": [ 40 | "5", 41 | "6", 42 | "7" 43 | ] 44 | }, 45 | { 46 | "operatingsystem": "Scientific", 47 | "operatingsystemrelease": [ 48 | "5", 49 | "6", 50 | "7" 51 | ] 52 | }, 53 | { 54 | "operatingsystem": "Solaris", 55 | "operatingsystemrelease": [ 56 | "5.10", 57 | "5.11" 58 | ] 59 | }, 60 | { 61 | "operatingsystem": "AIX", 62 | "operatingsystemrelease": [ 63 | "7.1" 64 | ] 65 | } 66 | ], 67 | "requirements": [ 68 | { 69 | "name": "puppet", 70 | "version_requirement": ">= 3.0.0 < 5.0.0" 71 | } 72 | ], 73 | "issues_url": "https://github.com/nosolutions/puppet-tsm/issues", 74 | "project_page": "https://github.com/nosolutions/puppet-tsm", 75 | "dependencies": [ 76 | { 77 | "name": "puppetlabs/stdlib", 78 | "version_requirement": ">=0.1.6 <5.0.0" 79 | }, 80 | { 81 | "name": "puppetlabs/concat", 82 | "version_requirement": ">=1.1.0 <3.0.0" 83 | } 84 | ] 85 | } 86 | -------------------------------------------------------------------------------- /spec/classes/config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'tsm::config' do 4 | on_supported_os.each do |os, facts| 5 | 6 | tsm_class = <<-EOS 7 | class { tsm: 8 | tcp_server_address => '127.0.0.1', 9 | tcp_port => 1234, 10 | config_hash => { 11 | 'errorlogname' => '/var/log/dsmerror.log', 12 | 'errorlogretention' => '31 D', 13 | 'schedlogname' => '/var/log/dsmsched.log', 14 | 'schedlogretention' => '30 d', 15 | 'nodename' => 'node01', 16 | 'passwordaccess' => 'generate', 17 | 'domain' => 'all-local', 18 | 'makesparsefile' => 'no', 19 | }, 20 | } 21 | EOS 22 | 23 | 24 | context "on #{os} with class variable definitions" do 25 | let(:pre_condition) { tsm_class } 26 | let(:dsm_sys_fragment_tsm) { my_fixture_read('dsm_sys_fragment_tsm') } 27 | let(:facts) { facts } 28 | it { is_expected.to compile.with_all_deps } 29 | it { should contain_concat__fragment('dsm_sys_stanza_tsm').with_content(dsm_sys_fragment_tsm) } 30 | end 31 | 32 | tsm_class_stanzas = <<-EOS 33 | class { tsm: 34 | stanzas => { 35 | 'tsmserver1' => { 36 | 'tcp_server_address' => "127.0.0.1", 37 | 'tcp_port' => 1234, 38 | 'config_hash' => { 39 | 'errorlogname' => '/var/log/dsmerror.log', 40 | 'errorlogretention' => '31 D', 41 | 'schedlogname' => '/var/log/dsmsched.log', 42 | 'schedlogretention' => '30 d', 43 | 'nodename' => 'node01', 44 | 'passwordaccess' => 'generate', 45 | 'domain' => 'all-local', 46 | 'makesparsefile' => 'no', 47 | }, 48 | }, 49 | 'tsmserver2' => { 50 | 'tcp_server_address' => '127.0.0.2', 51 | 'config_hash' => { 'other_key' => 'other_value' }, 52 | }, 53 | } 54 | } 55 | EOS 56 | 57 | context "on #{os} with stanza definitions" do 58 | let(:pre_condition) { tsm_class_stanzas } 59 | let(:dsm_sys_fragment_tsmserver1) { my_fixture_read('dsm_sys_fragment_tsmserver1') } 60 | let(:dsm_sys_fragment_tsmserver2) { my_fixture_read('dsm_sys_fragment_tsmserver2') } 61 | let(:facts) { facts } 62 | it { is_expected.to compile.with_all_deps } 63 | it { should contain_concat__fragment('dsm_sys_stanza_tsmserver1').with_content(dsm_sys_fragment_tsmserver1) } 64 | it { should contain_concat__fragment('dsm_sys_stanza_tsmserver2').with_content(dsm_sys_fragment_tsmserver2) } 65 | end 66 | 67 | end 68 | end 69 | -------------------------------------------------------------------------------- /spec/classes/coverage_spec.rb: -------------------------------------------------------------------------------- 1 | at_exit { RSpec::Puppet::Coverage.report! } 2 | -------------------------------------------------------------------------------- /spec/classes/tsm_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'tsm' do 4 | ['RedHat', 'Solaris', 'Debian'].each do |system| 5 | 6 | let :facts do 7 | { 8 | :osfamily => system, 9 | :kernelrelease => '5.10', 10 | :hardwareisa => 'i386', 11 | :concat_basedir => '/dne', 12 | } 13 | end 14 | 15 | let(:params) do 16 | { 17 | :tcp_server_address => 'tsm', 18 | } 19 | end 20 | 21 | it { should contain_class('tsm::install') } 22 | it { should contain_class('tsm::config') } 23 | it { should contain_class('tsm::service') } 24 | end 25 | 26 | context 'tsm::config with default options' do 27 | it do 28 | should contain_concat('/opt/tivoli/tsm/client/ba/bin/dsm.sys').with({ 29 | 'ensure' => 'present', 30 | 'replace' => false, 31 | 'owner' => 'root', 32 | 'group' => 'root', 33 | 'mode' => '0644' 34 | }) 35 | end 36 | 37 | it do 38 | should contain_concat__fragment('dsm_sys_header').with({ 39 | 'target' => '/opt/tivoli/tsm/client/ba/bin/dsm.sys', 40 | }) 41 | end 42 | 43 | it do 44 | should contain_concat__fragment('dsm_sys_global').with({ 45 | 'target' => '/opt/tivoli/tsm/client/ba/bin/dsm.sys', 46 | }) 47 | end 48 | 49 | it do 50 | should contain_concat__fragment('dsm_sys_stanza_tsm').with({ 51 | 'target' => '/opt/tivoli/tsm/client/ba/bin/dsm.sys', 52 | }) 53 | end 54 | 55 | it do 56 | should contain_concat__fragment('dsm_sys_local').with({ 57 | 'target' => '/opt/tivoli/tsm/client/ba/bin/dsm.sys', 58 | 'source' => '/opt/tivoli/tsm/client/ba/bin/dsm.sys.local', 59 | 'order' => '31', 60 | }) 61 | end 62 | 63 | it do 64 | should contain_file('/opt/tivoli/tsm/client/ba/bin/dsm.sys.local').with({ 65 | 'ensure' => 'file', 66 | 'owner' => 'root', 67 | 'group' => 'root', 68 | 'mode' => '0644' 69 | }) 70 | end 71 | 72 | it { should contain_concat__fragment('dsm_sys_local').that_requires('File[/opt/tivoli/tsm/client/ba/bin/dsm.sys.local]') } 73 | 74 | it do 75 | should contain_file('/opt/tivoli/tsm/client/ba/bin/InclExcl').with({ 76 | 'ensure' => 'file', 77 | 'replace' => 'false', 78 | 'owner' => 'root', 79 | 'group' => 'root', 80 | 'mode' => '0644' 81 | }) 82 | end 83 | 84 | it do 85 | should contain_file('/opt/tivoli/tsm/client/ba/bin/InclExcl.local').with({ 86 | 'ensure' => 'file', 87 | 'replace' => 'false', 88 | 'owner' => 'root', 89 | 'group' => 'root', 90 | 'mode' => '0644' 91 | }) 92 | end 93 | 94 | it do 95 | should contain_file('/opt/tivoli/tsm/client/ba/bin/dsm.opt').with_ensure('present') 96 | end 97 | 98 | context 'on AIX' do 99 | 100 | let :facts do 101 | { 102 | :osfamily => 'AIX', 103 | :concat_basedir => '/dne', 104 | } 105 | end 106 | 107 | it do 108 | should contain_concat('/usr/tivoli/tsm/client/ba/bin64/dsm.sys').with({ 109 | 'ensure' => 'present', 110 | 'replace' => false, 111 | 'owner' => 'root', 112 | 'group' => 'system', 113 | 'mode' => '0644' 114 | }) 115 | end 116 | 117 | it do 118 | should contain_concat__fragment('dsm_sys_header').with({ 119 | 'target' => '/usr/tivoli/tsm/client/ba/bin64/dsm.sys', 120 | }) 121 | end 122 | 123 | it do 124 | should contain_concat__fragment('dsm_sys_global').with({ 125 | 'target' => '/usr/tivoli/tsm/client/ba/bin64/dsm.sys', 126 | }) 127 | end 128 | 129 | it do 130 | should contain_concat__fragment('dsm_sys_stanza_tsm').with({ 131 | 'target' => '/usr/tivoli/tsm/client/ba/bin64/dsm.sys', 132 | }) 133 | end 134 | 135 | it do 136 | should contain_concat__fragment('dsm_sys_local').with({ 137 | 'target' => '/usr/tivoli/tsm/client/ba/bin64/dsm.sys', 138 | 'source' => '/usr/tivoli/tsm/client/ba/bin64/dsm.sys.local', 139 | 'order' => '31', 140 | }) 141 | end 142 | 143 | it do 144 | should contain_file('/usr/tivoli/tsm/client/ba/bin64/dsm.sys.local').with({ 145 | 'ensure' => 'file', 146 | 'owner' => 'root', 147 | 'group' => 'system', 148 | 'mode' => '0644' 149 | }) 150 | end 151 | 152 | it { should contain_concat__fragment('dsm_sys_local').that_requires('File[/usr/tivoli/tsm/client/ba/bin64/dsm.sys.local]') } 153 | 154 | it do 155 | should contain_file('/usr/tivoli/tsm/client/ba/bin64/InclExcl').with({ 156 | 'ensure' => 'file', 157 | 'replace' => 'false', 158 | 'owner' => 'root', 159 | 'group' => 'system', 160 | 'mode' => '0644' 161 | }) 162 | end 163 | 164 | it do 165 | should contain_file('/usr/tivoli/tsm/client/ba/bin64/InclExcl.local').with({ 166 | 'ensure' => 'file', 167 | 'replace' => 'false', 168 | 'owner' => 'root', 169 | 'group' => 'system', 170 | 'mode' => '0644' 171 | }) 172 | end 173 | 174 | it do 175 | should_not contain_file('//usr/tivoli/tsm/client/ba/bin64/dsm.opt').with({ 176 | 'ensure' => 'file', 177 | 'replace' => 'false', 178 | 'owner' => 'root', 179 | 'group' => 'system', 180 | 'mode' => '0644' 181 | }) 182 | end 183 | end 184 | 185 | context 'tsm::config with dsm.opt file' do 186 | config_opt_hash = { 187 | 'key1' => 'val1', 188 | 'key2' => 'val2', 189 | 'key3' => 'val3', 190 | 'key4' => [ 'val41', 'val42', ], 191 | } 192 | 193 | let(:params) {{ 194 | :tcp_server_address => 'tsm', 195 | :config_opt_hash => config_opt_hash, 196 | }} 197 | 198 | it do 199 | should contain_file('/opt/tivoli/tsm/client/ba/bin/dsm.opt').with({ 200 | 'owner' => 'root', 201 | 'group' => 'root', 202 | 'mode' => '0644' 203 | }) 204 | 205 | config_opt_hash.each do |k,v| 206 | if v.is_a?(String) 207 | should contain_file('/opt/tivoli/tsm/client/ba/bin/dsm.opt').with_content(/#{k}\s+#{v}/) 208 | elsif v.is_a?(Array) 209 | v.each do |a| 210 | should contain_file('/opt/tivoli/tsm/client/ba/bin/dsm.opt').with_content(/#{k}\s+#{a}/) 211 | end 212 | else 213 | fail "value is neither String nor Array" 214 | end 215 | end 216 | end 217 | end 218 | 219 | context 'on Redhat 6' do 220 | let :facts do 221 | { 222 | :osfamily => 'RedHat', 223 | :operatingsystemmajrelease => '6', 224 | :architecure => 'i386', 225 | :concat_basedir => '/dne', 226 | } 227 | end 228 | 229 | it do 230 | should contain_file('/opt/tivoli/tsm/client/ba/bin/InclExcl').with({ 231 | 'ensure' => 'file', 232 | 'replace' => 'false', 233 | 'owner' => 'root', 234 | 'group' => 'root', 235 | 'mode' => '0644', 236 | 'source' => 'puppet:///modules/tsm/InclExcl.redhat' 237 | }) 238 | end 239 | end 240 | 241 | context 'on Debian 7' do 242 | let :facts do 243 | { 244 | :osfamily => 'Debian', 245 | :operatingsystemmajrelease => '7', 246 | :architecure => 'amd64', 247 | :concat_basedir => '/dne', 248 | } 249 | end 250 | 251 | it do 252 | should contain_file('/opt/tivoli/tsm/client/ba/bin/InclExcl').with({ 253 | 'ensure' => 'file', 254 | 'replace' => 'false', 255 | 'owner' => 'root', 256 | 'group' => 'root', 257 | 'mode' => '0644', 258 | 'source' => 'puppet:///modules/tsm/InclExcl.debian' 259 | }) 260 | end 261 | end 262 | 263 | context 'on Solaris' do 264 | let :facts do 265 | { 266 | :osfamily => 'Solaris', 267 | :hardwareisa => 'i386', 268 | :concat_basedir => '/dne', 269 | } 270 | end 271 | 272 | it do 273 | should contain_file('/opt/tivoli/tsm/client/ba/bin/InclExcl').with({ 274 | 'ensure' => 'file', 275 | 'replace' => 'false', 276 | 'owner' => 'root', 277 | 'group' => 'root', 278 | 'mode' => '0644', 279 | 'source' => 'puppet:///modules/tsm/InclExcl.solaris' 280 | }) 281 | end 282 | end 283 | 284 | context 'on AIX' do 285 | let :facts do 286 | { 287 | :osfamily => 'AIX', 288 | :concat_basedir => '/dne', 289 | } 290 | end 291 | 292 | it do 293 | should contain_file('/usr/tivoli/tsm/client/ba/bin64/InclExcl').with({ 294 | 'ensure' => 'file', 295 | 'replace' => 'false', 296 | 'owner' => 'root', 297 | 'group' => 'system', 298 | 'mode' => '0644', 299 | 'source' => 'puppet:///modules/tsm/InclExcl.AIX' 300 | }) 301 | end 302 | end 303 | 304 | end 305 | 306 | context 'tsm::config with config_replace set to true' do 307 | let(:params) do 308 | { 309 | :tcp_server_address => 'tsm', 310 | :config_replace => true, 311 | } 312 | end 313 | 314 | it do 315 | should_not contain_file('/opt/tivoli/tsm/client/ba/bin/dsm.opt').with({ 316 | 'ensure' => 'file', 317 | 'replace' => true, 318 | 'owner' => 'root', 319 | 'group' => 'root', 320 | 'mode' => '0644' 321 | }) 322 | end 323 | 324 | it do 325 | should contain_concat('/opt/tivoli/tsm/client/ba/bin/dsm.sys').with({ 326 | 'ensure' => 'present', 327 | 'replace' => true, 328 | 'owner' => 'root', 329 | 'group' => 'root', 330 | 'mode' => '0644' 331 | }) 332 | end 333 | 334 | context 'on AIX' do 335 | 336 | let :facts do 337 | { 338 | :osfamily => 'AIX', 339 | :concat_basedir => '/dne', 340 | } 341 | end 342 | 343 | let(:params) do 344 | { 345 | :tcp_server_address => 'tsm', 346 | :config_replace => true, 347 | } 348 | end 349 | 350 | it do 351 | should_not contain_file('/usr/tivoli/tsm/client/ba/bin64/dsm.opt').with({ 352 | 'ensure' => 'file', 353 | 'replace' => true, 354 | 'owner' => 'root', 355 | 'group' => 'system', 356 | 'mode' => '0644' 357 | }) 358 | end 359 | 360 | it do 361 | should contain_concat('/usr/tivoli/tsm/client/ba/bin64/dsm.sys').with({ 362 | 'ensure' => 'present', 363 | 'replace' => true, 364 | 'owner' => 'root', 365 | 'group' => 'system', 366 | 'mode' => '0644' 367 | }) 368 | end 369 | end 370 | end 371 | 372 | context 'tsm::install on RedHat 6' do 373 | let :facts do 374 | { 375 | :osfamily => 'RedHat', 376 | :operatingsystemmajrelease => '6', 377 | :architecure => 'i386', 378 | :concat_basedir => '/dne', 379 | } 380 | end 381 | 382 | describe 'should install tsm packages ' do 383 | let(:params) do 384 | { 385 | :tcp_server_address => 'tsm', 386 | } 387 | end 388 | 389 | it { should contain_tsm__installpkg('TIVsm-BA').with_ensure('installed') } 390 | end 391 | 392 | describe 'should allow package_ensure to be overridden'do 393 | let(:params) do { 394 | :tcp_server_address => 'tsm', 395 | :package_ensure => 'latest' 396 | } 397 | end 398 | 399 | it do 400 | should contain_tsm__installpkg('TIVsm-BA').with({ 401 | :ensure => 'latest', 402 | }) 403 | end 404 | end 405 | 406 | describe 'should allow package_name to be overridden'do 407 | let(:params) {{ 408 | :tcp_server_address => 'tsm', 409 | :packages => ['deadbeaf'] 410 | }} 411 | 412 | it { should contain_tsm__installpkg("deadbeaf").with_ensure('installed') } 413 | end 414 | end 415 | 416 | context 'tsm::service on Redhat 6' do 417 | let :facts do 418 | { 419 | :osfamily => 'RedHat', 420 | :operatingsystemmajrelease => '6', 421 | :architecure => 'i386', 422 | :concat_basedir => '/dne', 423 | } 424 | end 425 | 426 | describe 'when tsm::service_manage is false' do 427 | it { should_not contain_class('tsm::service::redhat')} 428 | end 429 | 430 | describe 'when tsm::service_manage is true' do 431 | let(:params) do 432 | { 433 | :tcp_server_address => 'tsm', 434 | :service_manage => true, 435 | } 436 | end 437 | 438 | it { should contain_class('tsm::service::redhat')} 439 | 440 | it do 441 | should contain_file('/etc/init.d/dsmsched').with({ 442 | 'ensure' => 'file', 443 | 'owner' => 'root', 444 | 'group' => 'root', 445 | 'mode' => '0755', 446 | 'source' => 'puppet:///modules/tsm/dsmsched.redhat' 447 | }) 448 | end 449 | 450 | it do 451 | should contain_service('dsmsched').with({ 452 | 'ensure' => 'running', 453 | 'enable' => 'true', 454 | 'hasstatus' => 'true', 455 | 'hasrestart' => 'true', 456 | 'subscribe' => 'Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]', 457 | }) 458 | end 459 | 460 | it { should contain_service('dsmsched').that_requires('File[/etc/init.d/dsmsched]') } 461 | end 462 | 463 | describe 'when service_manage is true and set_intial_password is true' do 464 | let(:params) do 465 | { 466 | :tcp_server_address => 'tsm', 467 | :service_manage => true, 468 | :initial_password => 'start', 469 | :set_initial_password => true, 470 | } 471 | end 472 | 473 | it do 474 | should contain_exec('generate-tsm.pwd').with({ 475 | 'unless' => ['test -f /etc/adsm/TSM.PWD', 'test -f /etc/adsm/TSM.KDB'], 476 | 'path' => ['/bin', '/usr/bin'], 477 | }) 478 | end 479 | 480 | it { should contain_exec('generate-tsm.pwd').with_command(/dsmc set password start .*/) } 481 | 482 | it { should contain_service('dsmsched').that_requires('Exec[generate-tsm.pwd]') } 483 | 484 | end 485 | end 486 | context 'tsm::service::dsmcad on Redhat 6' do 487 | let :facts do 488 | { 489 | :osfamily => 'RedHat', 490 | :operatingsystemmajrelease => '6', 491 | :architecure => 'i386', 492 | :concat_basedir => '/dne', 493 | } 494 | end 495 | 496 | describe 'when tsm::service_manage is false' do 497 | it { should_not contain_class('tsm::service::redhat')} 498 | end 499 | 500 | describe 'when tsm::service_manage is true' do 501 | let(:params) do 502 | { 503 | :tcp_server_address => 'tsm', 504 | :service_manage => true, 505 | :service_script => '/etc/init.d/dsmcad', 506 | :service_name => 'dsmcad', 507 | :service_script_source => 'puppet:///modules/tsm/dsmcad.redhat', 508 | 509 | } 510 | end 511 | 512 | it { should contain_class('tsm::service::redhat')} 513 | 514 | it do 515 | should contain_file('/etc/init.d/dsmcad').with({ 516 | 'ensure' => 'file', 517 | 'owner' => 'root', 518 | 'group' => 'root', 519 | 'mode' => '0755', 520 | 'source' => 'puppet:///modules/tsm/dsmcad.redhat' 521 | }) 522 | end 523 | 524 | it do 525 | should contain_service('dsmcad').with({ 526 | 'ensure' => 'running', 527 | 'enable' => 'true', 528 | 'hasstatus' => 'true', 529 | 'hasrestart' => 'true', 530 | 'subscribe' => 'Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]', 531 | }) 532 | end 533 | 534 | it { should contain_service('dsmcad').that_requires('File[/etc/init.d/dsmcad]') } 535 | end 536 | 537 | describe 'when service_manage is true and set_intial_password is true' do 538 | let(:params) do 539 | { 540 | :tcp_server_address => 'tsm', 541 | :service_manage => true, 542 | :initial_password => 'start', 543 | :set_initial_password => true, 544 | :service_script => '/etc/init.d/dsmcad', 545 | :service_name => 'dsmcad', 546 | :service_script_source => 'puppet:///modules/tsm/dsmcad.redhat', 547 | } 548 | end 549 | 550 | it do 551 | should contain_exec('generate-tsm.pwd').with({ 552 | 'unless' => ['test -f /etc/adsm/TSM.PWD', 'test -f /etc/adsm/TSM.KDB'], 553 | 'path' => ['/bin', '/usr/bin'], 554 | }) 555 | end 556 | 557 | it { should contain_exec('generate-tsm.pwd').with_command(/dsmc set password start .*/) } 558 | 559 | it { should contain_service('dsmcad').that_requires('Exec[generate-tsm.pwd]') } 560 | 561 | end 562 | end 563 | 564 | 565 | context 'tsm::service::dsmcad on Redhat 7' do 566 | let :facts do 567 | { 568 | :osfamily => 'RedHat', 569 | :operatingsystemmajrelease => '7', 570 | :architecure => 'i386', 571 | :concat_basedir => '/dne', 572 | :service_script => '/etc/systemd/system/dsmcad.service', 573 | :service_name => 'dsmcad', 574 | :service_script_source => 'puppet:///modules/tsm/dsmcad.redhat7', 575 | } 576 | end 577 | 578 | describe 'when tsm::service_manage is true' do 579 | let(:params) do 580 | { 581 | :tcp_server_address => 'tsm', 582 | :service_manage => true, 583 | :service_script => '/etc/systemd/system/dsmcad.service', 584 | :service_name => 'dsmcad', 585 | :service_script_source => 'puppet:///modules/tsm/dsmcad.redhat7', 586 | } 587 | end 588 | 589 | it { should contain_class('tsm::service::redhat')} 590 | 591 | it do 592 | should contain_file('/etc/systemd/system/dsmcad.service').with({ 593 | 'ensure' => 'file', 594 | 'owner' => 'root', 595 | 'group' => 'root', 596 | 'mode' => '0644', 597 | 'source' => 'puppet:///modules/tsm/dsmcad.redhat7' 598 | }) 599 | end 600 | 601 | it do 602 | should contain_service('dsmcad').with({ 603 | 'ensure' => 'running', 604 | 'enable' => 'true', 605 | 'hasstatus' => 'true', 606 | 'hasrestart' => 'true', 607 | 'subscribe' => 'Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]', 608 | }) 609 | end 610 | 611 | it { should contain_service('dsmcad').that_requires('File[/etc/systemd/system/dsmcad.service]') } 612 | end 613 | end 614 | 615 | context 'tsm::service on Redhat 7' do 616 | let :facts do 617 | { 618 | :osfamily => 'RedHat', 619 | :operatingsystemmajrelease => '7', 620 | :architecure => 'i386', 621 | :concat_basedir => '/dne', 622 | } 623 | end 624 | 625 | describe 'when tsm::service_manage is true' do 626 | let(:params) do 627 | { 628 | :tcp_server_address => 'tsm', 629 | :service_manage => true, 630 | } 631 | end 632 | 633 | it { should contain_class('tsm::service::redhat')} 634 | 635 | it do 636 | should contain_file('/etc/systemd/system/dsmsched.service').with({ 637 | 'ensure' => 'file', 638 | 'owner' => 'root', 639 | 'group' => 'root', 640 | 'mode' => '0644', 641 | 'source' => 'puppet:///modules/tsm/dsmsched.redhat7' 642 | }) 643 | end 644 | 645 | it do 646 | should contain_service('dsmsched').with({ 647 | 'ensure' => 'running', 648 | 'enable' => 'true', 649 | 'hasstatus' => 'true', 650 | 'hasrestart' => 'true', 651 | 'subscribe' => 'Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]', 652 | }) 653 | end 654 | 655 | it { should contain_service('dsmsched').that_requires('File[/etc/systemd/system/dsmsched.service]') } 656 | end 657 | end 658 | 659 | context 'tsm::install on Debian 7' do 660 | let :facts do 661 | { 662 | :osfamily => 'Debian', 663 | :operatingsystemmajrelease => '7', 664 | :architecture => 'amd64', 665 | :concat_basedir => '/dne', 666 | 667 | } 668 | end 669 | 670 | describe 'when tsm::service_manage is false' do 671 | it { should_not contain_class('tsm::service::debian')} 672 | end 673 | 674 | describe 'should install tsm packages ' do 675 | let(:params) do 676 | { 677 | :tcp_server_address => 'tsm', 678 | } 679 | end 680 | 681 | it { should contain_tsm__installpkg('tivsm-ba').with_ensure('installed') } 682 | it { should contain_tsm__installpkg('tivsm-api64').with_ensure('installed') } 683 | it { should contain_tsm__installpkg('gskcrypt64').with_ensure('installed') } 684 | it { should contain_tsm__installpkg('gskssl64').with_ensure('installed') } 685 | end 686 | 687 | describe 'should allow package_ensure to be overridden'do 688 | let(:params) do { 689 | :tcp_server_address => 'tsm', 690 | :package_ensure => 'latest' 691 | } 692 | end 693 | 694 | it do 695 | should contain_tsm__installpkg('tivsm-api64').with({ 696 | :ensure => 'latest', 697 | }) 698 | end 699 | end 700 | 701 | describe 'should allow package_name to be overridden'do 702 | let(:params) {{ 703 | :tcp_server_address => 'tsm', 704 | :packages => ['deadbeaf'] 705 | }} 706 | 707 | it { should contain_tsm__installpkg("deadbeaf").with_ensure('installed') } 708 | end 709 | end 710 | 711 | context 'tsm::service on Debian 7' do 712 | let :facts do 713 | { 714 | :osfamily => 'Debian', 715 | :operatingsystemmajrelease => '7', 716 | :architecture => 'amd64', 717 | :concat_basedir => '/dne', 718 | } 719 | end 720 | 721 | describe 'when tsm::service_manage is false' do 722 | it { should_not contain_class('tsm::service::debian')} 723 | end 724 | 725 | describe 'when tsm::service_manage is true' do 726 | let(:params) do 727 | { 728 | :tcp_server_address => 'tsm', 729 | :service_manage => true, 730 | } 731 | end 732 | 733 | it { should contain_class('tsm::service::debian')} 734 | 735 | it do 736 | should contain_file('/etc/init.d/dsmsched').with({ 737 | 'ensure' => 'file', 738 | 'owner' => 'root', 739 | 'group' => 'root', 740 | 'mode' => '0755', 741 | 'source' => 'puppet:///modules/tsm/dsmsched.debian' 742 | }) 743 | end 744 | 745 | it do 746 | should contain_service('dsmsched').with({ 747 | 'ensure' => 'running', 748 | 'enable' => 'true', 749 | 'hasstatus' => 'true', 750 | 'hasrestart' => 'true', 751 | 'subscribe' => 'Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]', 752 | }) 753 | end 754 | 755 | it { should contain_service('dsmsched').that_requires('File[/etc/init.d/dsmsched]') } 756 | end 757 | end 758 | context 'tsm::service::dsmcad on Debian 7' do 759 | let :facts do 760 | { 761 | :osfamily => 'Debian', 762 | :operatingsystemmajrelease => '7', 763 | :architecture => 'amd64', 764 | :concat_basedir => '/dne', 765 | } 766 | end 767 | 768 | describe 'when tsm::service_manage is false' do 769 | it { should_not contain_class('tsm::service::debian')} 770 | end 771 | 772 | describe 'when tsm::service_manage is true' do 773 | let(:params) do 774 | { 775 | :tcp_server_address => 'tsm', 776 | :service_manage => true, 777 | :service_script => '/etc/init.d/dsmcad', 778 | :service_name => 'dsmcad', 779 | :service_script_source => 'puppet:///modules/tsm/dsmcad.debian', 780 | } 781 | end 782 | 783 | it { should contain_class('tsm::service::debian')} 784 | 785 | it do 786 | should contain_file('/etc/init.d/dsmcad').with({ 787 | 'ensure' => 'file', 788 | 'owner' => 'root', 789 | 'group' => 'root', 790 | 'mode' => '0755', 791 | 'source' => 'puppet:///modules/tsm/dsmcad.debian' 792 | }) 793 | end 794 | 795 | it do 796 | should contain_service('dsmcad').with({ 797 | 'ensure' => 'running', 798 | 'enable' => 'true', 799 | 'hasstatus' => 'true', 800 | 'hasrestart' => 'true', 801 | 'subscribe' => 'Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]', 802 | }) 803 | end 804 | 805 | it { should contain_service('dsmcad').that_requires('File[/etc/init.d/dsmcad]') } 806 | end 807 | end 808 | 809 | context 'tsm::install on Solaris 10 i386' do 810 | let :facts do 811 | { 812 | :osfamily => 'Solaris', 813 | :kernelrelease => '5.10', 814 | :hardwareisa => 'i386', 815 | :concat_basedir => '/dne', 816 | 817 | } 818 | end 819 | 820 | it do 821 | should contain_tsm__installpkg('TIVsmCba').with({ 822 | :uri => /^http:\/\/.*/, 823 | :adminfile => '/var/sadm/install/admin/puppet', 824 | }) 825 | end 826 | 827 | it do 828 | should contain_tsm__installpkg('TIVsmCapi').with({ 829 | :uri => /^http:\/\/.*/, 830 | :adminfile => '/var/sadm/install/admin/puppet', 831 | }) 832 | end 833 | 834 | it { should contain_package('TIVsmCba').that_requires('Package[TIVsmCapi]') } 835 | it { should contain_package('TIVsmCapi').that_requires('Package[gsk8ssl64]') } 836 | it { should contain_package('gsk8ssl64').that_requires('Package[gsk8cry64]') } 837 | it { should contain_package('gsk8cry64').that_requires('Package[gsk8ssl32]') } 838 | it { should contain_package('gsk8ssl32').that_requires('Package[gsk8cry32]') } 839 | end 840 | 841 | context 'tsm::install on Solaris 10 sparc' do 842 | let :facts do 843 | { 844 | :osfamily => 'Solaris', 845 | :kernelrelease => '5.10', 846 | :hardwareisa => 'sparc', 847 | :concat_basedir => '/dne', 848 | } 849 | end 850 | 851 | it do 852 | should contain_tsm__installpkg('TIVsmCba').with({ 853 | 'uri' => /^http:\/\/.*/, 854 | 'adminfile' => '/var/sadm/install/admin/puppet', 855 | }) 856 | end 857 | 858 | it do 859 | should contain_tsm__installpkg('TIVsmCapi').with({ 860 | 'uri' => /^http:\/\/.*/, 861 | 'adminfile' => '/var/sadm/install/admin/puppet', 862 | }) 863 | end 864 | 865 | it { should contain_package('TIVsmCba').that_requires('Package[TIVsmCapi]') } 866 | it { should contain_package('TIVsmCapi').that_requires('Package[gsk8ssl64]') } 867 | it { should contain_package('gsk8ssl64').that_requires('Package[gsk8cry64]') } 868 | end 869 | 870 | context 'tsm::service on Solaris 10' do 871 | let :facts do 872 | { 873 | :osfamily => 'Solaris', 874 | :kernelrelease => '5.10', 875 | :hardwareisa => 'i386', 876 | :concat_basedir => '/dne', 877 | } 878 | end 879 | 880 | describe 'when tsm::service_manage is false' do 881 | it { should_not contain_class('tsm::service::solaris')} 882 | end 883 | 884 | describe 'when tsm::service_manage is true' do 885 | let(:params) do 886 | { 887 | :tcp_server_address => 'tsm', 888 | :service_manage => true, 889 | } 890 | end 891 | 892 | it { should contain_class('tsm::service::solaris')} 893 | 894 | it do 895 | should contain_file('/lib/svc/method/tsmsched').with({ 896 | 'ensure' => 'file', 897 | 'owner' => 'root', 898 | 'group' => 'root', 899 | 'mode' => '0755', 900 | 'replace' => 'true', 901 | 'source' => 'puppet:///modules/tsm/tsmsched.solaris' 902 | }) 903 | end 904 | 905 | it do 906 | should contain_file('/var/svc/manifest/site/tsmsched.xml').with({ 907 | 'ensure' => 'file', 908 | 'owner' => 'root', 909 | 'group' => 'root', 910 | 'mode' => '0444', 911 | 'source' => 'puppet:///modules/tsm/tsmsched.xml' 912 | }) 913 | end 914 | 915 | it do 916 | should contain_service('tsm').with({ 917 | 'ensure' => 'running', 918 | 'enable' => 'true', 919 | 'manifest' => '/var/svc/manifest/site/tsmsched.xml', 920 | 'subscribe' => 'Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]', 921 | }) 922 | end 923 | 924 | it { should contain_service('tsm').that_requires('File[/var/svc/manifest/site/tsmsched.xml]') } 925 | it { should contain_service('tsm').that_requires('File[/lib/svc/method/tsmsched]') } 926 | end 927 | 928 | describe 'when service_manage is true and set_intial_password is true' do 929 | let(:params) do 930 | { 931 | :tcp_server_address => 'tsm', 932 | :service_manage => true, 933 | :initial_password => 'start', 934 | :set_initial_password => true, 935 | } 936 | end 937 | 938 | it do 939 | should contain_exec('generate-tsm.pwd').with({ 940 | 'unless' => ['test -f /etc/adsm/TSM.PWD', 'test -f /etc/adsm/TSM.KDB'], 941 | 'path' => ['/bin', '/usr/bin'], 942 | }) 943 | end 944 | 945 | it { should contain_exec('generate-tsm.pwd').with_command(/dsmc set password start .*/) } 946 | 947 | it { should contain_service('tsm').that_requires('Exec[generate-tsm.pwd]') } 948 | end 949 | end 950 | 951 | context 'tsm::service::dsmcad on Solaris 10' do 952 | let :facts do 953 | { 954 | :osfamily => 'Solaris', 955 | :kernelrelease => '5.10', 956 | :hardwareisa => 'i386', 957 | :concat_basedir => '/dne', 958 | } 959 | end 960 | 961 | describe 'when tsm::service_manage is false' do 962 | it { should_not contain_class('tsm::service::solaris')} 963 | end 964 | 965 | describe 'when tsm::service_manage is true' do 966 | let(:params) do 967 | { 968 | :tcp_server_address => 'tsm', 969 | :service_manage => true, 970 | :service_manifest => '/var/svc/manifest/site/tsmcad.xml', 971 | :service_manifest_source => 'puppet:///modules/tsm/tsmcad.xml', 972 | :service_script => '/lib/svc/method/tsmcad', 973 | :service_name => 'tsm', 974 | :service_script_source => 'puppet:///modules/tsm/tsmcad.solaris', 975 | } 976 | end 977 | 978 | it { should contain_class('tsm::service::solaris')} 979 | 980 | it do 981 | should contain_file('/lib/svc/method/tsmcad').with({ 982 | 'ensure' => 'file', 983 | 'owner' => 'root', 984 | 'group' => 'root', 985 | 'mode' => '0755', 986 | 'replace' => 'true', 987 | 'source' => 'puppet:///modules/tsm/tsmcad.solaris' 988 | }) 989 | end 990 | 991 | it do 992 | should contain_file('/var/svc/manifest/site/tsmcad.xml').with({ 993 | 'ensure' => 'file', 994 | 'owner' => 'root', 995 | 'group' => 'root', 996 | 'mode' => '0444', 997 | 'source' => 'puppet:///modules/tsm/tsmcad.xml' 998 | }) 999 | end 1000 | 1001 | it do 1002 | should contain_service('tsm').with({ 1003 | 'ensure' => 'running', 1004 | 'enable' => 'true', 1005 | 'manifest' => '/var/svc/manifest/site/tsmcad.xml', 1006 | 'subscribe' => 'Concat[/opt/tivoli/tsm/client/ba/bin/dsm.sys]', 1007 | }) 1008 | end 1009 | 1010 | it { should contain_service('tsm').that_requires('File[/var/svc/manifest/site/tsmcad.xml]') } 1011 | it { should contain_service('tsm').that_requires('File[/lib/svc/method/tsmcad]') } 1012 | end 1013 | 1014 | describe 'when service_manage is true and set_intial_password is true' do 1015 | let(:params) do 1016 | { 1017 | :tcp_server_address => 'tsm', 1018 | :service_manage => true, 1019 | :initial_password => 'start', 1020 | :set_initial_password => true, 1021 | } 1022 | end 1023 | 1024 | it do 1025 | should contain_exec('generate-tsm.pwd').with({ 1026 | 'unless' => ['test -f /etc/adsm/TSM.PWD', 'test -f /etc/adsm/TSM.KDB'], 1027 | 'path' => ['/bin', '/usr/bin'], 1028 | }) 1029 | end 1030 | 1031 | it { should contain_exec('generate-tsm.pwd').with_command(/dsmc set password start .*/) } 1032 | 1033 | it { should contain_service('tsm').that_requires('Exec[generate-tsm.pwd]') } 1034 | end 1035 | end 1036 | 1037 | context 'tsm::install on AIX' do 1038 | let :facts do 1039 | { 1040 | :osfamily => 'AIX', 1041 | :concat_basedir => '/dne', 1042 | 1043 | } 1044 | end 1045 | 1046 | let(:params) do 1047 | { 1048 | :tcp_server_address => 'tsm', 1049 | :package_uri => 'lpp_aix71tl3sp4', 1050 | } 1051 | end 1052 | 1053 | it do 1054 | should contain_tsm__installpkg('tivoli.tsm.client.ba.64bit.base').with({ 1055 | 'ensure' => 'installed', 1056 | 'uri' => 'lpp_aix71tl3sp4', 1057 | 'provider' => 'nim', 1058 | }) 1059 | end 1060 | end 1061 | 1062 | context 'tsm::service on AIX' do 1063 | let :facts do 1064 | { 1065 | :osfamily => 'AIX', 1066 | :concat_basedir => '/dne', 1067 | } 1068 | end 1069 | 1070 | describe 'when tsm::service_manage is false' do 1071 | it { should_not contain_class('tsm::service::aix')} 1072 | end 1073 | 1074 | describe 'when tsm::service_manage is true' do 1075 | let(:params) do 1076 | { 1077 | :tcp_server_address => 'tsm', 1078 | :service_manage => true, 1079 | } 1080 | end 1081 | 1082 | it { should contain_class('tsm::service::aix')} 1083 | 1084 | it do 1085 | should contain_exec('mkssys').with({ 1086 | 'command' => '/usr/bin/mkssys -s dsmsched -p /usr/bin/dsmc -u 0 -a "sched" -S -n 15 -f 9 -R -q', 1087 | 'unless' => '/usr/bin/lssrc -s dsmsched' 1088 | }) 1089 | end 1090 | 1091 | it do 1092 | should contain_service('dsmsched').with({ 1093 | 'ensure' => 'running', 1094 | 'enable' => 'true', 1095 | 'hasstatus' => 'true', 1096 | 'hasrestart' => 'false', 1097 | 'subscribe' => 'Concat[/usr/tivoli/tsm/client/ba/bin64/dsm.sys]', 1098 | }) 1099 | end 1100 | 1101 | it { should contain_service('dsmsched').that_requires('Exec[mkssys]') } 1102 | end 1103 | end 1104 | 1105 | end 1106 | -------------------------------------------------------------------------------- /spec/defines/installpkg_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'tsm::installpkg', :type => :define do 4 | let(:title) { 'TIVsm-BA'} 5 | 6 | context 'on Redhat' do 7 | let :facts do 8 | { 9 | :osfamily => 'RedHat' 10 | } 11 | end 12 | 13 | it { should contain_package('TIVsm-BA').with_ensure('installed') } 14 | end 15 | 16 | context 'on Debian' do 17 | let(:title) { 'tivsm-ba'} 18 | 19 | let :facts do 20 | { 21 | :osfamily => 'Debian' 22 | } 23 | end 24 | 25 | it { should contain_package('tivsm-ba').with_ensure('installed') } 26 | end 27 | 28 | context 'on Solaris' do 29 | let :facts do 30 | { 31 | :osfamily => 'Solaris' 32 | } 33 | end 34 | 35 | let :params do 36 | { 37 | :adminfile => '/adminfile', 38 | :uri => 'http://server/pkg' 39 | } 40 | end 41 | 42 | it do 43 | should contain_package('TIVsm-BA').with({ 44 | 'ensure' => 'installed', 45 | 'source' => 'http://server/pkg/TIVsm-BA.pkg', 46 | 'adminfile' => '/adminfile', 47 | 'install_options' => ['-G'], 48 | 'provider' => 'sun' 49 | }) 50 | end 51 | end 52 | 53 | context 'on AIX' do 54 | let(:title) { 'tivoli.tsm.client.ba.64bit.base'} 55 | 56 | let :facts do 57 | { 58 | :osfamily => 'AIX' 59 | } 60 | end 61 | 62 | it { should contain_package('tivoli.tsm.client.ba.64bit.base').with_ensure('installed') } 63 | end 64 | 65 | end 66 | -------------------------------------------------------------------------------- /spec/fixtures/classes/config/dsm_sys_fragment: -------------------------------------------------------------------------------- 1 | * stanza for server tsm 2 | Servername tsm 3 | COMMMethod TCPip 4 | TCPPort 1500 5 | TCPServeraddress 127.0.0.1 6 | INCLExcl /opt/tivoli/tsm/client/ba/bin/InclExcl 7 | INCLExcl /opt/tivoli/tsm/client/ba/bin/InclExcl.local 8 | INCLExcl /opt/tivoli/tsm/client/ba/bin/InclExcl.hash 9 | key value 10 | 11 | -------------------------------------------------------------------------------- /spec/fixtures/classes/config/dsm_sys_fragment_tsm: -------------------------------------------------------------------------------- 1 | * stanza for server tsm 2 | Servername tsm 3 | COMMMethod TCPip 4 | TCPPort 1234 5 | TCPServeraddress 127.0.0.1 6 | INCLExcl /opt/tivoli/tsm/client/ba/bin/InclExcl 7 | INCLExcl /opt/tivoli/tsm/client/ba/bin/InclExcl.local 8 | domain all-local 9 | errorlogname /var/log/dsmerror.log 10 | errorlogretention 31 D 11 | makesparsefile no 12 | nodename node01 13 | passwordaccess generate 14 | schedlogname /var/log/dsmsched.log 15 | schedlogretention 30 d 16 | 17 | -------------------------------------------------------------------------------- /spec/fixtures/classes/config/dsm_sys_fragment_tsmserver1: -------------------------------------------------------------------------------- 1 | * stanza for server tsmserver1 2 | Servername tsmserver1 3 | COMMMethod TCPip 4 | TCPPort 1234 5 | TCPServeraddress 127.0.0.1 6 | INCLExcl /opt/tivoli/tsm/client/ba/bin/InclExcl_tsmserver1 7 | INCLExcl /opt/tivoli/tsm/client/ba/bin/InclExcl_tsmserver1.local 8 | domain all-local 9 | errorlogname /var/log/dsmerror.log 10 | errorlogretention 31 D 11 | makesparsefile no 12 | nodename node01 13 | passwordaccess generate 14 | schedlogname /var/log/dsmsched.log 15 | schedlogretention 30 d 16 | 17 | -------------------------------------------------------------------------------- /spec/fixtures/classes/config/dsm_sys_fragment_tsmserver2: -------------------------------------------------------------------------------- 1 | * stanza for server tsmserver2 2 | Servername tsmserver2 3 | COMMMethod TCPip 4 | TCPPort 1500 5 | TCPServeraddress 127.0.0.2 6 | INCLExcl /opt/tivoli/tsm/client/ba/bin/InclExcl_tsmserver2 7 | INCLExcl /opt/tivoli/tsm/client/ba/bin/InclExcl_tsmserver2.local 8 | other_key other_value 9 | 10 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'puppetlabs_spec_helper/module_spec_helper' 2 | require 'rspec-puppet-facts' 3 | 4 | require 'simplecov' 5 | require 'simplecov-console' 6 | 7 | include RspecPuppetFacts 8 | 9 | SimpleCov.start do 10 | add_filter '/spec' 11 | add_filter '/vendor' 12 | formatter SimpleCov::Formatter::MultiFormatter.new([ 13 | SimpleCov::Formatter::HTMLFormatter, 14 | SimpleCov::Formatter::Console 15 | ]) 16 | end 17 | 18 | begin 19 | require 'coveralls' 20 | Coveralls.wear! 21 | rescue LoadError 22 | end 23 | -------------------------------------------------------------------------------- /templates/dsm.opt.erb: -------------------------------------------------------------------------------- 1 | * HEADER: This file was autogenerated by puppet. Any changes to this 2 | * HEADER: file are going to overwritten on the next puppet run. 3 | * HEADER: If you would like to include local settings, use dsm.opt.local 4 | 5 | <%- @config_opt_hash = scope['::tsm::config_opt_hash']%> 6 | 7 | <%- if ! @config_opt_hash.nil? -%> 8 | <%- @config_opt_hash.keys.sort.each do |config_key| -%> 9 | <%- config_value = @config_opt_hash[config_key] -%> 10 | <%- if config_value.kind_of?(Array) -%> 11 | <%- config_value.each do |item| -%> 12 | <%- line = " %-21s %s" % [config_key, item] -%> 13 | <%= line %> 14 | <%- end -%> 15 | <%- else -%> 16 | <%- line = " %-21s %s" % [config_key, config_value] -%> 17 | <%= line %> 18 | <%- end -%> 19 | <%- end -%> 20 | <%- end -%> 21 | -------------------------------------------------------------------------------- /templates/dsm.sys_global.erb: -------------------------------------------------------------------------------- 1 | * global options 2 | <%- scope['::tsm::config_global_hash'].sort.each do |config_key, config_values| -%> 3 | <%- [config_values].flatten.each do |config_value| -%> 4 | <%= "%-21s %s" % [config_key, config_value] %> 5 | <%- end -%> 6 | <%- end -%> 7 | 8 | -------------------------------------------------------------------------------- /templates/dsm.sys_header.erb: -------------------------------------------------------------------------------- 1 | * HEADER: This file was autogenerated by puppet. Any changes to this 2 | * HEADER: file are going to overwritten on the next puppet run. 3 | * HEADER: If you would like to include local settings, use dsm.sys.local 4 | 5 | -------------------------------------------------------------------------------- /templates/dsm.sys_stanza.erb: -------------------------------------------------------------------------------- 1 | * stanza for server <%= @server_name %> 2 | Servername <%= @server_name %> 3 | COMMMethod <%= @comm_method %> 4 | TCPPort <%= @tcp_port %> 5 | TCPServeraddress <%= @tcp_server_address %> 6 | INCLExcl <%= @inclexcl %> 7 | INCLExcl <%= @inclexcl_local %> 8 | <%- if @inclexcl_hash != {} -%> 9 | INCLExcl <%= @inclexcl_hash_source %> 10 | <%- end -%> 11 | <%- @config_hash.sort.each do |config_key, config_values| -%> 12 | <%- [config_values].flatten.each do |config_value| -%> 13 | <%= "%-21s %s" % [config_key, config_value] %> 14 | <%- end -%> 15 | <%- end -%> 16 | 17 | -------------------------------------------------------------------------------- /templates/inclexcl_hash.erb: -------------------------------------------------------------------------------- 1 | * HEADER: This file was autogenerated by puppet. Any changes to this 2 | * HEADER: file are going to overwritten on the next puppet run. 3 | 4 | * Blank lines in this file do not indicate an error. It just means 5 | * that there were no includes/excludes configured/set in Hiera. 6 | 7 | <%- if ! scope['::tsm::inclexcl_hash'].nil? -%> 8 | <%- scope['::tsm::inclexcl_hash'].keys.sort.each do |config_key| -%> 9 | <%- config_value = scope['::tsm::inclexcl_hash'][config_key] -%> 10 | <%- if config_value.kind_of?(Array) -%> 11 | <%- config_value.each do |item| -%> 12 | <%- line = " %-21s %s" % [config_key, item] -%> 13 | <%= line %> 14 | <%- end -%> 15 | <%- else -%> 16 | <%- line = " %-21s %s" % [config_key, config_value] -%> 17 | <%= line %> 18 | <%- end -%> 19 | <%- end -%> 20 | <%- end -%> 21 | -------------------------------------------------------------------------------- /tests/init.pp: -------------------------------------------------------------------------------- 1 | # The baseline for module testing used by Puppet Labs is that each manifest 2 | # should have a corresponding test manifest that declares that class or defined 3 | # type. 4 | # 5 | # Tests are then run by using puppet apply --noop (to check for compilation errors 6 | # and view a log of events) or by fully applying the test in a virtual environment 7 | # (to compare the resulting system state to the desired state). 8 | # 9 | # Learn more about module testing here: http://docs.puppetlabs.com/guides/tests_smoke.html 10 | # 11 | class{ 'tsm': 12 | service_manage => true, 13 | config_replace => true, 14 | } 15 | --------------------------------------------------------------------------------