This repository has been archived by the owner on Jun 7, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 92
added postgres support #32
Closed
Closed
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4f3e316
Ensure Sonar is running by waiting for Process[web] is up in the log …
1239d9f
Improvement: Add install_method - move, copy, symlink.
653853b
Add plugins installation - basics.
e2a75cb
Remove lower of sonar_install_method
1624c62
Add clean workspace.
7397329
Add task Verify Sonar installation.
0aaf055
added postgres support
ricardozanini 7d39733
correcting travisCI tests by adding postgres role as deps
ricardozanini a025bb9
setting mysql vars
ricardozanini 7b358fb
Fixes #7 : Add run as user.
640b3c0
Merge branch 'plugins_installation' into deveryware
33592f8
Merge branch 'install_method' into deveryware
4bb30f2
Merge branch 'wait_for_start' into deveryware
6418490
Merge branch 'fix_Sonar_runs_as_root' into deveryware
dddf136
Merge branch 'deveryware' into postgresql
ricardozanini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
--- | ||
- name: Configure SonarQube JDBC settings for MySQL. | ||
lineinfile: | ||
dest: /usr/local/sonar/conf/sonar.properties | ||
regexp: "{{ item.regexp }}" | ||
line: "{{ item.line }}" | ||
notify: restart sonar | ||
with_items: | ||
- regexp: "^sonar.jdbc.username" | ||
line: "sonar.jdbc.username={{ sonar_mysql_username }}" | ||
- regexp: "^sonar.jdbc.password" | ||
line: "sonar.jdbc.password={{ sonar_mysql_password }}" | ||
- regexp: "^sonar.jdbc.url" | ||
line: "sonar.jdbc.url=jdbc:mysql://{{ sonar_mysql_host }}:{{ sonar_mysql_port }}/{{ sonar_mysql_database }}?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance" | ||
- regexp: "^sonar.web.context" | ||
line: "sonar.web.context={{ sonar_web_context }}" | ||
- include: configure_mysql.yml | ||
when: sonar_database_engine == "mysql" | ||
|
||
- include: configure_postgres.yml | ||
when: sonar_database_engine == "postgres" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
- name: Create a database for Sonar. | ||
mysql_db: | ||
name: "{{ sonar_database_name }}" | ||
state: present | ||
|
||
- name: Create a sonar user. | ||
mysql_user: | ||
name: "{{ sonar_database_username }}" | ||
host: "{{ item }}" | ||
priv: "{{ sonar_database_name }}.*:ALL" | ||
password: "{{ sonar_database_password }}" | ||
with_items: "{{ sonar_mysql_allowed_hosts }}" | ||
|
||
- name: Configure SonarQube JDBC settings for MySQL. | ||
lineinfile: | ||
dest: /usr/local/sonar/conf/sonar.properties | ||
regexp: "{{ item.regexp }}" | ||
line: "{{ item.line }}" | ||
notify: restart sonar | ||
with_items: | ||
- regexp: "^sonar.jdbc.username" | ||
line: "sonar.jdbc.username={{ sonar_database_username }}" | ||
- regexp: "^sonar.jdbc.password" | ||
line: "sonar.jdbc.password={{ sonar_database_password }}" | ||
- regexp: "^sonar.jdbc.url" | ||
line: "sonar.jdbc.url=jdbc:mysql://{{ sonar_database_host }}:{{ sonar_database_port }}/{{ sonar_database_name }}?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance" | ||
- regexp: "^sonar.web.context" | ||
line: "sonar.web.context={{ sonar_web_context }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
- name: Create a database for Sonar. | ||
become: yes | ||
become_user: "{{ postgresql_user }}" | ||
postgresql_db: | ||
name: "{{ sonar_database_name }}" | ||
encoding: UTF-8 | ||
state: present | ||
|
||
- name: Create a sonar user. | ||
become: yes | ||
become_user: "{{ postgresql_user }}" | ||
postgresql_user: | ||
name: "{{ sonar_database_username }}" | ||
password: "{{ sonar_database_password }}" | ||
db: "{{ sonar_database_name }}" | ||
priv: "ALL" | ||
|
||
- name: Configure SonarQube JDBC settings for Postgres. | ||
lineinfile: | ||
dest: /usr/local/sonar/conf/sonar.properties | ||
regexp: "{{ item.regexp }}" | ||
line: "{{ item.line }}" | ||
notify: restart sonar | ||
with_items: | ||
- regexp: "^sonar.jdbc.username" | ||
line: "sonar.jdbc.username={{ sonar_database_username }}" | ||
- regexp: "^sonar.jdbc.password" | ||
line: "sonar.jdbc.password={{ sonar_database_password }}" | ||
- regexp: "^sonar.jdbc.url" | ||
line: "sonar.jdbc.url=jdbc:postgresql://{{ sonar_database_host }}:{{ sonar_database_port }}/{{ sonar_database_name }}" | ||
- regexp: "^sonar.web.context" | ||
line: "sonar.web.context={{ sonar_web_context }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
- src: geerlingguy.repo-remi | ||
- src: geerlingguy.java | ||
- src: geerlingguy.mysql | ||
- src: geerlingguy.postgresql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the default database engine should be mysql to avoid regression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your recommendation. mysql wasn't working that's why I've changed the default to postgres.