geerlingguy.sonar
Ansible Role: SonarQube
DEPRECATED: This role is no longer being actively maintained. It may still work, but it's marked as 'deprecated' on Ansible Galaxy. It's recommended to find a new role to use instead, or fork this one for your own use.
This Ansible Role installs SonarQube on RedHat/CentOS and Debian/Ubuntu Linux servers.
Requirements
You need to have the unzip
tool installed on the server. Different SonarQube versions need different minimum Java versions:
- SonarQube 5.0-5.5 needs Java 1.7 or higher
- SonarQube 5.6 and above needs Java 1.8 or higher
Additionally, recent versions of SonarQube require MySQL version 5.6 or later.
Role Variables
Here are the available variables with their default values:
workspace: /root
This is the directory where downloaded files will be temporarily stored.
sonar_download_validate_certs: true
This controls whether to check certificates when downloading SonarQube.
sonar_download_url: http://dist.sonar.codehaus.org/sonarqube-4.5.4.zip
sonar_version_directory: sonarqube-4.5.4
This is the URL from where SonarQube will be downloaded and the name of the resulting directory (it should match the downloaded archive name without the file extension).
sonar_web_context: ''
This sets the value of sonar.web.context
. If you set it to something like /sonar
, you can access SonarQube at hostname/sonar
instead of just hostname
.
sonar_mysql_username: sonar
sonar_mysql_password: sonar
sonar_mysql_host: localhost
sonar_mysql_port: "3306"
sonar_mysql_database: sonar
sonar_mysql_allowed_hosts:
- 127.0.0.1
- ::1
- localhost
These are the settings for connecting to a MySQL database. By default, it assumes the database is on the localhost and can only be accessed from the SonarQube server.
Dependencies
- geerlingguy.java
- geerlingguy.mysql
Example Playbook
Here is an example of how to use this role:
- hosts: all
roles:
- geerlingguy.sonar
With the default settings, you can access the SonarQube home page at http://localhost:9000/
(the default admin login is admin
/admin
).
License
MIT / BSD
Author Information
This role was created in 2014 by Jeff Geerling, author of Ansible for DevOps.
SonarQube for Linux
ansible-galaxy install geerlingguy.sonar