puppet配備jdk
5173 ワード
[root@pps modules]# tree jdk/jdk/|-- files |-- manifests | `-- init.pp `-- templates `-- profile.erb 3 directories, 2 files
本文は“風光悪党”のブログから出て、転載して作者と連絡してください!
- class jdk{
- # jdk
- file {"/tmp/jdk-6u33-linux-x64-rpm.bin":
- owner=> root,
- group=>root,
- mode=>755,
- source=>"puppet://pps.zhaizu.com/files/jdk-6u33-linux-x64-rpm.bin",
- recurse=>true,
- }
-
- # file /etc/profile
- file {
- "profile":
- owner => root,
- group => root,
- mode => 755,
- ensure => present,
- name => "/tmp/profile",
- content => template("jdk/profile.erb"),
- require =>File["/tmp/jdk-6u33-linux-x64-rpm.bin"],
- before =>Exec["build-jdk"],
- }
-
-
- # jdk
- exec {"build-jdk":
- cwd =>"/tmp",
- command => "/bin/sh jdk-6u33-linux-x64-rpm.bin ",
- require => File["/tmp/jdk-6u33-linux-x64-rpm.bin"],
- # before => File["cat-profile"],
- notify => Exec['cat-profile'],
- }
-
- # /etc/profile, refreshonly
- exec {"cat-profile":
- cwd =>"/tmp",
- command => "/bin/cat /tmp/profile >> /etc/profile",
- require =>File["profile"],
-
- refreshonly => true, #
- }
- }
本文は“風光悪党”のブログから出て、転載して作者と連絡してください!