Skip to content

Commit

Permalink
Add log level (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvzkupu authored Feb 6, 2024
1 parent 51ed16e commit 149f22e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ gitlab_runner_restart_state: restarted
# default value for log_format
# gitlab_runner_log_format: runner

# defines value for log_level
# Defines the log level. Options are debug, info, warn, error, fatal, and panic.
# This setting has lower priority than the level set by the command-line arguments --debug, -l, or --log-level.
# gitlab_runner_log_level: "warning"

# default value for force accept self signed certificates
force_accept_gitlab_server_self_signed: false

Expand Down
20 changes: 17 additions & 3 deletions tasks/global-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
insertafter: \s*concurrent.*
state: present
no_log: "{{ gitlab_runner_no_log_secrets | default(omit) }}"
when: gitlab_runner_listen_address | length > 0 # Ensure value is set
when: gitlab_runner_listen_address | length > 0
become: "{{ gitlab_runner_system_mode }}"
notify:
- restart_gitlab_runner
Expand All @@ -49,7 +49,21 @@
insertbefore: BOF
state: present
no_log: "{{ gitlab_runner_no_log_secrets | default(omit) }}"
when: gitlab_runner_log_format is defined # Ensure value is set
when: gitlab_runner_log_format is defined
become: "{{ gitlab_runner_system_mode }}"
notify:
- restart_gitlab_runner
- restart_gitlab_runner_macos

- name: Add log_level to config
lineinfile:
dest: "{{ gitlab_runner_config_file }}"
regexp: ^log_level =
line: log_level = "{{ gitlab_runner_log_level }}"
insertbefore: BOF
state: present
no_log: "{{ gitlab_runner_no_log_secrets | default(omit) }}"
when: gitlab_runner_log_level is defined
become: "{{ gitlab_runner_system_mode }}"
notify:
- restart_gitlab_runner
Expand All @@ -63,7 +77,7 @@
insertafter: \s*concurrent.*
state: present
no_log: "{{ gitlab_runner_no_log_secrets | default(omit) }}"
when: gitlab_runner_sentry_dsn | length > 0 # Ensure value is set
when: gitlab_runner_sentry_dsn | length > 0
become: "{{ gitlab_runner_system_mode }}"
notify:
- restart_gitlab_runner
Expand Down

0 comments on commit 149f22e

Please sign in to comment.