Giter VIP home page Giter VIP logo

puppet-sonarqube's Introduction

Puppet-SonarQube

Build Status Puppet Forge Puppet Forge Quality Gate

A puppet recipe to install SonarQube (former Sonar)

Usage

class { 'java': }
class { 'sonarqube':
  version => '5.1',
}

or

$jdbc = {
  url      => 'jdbc:h2:tcp://localhost:9092/sonar',
  username => 'sonar',
  password => 'sonar',
}

class { 'sonarqube':
  arch          => 'linux-x86-64',
  version       => '5.1,
  user          => 'sonar',
  group         => 'sonar',
  service       => 'sonar',
  installroot   => '/usr/local',
  home          => '/var/local/sonar',
  download_url  => 'https://sonarsource.bintray.com/Distribution/sonarqube'
  jdbc          => $jdbc,
  web_java_opts => '-Xmx1024m',
  log_folder    => '/var/local/sonar/logs',
  updatecenter  => 'true',
  http_proxy    => {
  	host        => 'proxy.example.com',
  	port        => '8080',
  	ntlm_domain => '',
  	user        => '',
  	password    => '',
  }
}

SonarQube Plugins

The sonarqube::plugin defined type can be used to install SonarQube plugins. Note that Maven is required to download the plugins then.

class { 'java': }
class { 'maven::maven': }
->
class { 'sonarqube': }

sonarqube::plugin { 'sonar-javascript-plugin':
  groupid    => 'org.sonarsource.javascript',
  artifactid => 'sonar-javascript-plugin',
  version    => '2.10',
  notify     => Service['sonar'],
}

Security Configuration

The sonarqube class provides an easy way to configure security with LDAP, Crowd or PAM. Here's an example with LDAP:

$ldap = {
  url          => 'ldap://myserver.mycompany.com',
  user_base_dn => 'ou=Users,dc=mycompany,dc=com',
  local_users  => ['foo', 'bar'],
}

class { 'java': }
class { 'maven::maven': }
->
class { 'sonarqube':
  ldap => $ldap,
}

# Do not forget to add the SonarQube LDAP plugin that is not provided out of the box.
# Same thing with Crowd or PAM.
sonarqube::plugin { 'sonar-ldap-plugin':
  groupid    => 'org.sonarsource.ldap',
  artifactid => 'sonar-ldap-plugin',
  version    => '1.5.1',
  notify     => Service['sonar'],
}

Module Requirements

  • maestrodev/wget
  • maestrodev/maven (only if additional SonarQube plugins are needed to be installed)
  • puppetlabs/stdlib

License

Copyright 2011-2013 MaestroDev, Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

puppet-sonarqube's People

Contributors

arioch avatar bramwelt avatar brettporter avatar carlossg avatar conor0callaghan avatar dcrissman avatar drt24 avatar f0 avatar faxm0dem avatar karlmdavis avatar kitplummer avatar lclair avatar nwheeler avatar pierrer avatar pulquero avatar racodond avatar rauchrob avatar rickard-von-essen avatar sjeandeaux avatar thijsdezoete avatar velocity303 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-sonarqube's Issues

`log_folder` parameter doesn't seem to work

When I specify log_folder parameter to be /var/log/sonar, it doesn't seem to be reflecting at all. I inspected logback.xml and it's always resolving to ${SONAR_HOME}/logs regardless of what I set using log_folder parameter.

Forge module still on 2.6.7

Hi there,

It looks like the version bump to 2.6.8 didn't happen to the forge module. Could the bump be applied to the forge module so 2.6.8 is available there ? (latest is currently 2.6.7)

Thanks,

Add support for SonarQube properties (create, update, delete)

Add support for SonarQube properties by adding custom puppet type and provider: properties.

Type description

This type should manage properties (create, update, delete).

sonarqube::properties { 'sonar.java.coveragePlugin':
  ensure => 'jacoco', # undef
}
sonarqube::properties { 'sonar.core.treemap.sizemetric':
  ensure => 'ncloc', # undef
}

Provider description

There should be a default provider that will use SonarQube API http://docs.sonarqube.org/pages/viewpage.action?pageId=2392170#WebService/api/properties-GetaListofProperties

  • GET /api/properties --> GET http://nemo.sonarqube.org/api/properties/?format=json
  • POST /api/properties -->
    curl -u admin:admin -X POST http://localhost:9000/api/properties?id=myProperty&value=myValue
  • DELETE /api/properties --> curl -u admin:admin -X DELETE http://localhost:9000/api/properties/myProperty

