ansible-role-sonarqube/tasks/config.yml

59 lines
1.7 KiB
YAML
Raw Permalink Normal View History

2023-04-28 00:32:36 +02:00
---
- name: "SONARQUBE | Set up directories"
ansible.builtin.file:
2023-04-29 20:48:33 +02:00
state: "directory"
2023-04-28 00:32:36 +02:00
path: "{{ item }}"
owner: "{{ ansible_effective_user_id }}"
group: "{{ ansible_effective_group_id }}"
mode: "0750"
with_items:
- "{{ sonarqube_skeleton_paths }}"
tags:
2023-04-29 20:48:33 +02:00
- "sonarqube_configure"
2023-04-28 00:32:36 +02:00
become: true
- name: "SONARQUBE | Write configuration files"
ansible.builtin.template:
src: "{{ item }}.j2"
2023-04-28 01:12:26 +02:00
dest: "{{ sonarqube_config_path | expanduser | realpath }}/{{ item }}"
2023-04-28 00:32:36 +02:00
mode: '0640'
with_items:
- "{{ sonarqube_configuration_files }}"
tags:
2023-04-29 20:48:33 +02:00
- "sonarqube_configure"
- name: "SONARQUBE | Set up nofiles and nproc for ansible user"
2023-04-29 16:22:31 +02:00
community.general.pam_limits:
domain: "*"
limit_type: "{{ item.limit_type }}"
limit_item: "{{ item.limit_item }}"
value: "{{ item.value }}"
loop:
# Add nofile and nproc, both soft and hard, limit for the user db_user with a comment.
# Type "-" for enforcing both soft and hard resource limits together for more details read `man limits.conf`.
- { limit_type: '-', limit_item: 'nofile', value: "{{ sonarqube_nofile }}" }
- { limit_type: '-', limit_item: 'nproc', value: "{{ sonarqube_nproc }}" }
2023-04-29 20:48:33 +02:00
tags:
- "sonarqube_configure"
2023-04-28 18:14:53 +02:00
become: true
- name: "SONARQUBE | Set up the max files"
2023-04-29 16:22:31 +02:00
ansible.posix.sysctl:
2023-04-29 20:48:33 +02:00
name: "fs.file-max"
value: "{{ sonarqube_fs_file_max }}"
2023-04-29 20:48:33 +02:00
state: "present"
2023-04-29 16:18:30 +02:00
reload: true
2023-04-29 20:48:33 +02:00
tags:
- "sonarqube_configure"
2023-04-28 18:14:53 +02:00
become: true
- name: "SONARQUBE | Set up the VM max_map_count"
2023-04-29 16:22:31 +02:00
ansible.posix.sysctl:
2023-04-29 20:48:33 +02:00
name: "vm.max_map_count"
value: "{{ sonarqube_vm_max_map_count }}"
2023-04-29 20:48:33 +02:00
state: "present"
2023-04-29 16:18:30 +02:00
reload: true
2023-04-29 20:48:33 +02:00
tags:
- "sonarqube_configure"
2023-04-29 16:18:30 +02:00
become: true