ansible-role-sonarqube/tasks/config.yml

53 lines
1.5 KiB
YAML
Raw Normal View History

2023-04-28 00:32:36 +02:00
---
- name: "SONARQUBE | Set up directories"
ansible.builtin.file:
state: directory
path: "{{ item }}"
owner: "{{ ansible_effective_user_id }}"
group: "{{ ansible_effective_group_id }}"
mode: "0750"
with_items:
- "{{ sonarqube_skeleton_paths }}"
tags:
- sonarqube_configure
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:
- sonarqube_configure
- name: "SONARQUBE | Set up nofiles and nproc for ansible user"
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-28 18:14:53 +02:00
become: true
- name: "SONARQUBE | Set up the max files"
sysctl:
name: fs.file-max
value: "{{ sonarqube_fs_file_max }}"
state: present
2023-04-29 16:18:30 +02:00
reload: true
2023-04-28 18:14:53 +02:00
become: true
- name: "SONARQUBE | Set up the VM max_map_count"
sysctl:
name: vm.max_map_count
value: "{{ sonarqube_vm_max_map_count }}"
state: present
2023-04-29 16:18:30 +02:00
reload: true
become: true