Scripts deployed in /tmp can't be executed if /tmp is mounted as 'nosuid'

This seems to be a common default in modern distributions, which makes this module fail.

Since making /tmp noexec makes sense from the security point of view, I think we should deploy those files somewhere else.

I would send a PR with the change, but I would like to know if there is any preference regarding where to deploy them. Since they're now in /tmp, my first idea would be to locate them in ${installroot}/${package_name}-${version}/temp.

WDYT?

Template typo?

We're not doing anything interesting here, I just went to stand up a vanilla node and it complains about the template.

# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, Failed to parse template sonarqube/sonar.properties.erb:
  Filepath: org/jruby/RubyArray.java
  Line: 1343
  Detail: can't convert String into Integer
 at /etc/puppetlabs/code/environments/production/modules/sonarqube/manifests/init.pp:164:18 on node health-market-science-prod-sonarqube-001.novalocal
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

EDIT: I am apparently an idiot and had fatfingered my hiera. This is not an issue.

Plugin installation doesn't work in sonar 5.6.6 (latest LTS)

It looks like the plugin system changed in recent Sonarqube versions, and hence, this puppet module doesn't work anymore.

If I use the puppet module to install the ldap plugin, it creates the file:
/var/local/sonar/extensions/plugins/sonar-ldap-plugin-2.1.0.507.jar
The plugin is not recognized as installed.

When I install the ldap plugin from the web UI, the following files are created:

/var/local/sonar/data/web/deploy/plugins/ldap
/var/local/sonar/data/web/deploy/plugins/ldap/META-INF
/var/local/sonar/data/web/deploy/plugins/ldap/META-INF/lib
/var/local/sonar/data/web/deploy/plugins/ldap/META-INF/lib/commons-lang-2.6.jar
/var/local/sonar/data/web/deploy/plugins/ldap/sonar-ldap-plugin-2.1.0.507.jar

And in sonar the plugin is recognized as installed.

After changing SonarQube version service sonar don't restart

After changing SonarQube ver.5.2 to ver.5.4 all processes e.g.. Java still working for old version.
Directory for old ver. is removed but process is still working.

  • After changing SonarQube ver. all processes should be shout down.
  • Sonar service should restart.

Puppet tries to download the SonarQube plugins with Maven before having installed Maven

Hi,

The following piece of code works to install SonarQube. Maven is not required unlike what it is stated in the README file.

class { 'java': }
class { 'sonarqube' :
  version => '3.7.4',
}

Maven is only necessary when some SonarQube plugins need to be downloaded and installed. But in this case, you cannot add class { 'maven::maven' : } -> because it is duplicated by https://github.com/maestrodev/puppet-sonarqube/blob/master/manifests/plugin.pp#L32 and thus an error is thrown.

To install a plugin, the following piece of code does not work as well:

class { 'java': }
class { 'sonarqube' :
  version => '3.7.4',
}
sonarqube::plugin { 'sonar-build-breaker-plugin' :
  version => '1.1',
  notify  => Service['sonar'],
}

I am not an expert in Puppet dependencies, but https://github.com/maestrodev/puppet-sonarqube/blob/master/manifests/plugin.pp#L32 does not seem to guarantee that Maven is installed prior to downloading the plugins with Maven. During my tests, Puppet always tries to download the plugins before having installed Maven. Thus I need to run vagrant up + vagrant provision to get something up and running.

What is working for me is:

  1. Remove https://github.com/maestrodev/puppet-sonarqube/blob/master/manifests/plugin.pp#L32
  2. Execute the following piece of code (with class { 'maven::maven': } ->):
class { 'java': }
class { 'maven::maven': }
->
class { 'sonarqube' :
  version => '3.7.4',
}
sonarqube::plugin { 'sonar-build-breaker-plugin' :
  version => '1.1',
  notify  => Service['sonar'],
}

Should I submit a PR removing https://github.com/maestrodev/puppet-sonarqube/blob/master/manifests/plugin.pp#L32 and updating the README file?

Thank you

Regards,

David RACODON

sonar will not start: Missing property sonar.embeddedDatabase.port

I tried to install sonarqube through yaml with

sonarqube::version: '5.6'

sonar will not start and gives the following error:

