Advertisement
keith_shannon

install.pp

May 18th, 2015
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.58 KB | None | 0 0
  1. class jira::install {
  2.  
  3.   require jira
  4.   require deploy
  5.  
  6.   user { $jira::user:
  7.     comment          => 'Jira daemon account',
  8.     shell            => '/bin/true',
  9.     home             => $jira::homedir,
  10.     password         => '*',
  11.     password_min_age => '0',
  12.     password_max_age => '99999',
  13.     managehome       => true,
  14.   } ->
  15.  
  16.   file { $jira::installdir:
  17.     ensure  => 'directory',
  18.     owner   => $jira::user,
  19.     group   => $jira::group,
  20.   }
  21.  
  22.   file { "/etc/cron.d/jira_mail_perms":
  23.     mode    => 644,
  24.     owner   => root,
  25.     group   => root,
  26.     source  => "puppet:///modules/jira/jira_mail_perms"
  27.   }
  28.  
  29.   deploy::file { "atlassian-${jira::product}-${jira::version}.${jira::format}":
  30.     target          => "${jira::installdir}/atlassian-${jira::product}-${jira::version}-standalone",
  31.     url             => $jira::downloadURL,
  32.     strip           => true,
  33.     download_timout => 1800,
  34.     owner           => $jira::user,
  35.     group           => $jira::group,
  36.     notify          => Exec["chown_${jira::webappdir}"],
  37.   } ->
  38.  
  39.   file { $jira::homedir:
  40.     ensure  => 'directory',
  41.     owner   => $jira::user,
  42.     group   => $jira::group,
  43.   } ->
  44.  
  45.   file { "${jira::homedir}/import":
  46.     ensure  => 'directory',
  47.     mode    => 777
  48.   } ->
  49.  
  50.   file { "${jira::homedir}/import/mail":
  51.     ensure  => 'directory',
  52.     mode    => 777
  53.   } ->
  54.  
  55.   exec { "chown_${jira::webappdir}":
  56.     command     => "/bin/chown -R ${jira::user}:${jira::group} ${jira::webappdir}",
  57.     refreshonly => true,
  58.     subscribe   => User[$jira::user]
  59.   } ->
  60.  
  61.   file { "${jira::installdir}/atlassian-${jira::product}-${jira::version}-standalone/lib/mysql-connector-java-5.1.31-bin.jar":
  62.     mode    => 644,
  63.     owner   => root,
  64.     group   => root,
  65.     source  => "puppet:///modules/jira/mysql-connector-java-5.1.31-bin.jar"
  66.   } ->
  67.  
  68.   file { "${jira::webappdir}/logs/old":
  69.     ensure  => 'directory',
  70.     owner   => $jira::user,
  71.     group   => $jira::group,
  72.   }
  73.  
  74.   file { '/etc/init.d/jira':
  75.     content => template('jira/etc/rc.d/init.d/jira.erb'),
  76.     mode    => '0755',
  77.   }
  78.  
  79.   file { '/etc/aliases':
  80.     mode   => 644,
  81.     owner  => root,
  82.     group  => root,
  83.     source => "puppet:///modules/jira/aliases"
  84.   }
  85.  
  86.   logrotate::rule { 'jira_catalina':
  87.     ensure         => 'present',
  88.     path           => "${jira::webappdir}/logs/catalina.*",
  89.     olddir         => "${jira::webappdir}/logs/old",
  90.     rotate         => 30,
  91.     rotate_every   => 'day',
  92.     size           => '500M',
  93.     compress       => true,
  94.     copytruncate   => true,
  95.     missingok      => true,
  96.   }
  97.  
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement