Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been working on learning puppet and using it to set up a jenkins box. I'm wiring jenkins through tomcat, since I may also end up running other webapps on there.

EDIT: I've installed (via puppet module install puppetlabs-stdlib) the stdlib provided by puppetlabs to use the file_line type.

This is puppet module manifest for setting up jenkins and tomcat and wiring the two together.

class tomcat_jenkins {
  package{'java-1.7':
    ensure => installed,
    name   => 'java-1.7.0-openjdk',
  }

  package{'tomcat6':
    ensure  => installed,
    require => Package['java-1.7'],
  }

  package{'jenkins':
    ensure  => installed,
    require => Yumrepo['jenkins'],
  }

  file{'jenkins-symlink':
    name    => '/usr/share/tomcat6/webapps/jenkins.war',
    require => [Package['tomcat6'], Package['jenkins']],
    ensure  => link,
    target  => '/usr/lib/jenkins/jenkins.war',
  }

  file{ '/srv':
    ensure => directory,
    owner  => 'root',
    group  => 'root',
  }

  file{ '/srv/jenkins':
    ensure  => directory,
    owner   => 'tomcat',
    group   => 'tomcat',
    require => Package['tomcat6'],
  }

  file_line{'jenkins_home':
    ensure  => present,
    path    => '/etc/tomcat6/tomcat6.conf',
    line    => 'JENKINS_HOME=/srv/jenkins',
    require => [Package['tomcat6'], File['/srv/jenkins']],
  }

  service{'tomcat6':
    ensure    => running,
    enable    => true,
    require   => [Package['tomcat6'], Package['jenkins'], File_line['jenkins_home']],
    subscribe => [Package['jenkins'], File['jenkins-symlink']],
  }

}

I see the output from the puppet agent that it is properly applying the catalog, and it pretends like it went ahead and applied the changes, but there's no /jenkins/ in my /etc/tomcat6/tomcat6.conf file. I don't have anything else managing that file.

puppet agent -t -d output:

info: Applying configuration version '1343250206'
debug: /Stage[main]/Tomcat_jenkins/File_line[jenkins_home]/require: requires Package[tomcat6]
debug: /Stage[main]/Tomcat_jenkins/File_line[jenkins_home]/require: requires File[/srv/jenkins]
debug: /Stage[main]/Epel_repo/Yumrepo[epel]/require: requires File[/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6]
debug: /Stage[main]/Tomcat_jenkins/Package[jenkins]/require: requires Yumrepo[jenkins]
debug: /Stage[main]/Tomcat_jenkins/Service[tomcat6]/require: requires Package[tomcat6]
debug: /Stage[main]/Tomcat_jenkins/Service[tomcat6]/require: requires Package[jenkins]
debug: /Stage[main]/Tomcat_jenkins/Service[tomcat6]/require: requires File_line[jenkins_home]
debug: /Stage[main]/Tomcat_jenkins/Service[tomcat6]/subscribe: subscribes to Package[jenkins]
debug: /Stage[main]/Tomcat_jenkins/Service[tomcat6]/subscribe: subscribes to File[jenkins-symlink]
share|improve this question
    
Where are you finding that file_line is a valid resource? It doesn't appear as a standard resource type on the official documentation. docs.puppetlabs.com/references/latest/type.html –  Zoredache Jul 25 '12 at 21:21
    
Sorry, it comes from the puppetlabs/stdlib module: github.com/puppetlabs/puppetlabs-stdlib Which I have puppet module installed –  BeepDog Jul 25 '12 at 21:26

1 Answer 1

up vote 8 down vote accepted

Asking around on #puppet on irc.freenode.net, I found out that I was missing a configuration parameter on the puppet agent. I needed:

pluginsync=true

in the [main] section. After adding that line, it happily downloaded the plugins, and set up my stuff. Win.

share|improve this answer
    
You can also use --pluginsync if you're messing on the command line. –  Gerald Kaszuba Dec 22 '12 at 8:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.