2016.07.01 10:32:55 INFO  web[o.s.p.ProcessEntryPoint] Starting web
2016.07.01 10:32:56 INFO  web[o.s.s.a.TomcatContexts] Webapp directory: /usr/local/sonarqube-5.6/web
2016.07.01 10:32:56 INFO  web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.07.01 10:32:56 INFO  web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2016.07.01 10:32:58 INFO  web[o.s.s.p.ServerImpl] SonarQube Server / 5.6 / 074f3d1169f9688d15af4aff67e7e672cbeed782
2016.07.01 10:32:58 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lang.IllegalArgumentException: Missing property sonar.embeddedDatabase.port
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:148) ~[guava-17.0.jar:na]
    at org.sonar.server.db.EmbeddedDatabase.getRequiredSetting(EmbeddedDatabase.java:97) ~[sonar-server-5.6.jar:na]
    at org.sonar.server.db.EmbeddedDatabase.startServer(EmbeddedDatabase.java:66) ~[sonar-server-5.6.jar:na]
    at org.sonar.server.db.EmbeddedDatabase.start(EmbeddedDatabase.java:61) ~[sonar-server-5.6.jar:na]
    at org.sonar.server.db.EmbeddedDatabaseFactory.start(EmbeddedDatabaseFactory.java:44) ~[sonar-server-5.6.jar:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_74]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_74]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_74]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_74]
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) ~[picocontainer-2.15.jar:na]
    at org.sonar.core.platform.ComponentContainer$1.start(ComponentContainer.java:320) ~[sonar-core-5.6.jar:na]
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.Stored.start(Stored.java:110) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767) ~[picocontainer-2.15.jar:na]
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141) ~[sonar-core-5.6.jar:na]
    at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:84) ~[sonar-server-5.6.jar:na]
    at org.sonar.server.platform.Platform.start(Platform.java:216) ~[sonar-server-5.6.jar:na]
    at org.sonar.server.platform.Platform.startLevel1Container(Platform.java:175) ~[sonar-server-5.6.jar:na]
    at org.sonar.server.platform.Platform.init(Platform.java:90) ~[sonar-server-5.6.jar:na]
    at org.sonar.server.platform.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:43) ~[sonar-server-5.6.jar:na]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812) [tomcat-embed-core-8.0.30.jar:8.0.30]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255) [tomcat-embed-core-8.0.30.jar:8.0.30]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.0.30.jar:8.0.30]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [tomcat-embed-core-8.0.30.jar:8.0.30]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [tomcat-embed-core-8.0.30.jar:8.0.30]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_74]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_74]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_74]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_74]
2016.07.01 10:32:58 ERROR web[o.a.c.c.StandardContext] One or more listeners failed to start. Full details will be found in the appropriate container log file
2016.07.01 10:32:58 ERROR web[o.a.c.c.StandardContext] Context [] startup failed due to previous errors
2016.07.01 10:32:59 INFO  web[o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.07.01 10:32:59 INFO  web[o.s.s.a.TomcatAccessLog] Web server is started
2016.07.01 10:32:59 INFO  web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2016.07.01 10:32:59 WARN  web[o.s.p.ProcessEntryPoint] Fail to start web
java.lang.IllegalStateException: Webapp did not start
    at org.sonar.server.app.EmbeddedTomcat.isUp(EmbeddedTomcat.java:84) ~[sonar-server-5.6.jar:na]
    at org.sonar.server.app.WebServer.isUp(WebServer.java:47) [sonar-server-5.6.jar:na]
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:105) ~[sonar-process-5.6.jar:na]
    at org.sonar.server.app.WebServer.main(WebServer.java:68) [sonar-server-5.6.jar:na]
