0

I am trying to install Java or ActiveMQ manually into my agent server from master, Installation is working fine for me, but the issues which I am facing is whenever I run puppet agent -t in my agent ActiveMQ installing again and again,basically ActiveMQ installation is not checking in my manifests.

1.) How we can check custom service running using manifest? 2) How we can achieve this with conditional(if,else...) statement?

Please find my code below..

class activemq { include wget::gxactivemq

  exec { 'ActiveMQExe':
  command => "/bin/tar xzf /gx/mnt/software/ESB/apache-activemq-5.5.1-bin.tar.gz",
  cwd => "/gx/mnt/software/ESB/",
  require => [wget::fetch["activemqDownload"]],

  logoutput => true,
       }
            file { '/gx/logical/ESB/':
            ensure => link,
            owner  => "ubuntu",
            group  => "ubuntu",
            target => '/gx/mnt/software/ESB/',
            require => [Exec["ActiveMQExe"]],
            }
            file { '/gx/logical/ESB/apache-activemq-5.5.1':
            ensure => "directory",
            owner  => "ubuntu",
            group  => "ubuntu",
            recurse => true,
            require => [Exec["ActiveMQExe"],File["/gx/logical/ESB/"]],
                 }
            file { '/gx/logical/ESB/apache-activemq-5.5.1/conf':
            ensure => "directory",
            owner  => "ubuntu",
            group  => "ubuntu",
            mode => 777,
            recurse => true,
            require => [Exec["ActiveMQExe"],File["/gx/logical/ESB/"]],

} }

Thanks, Jithin

Jithin
  • 1

1 Answers1

0

One possibility might be to use Exec's 'unless', 'creates' or 'onlyif' clause: in other words invoke the "tar" command only if one of the files (or directories) created by the tar command doesn't already exist.

Similarly, regarding the service, you might want to look at the documentation for the service resource.

рüффп
  • 620
  • 1
  • 11
  • 25
Albert Turri
  • 101
  • 1