2016.07.01 10:32:59 INFO  web[o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.07.01 10:33:00 INFO  web[o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.07.01 10:33:00 INFO  web[o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.07.01 10:33:00 INFO  web[o.s.s.a.TomcatAccessLog] Web server is stopped
2016.07.01 10:33:00 INFO  app[o.s.p.m.Monitor] Process[es] is stopping
2016.07.01 10:33:01 INFO   es[o.s.p.StopWatcher]  Stopping process
2016.07.01 10:33:01 INFO   es[o.elasticsearch.node]  [sonar-1467361959545] stopping ...
2016.07.01 10:33:01 INFO   es[o.elasticsearch.node]  [sonar-1467361959545] stopped
2016.07.01 10:33:01 INFO   es[o.elasticsearch.node]  [sonar-1467361959545] closing ...
2016.07.01 10:33:01 INFO   es[o.elasticsearch.node]  [sonar-1467361959545] closed
2016.07.01 10:33:01 INFO  app[o.s.p.m.Monitor] Process[es] is stopped
<-- Wrapper Stopped

Add newbies procedure for installing it !

Hi,

I'm a novice on SysAdmin stuff, but I need to create a vm that runs SonarQube. I first start using a Vagrant file that install Ubuntu and then call a Puppet script that installs SonarQube, but this is pretty old (Sonar 3.7.x). https://github.com/bastien03/sonarqube

Then I found your repo, but have not an idea how to run this ! nether how to merge both projects in order to add Vagrant on top of your project !

Of if this makes no sense for you, maybe you may add a short straightforward procedure to run the project on a Linux Instance.

Unable to start sonar service

Hi,

I was getting the following issue with the sonar service after installation:

$ sudo systemctl status sonar
sonar.service - LSB: Sonar
   Loaded: loaded (/etc/rc.d/init.d/sonar)
   Active: failed (Result: exit-code) since Fri 2015-08-21 16:22:04 UTC; 3min 5s ago
  Process: 554 ExecStart=/etc/rc.d/init.d/sonar start (code=exited, status=203/EXEC)

Aug 21 16:22:04 sonarqube systemd[1]: sonar.service: control process exited, code=exited status=203
Aug 21 16:22:04 sonarqube systemd[1]: Failed to start LSB: Sonar.
Aug 21 16:22:04 sonarqube systemd[1]: Unit sonar.service entered failed state.

My set-up:
Windows 7 host, running puppetlabs/centos-7.0-64-puppet box on Vagrant, using Puppet-SonarQube 2.6.2

I eventually figured out that the problem is that the installed sonar.sh file has carriage return characters (DOS line endings) and so cannot be executed. I have resolved manually with the following:
$ cd /usr/local/sonarqube-5.1.2/bin/linux-x86-64
$ sudo cp sonar.sh sonar.sh.original
$ sudo sh -c "tr -d '\r' < sonar.sh.original > sonar.sh"
$ sudo systemctl daemon-reload
$ sudo systemctl start sonar.service

But there should be some way to include this in the untar step or add a subsequent step, but I am new to Puppet so not quite sure how to do that at the moment.

Funny, I didn't have this issue when I did the same set-up from my Mac at home.

Thanks for looking into this. Cheers

Double ldap entry in sonar.properties template breaks ldap configuration

In sonar.properties.erb there are duplicate entries that breaks the ldap config.

You can find these on line 159 and line 173 there is duplicated ldap.url entry. The first entry gets filled but the second stays empty. as soon you start sonar it tries to connect to localhost because of the second entry.

Need Puppet module for sonar qube installation

HI ,

i am beginner for sonar and puppet , can some one help me to write puppet module for sonar qube ?

Please provide me any link or gudie what needs to be include in module.
Below are few deatils of infrastruture.
OS- Redhat 7.2
DB- Mysql db

Add support for quality gates by adding custom type (create, remove)

Add support for quality gates by adding custom puppet type and provider: qualitygates.

Type description

This type should manage quality gates (create, remove).

sonarqube::qualitygates { 'COI way':
  ensure     => 'present',
  default    => true,
  conditions => {
    'blocker_violations'  = {'error' => 10, 'warning' => 5, 'op' => 'GT'},
    'critical_violations' = {'error' => 5, 'warning' => 0, 'op' => 'GT'},
# [...]
  }
}

Provider description

There should be a default provider that will use SonarQube API https://nemo.sonarqube.org/api_documentation/api/qualitygates

Below are listed required API functions that should fulfil type contract:

  • POST api/qualitygates/create - Since 4.3
  • POST api/qualitygates/create_condition
  • POST api/qualitygates/delete_condition
  • POST api/qualitygates/destroy
  • GET api/qualitygates/search
  • GET api/qualitygates/list
  • POST api/qualitygates/select
  • POST api/qualitygates/set_as_default
  • POST api/qualitygates/unset_default
  • POST api/qualitygates/update_condition

This provider will support SonarQube ver. >= 5.2

Documentation : sonarqube versions compatibility

Hello,

Documentation does not refer any matrix compatibility with sonarqube versions.
Most of the tests seem to have been done with Sonar 5.x.

Actually there are several new sonar LTS versions (5.6, 6.7, 7.9.1 ..)

Could you please update documentation with last sonarqube LTS compatible with this module ?
Thanks

Add support for quality profiles (add, remove, set inheritance and activate rules)

Add support for quality profiles by adding custom puppet type and provider: qualityprofile.

Type description

This type should manage quality profiles (add, remove, set inheritance and activate rules).

sonarqube::qualityprofile { 'Nearly all SonarQube rules':
  ensure   => 'present',
  default  => true,
  language => 'java',
  inherits => 'Sonar way',
  rules    => {
    'squid:CallToFileDeleteOnExitMethod' => 'default', # use default severity from SonarQube
    'squid:S2096' => 'major', # sets Major severity
    # [...]
  },
}

Provider description

There should be a default provider that will use SonarQube API https://nemo.sonarqube.org/api_documentation/api/qualityprofiles

Below are listed required API functions that should fulfil type contract:

  • POST api/qualityprofiles/activate_rule or POST api/qualityprofiles/activate_rules - Since 4.4
  • POST api/qualityprofiles/add_project - Since 5.2
  • POST api/qualityprofiles/change_parent
  • POST api/qualityprofiles/create - Since 5.2
  • POST api/qualityprofiles/deactivate_rule - Since 4.4 or POST api/qualityprofiles/deactivate_rules
  • POST api/qualityprofiles/delete - Since 5.2
  • GET api/qualityprofiles/inheritance - Since 5.2
  • GET api/qualityprofiles/projects - Since 5.2
  • POST api/qualityprofiles/remove_project - Since 5.2
  • POST api/qualityprofiles/restore_built_in
  • POST api/qualityprofiles/set_default - Since 5.2
  • GET api/qualityprofiles/search - Since 5.2

This provider will support SonarQube ver. >= 5.2

Strange issue with $installroot

Hi guys,

Versions:
puppet server: 3.3
puppet client: 3.4
latest versions of wget and sonarqube modules

I have a strange issue when setting a custom install root via hiera (possibly directly calling the class also). The installroot is never created, resulting in failed dependencies when it attempts to create the sonar-version folder inside the installroot. As a result, I've modified the code to be as follows in the local module which appears to work.

Is this a known issue or something quirky in my puppet installation:

Sonar home

file { $home:
ensure => directory,
mode => '0700',
} ->
file { "${installroot}":
ensure => directory,
} ->
file { "${installroot}/sonar-${version}":
ensure => directory,
} ->
file { $installdir:
ensure => link,
target => "${installroot}/sonar-${version}",
} ->

Thanks,

LDAP configuration (and example) is confusing (possibly broken?)

The LDAP example on the main readme shows just setting url and user_base_dn. While url passes through unconditionally to the properties file:

ldap.url=<%= @ldap['url'] %>

it's overridden (again, unconditionally) using the values of hostname and port:

ldap.url: ldap<%= "s" if @ldap['ssl'] %>://<%= @ldap['hostname'] %>:<%= @ldap['port'] %>

So to set the URL of the LDAP server the minimum required is actually url and port.
I'm not sure whether this is a bug in sonar.properties.erb or whether the readme just needs tweaking…

pushd not available to /bin/sh

While running SonarQube with puppet-sonarqube, I hit the following error. I think this is related to dd03c9d , since pushd is a bash builtin and not available to /bin/sh.

==> default: Notice: /Stage[main]/Sonarqube/Service[sonarqube]/ensure: ensure changed 'stopped' to 'running'
==> default: Notice: /Stage[main]/Sonarqube/File[/tmp/cleanup-old-plugin-versions.sh]/ensure: defined content as '{md5}1ef30f89670a3449c01d6f63152fa2e9'
==> default: Notice: /Stage[main]/Sonarqube/File[/tmp/cleanup-old-sonarqube-versions.sh]/ensure: defined content as '{md5}4c2984d86a11984f6d348f2ed7986c1b'
==> default: Error: /tmp/cleanup-old-sonarqube-versions.sh: 3: /tmp/cleanup-old-sonarqube-versions.sh: pushd: not found
==> default: /tmp/cleanup-old-sonarqube-versions.sh: 11: /tmp/cleanup-old-sonarqube-versions.sh: popd: not found
==> default: Error: /Stage[main]/Sonarqube/Exec[remove-old-versions-of-sonarqube]/returns: change from notrun to 0 failed: /tmp/cleanup-old-sonarqube-versions.sh: 3: /tmp/cleanup-old-sonarqube-versions.sh: pushd: not found
==> default: /tmp/cleanup-old-sonarqube-versions.sh: 11: /tmp/cleanup-old-sonarqube-versions.sh: popd: not found
==> default: Notice: Finished catalog run in 133.78 seconds

No such file or directory

I have an error when run puppet agent -t in node.

Could not set 'link' on ensure: No such file or directory @ dir_chdir - /usr/local/sonarqube (file: /etc/puppetlabs/code/environments/production/modules/sonarqube/manifests/move_to_home.pp, line: 9)

Wrapped exception:

No such file or directory @ dir_chdir - /usr/local/sonarqube

Cannot download SonarQube 5.2

Notice: /Stage[main]/Sonarqube/Wget::Fetch[download-sonar]/Exec[wget-download-sonar]/returns: http://downloads.sonarsource.com/sonarqube/sonarqube-5.2.zip:
Notice: /Stage[main]/Sonarqube/Wget::Fetch[download-sonar]/Exec[wget-download-sonar]/returns: 2016-03-02 05:29:59 ERROR 404: Not Found.
Error: wget --no-verbose --output-document="/usr/local/src/sonarqube-5.2.zip" "http://downloads.sonarsource.com/sonarqube/sonarqube-5.2.zip" returned 8 instead of one of [0]
Error: /Stage[main]/Sonarqube/Wget::Fetch[download-sonar]/Exec[wget-download-sonar]/returns: change from notrun to 0 failed: wget --no-verbose --output-document="/usr/local/src/sonarqube-5.2.zip" "http://downloads.sonarsource.com/sonarqube/sonarqube-5.2.zip" returned 8 instead of one of [0]

This is caused by lack of SonarQube 5.2 in their repo. Last version of SonarQube available is: 5.1.

Would be nice to have any info about that. I can submit PR with change in README.md if you do not have time.

KK

Puppet Idempotency issue

Acceptance fails due to this exec:
/Stage[main]/Sonarqube/Sonarqube::Plugin[sonar-ldap-plugin]/Exec[remove-old-versions-of-sonar-ldap-plugin]
Probably, it should not remove all versions if required version is already installed?

NameError: uninitialized constant Syck

bundle exec rake test
rake aborted!
NameError: uninitialized constant Syck
/home/mcvdmvs/puppet-sonarqube/Rakefile:15:in require' /home/mcvdmvs/puppet-sonarqube/Rakefile:15:in <top (required)>'
/home/mcvdmvs/.rbenv/versions/2.2.5/bin/bundle:23:in load' /home/mcvdmvs/.rbenv/versions/2.2.5/bin/bundle:23:in

'
(See full trace by running task with --trace)

It seems that: .rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/puppet-3.8.7/lib/puppet/vendor/safe_yaml/lib/safe_yaml/syck_node_monkeypatch.rb is triggering the fault. After upgrading safe_yaml to version 1.0.4 the error remains.

Add support for multiple LDAP servers

Add support to authenticate against multiple Active Directory servers.
In this way you can create a fail-over support for multiple domains.

Sample configuration:

ldap.servers=server1,server2,server3
sonar.security.localUsers=sonar-admin,sonar-readonly

ldap.server1.url: ldap://myserver1.mycompany.com
ldap.server1.user.baseDn: ou=Users,dc=mycompany,dc=com'
ldap.server1.group.baseDn: ou=Users,dc=mycompany,dc=com'
ldap.server1.bindDn: technical_account
ldap.server1.bindPassword: ********************
ldap.server1.user.request: (&(objectClass=user)(sAMAccountName={login}))
ldap.server1.group.request: (&(objectClass=group)(member={dn}))

ldap.server2.url: ldap://myserver2.mycompany.com
ldap.server2.user.baseDn: ou=Users,dc=mycompany,dc=com'
ldap.server2.group.baseDn: ou=Users,dc=mycompany,dc=com'
ldap.server2.bindDn: technical_account
ldap.server2.bindPassword: ********************
ldap.server2.user.request: (&(objectClass=user)(sAMAccountName={login}))
ldap.server2.group.request: (&(objectClass=group)(member={dn}))

ldap.server3.url: ldap://myserver3.mycompany.com
ldap.server3.user.baseDn: ou=Users,dc=mycompany,dc=com'
ldap.server3.group.baseDn: ou=Users,dc=mycompany,dc=com'
ldap.server3.bindDn: technical_account
ldap.server3.bindPassword: ********************
ldap.server3.user.request: (&(objectClass=user)(sAMAccountName={login}))
ldap.server3.group.request: (&(objectClass=group)(member={dn}))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.