Skip to content

Commit

Permalink
Fix some easy linter findings
Browse files Browse the repository at this point in the history
  • Loading branch information
guenhter committed Oct 12, 2023
1 parent 8377c31 commit fe6c594
Show file tree
Hide file tree
Showing 45 changed files with 903 additions and 912 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
---
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale

name: 'Close stale issues and PRs'
on:
name: Close stale issues and PRs
true:
schedule:
- cron: '30 1 * * *'
- cron: 30 1 * * *

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
stale-issue-message: 'Seems this message did not get a lot of love. This does not mean it was not seen but time wise might not have made it to proper attention. This is just the clean up action ;)'
stale-pr-message: 'Although PRs are appreciated, if it sits for too long nothing happens. Can always update and do again :) This is just the automation talking'
stale-issue-message: Seems this message did not get a lot of love. This does not mean it was not seen but time wise might not have made it to proper attention.
This is just the clean up action ;)
stale-pr-message: Although PRs are appreciated, if it sits for too long nothing happens. Can always update and do again :) This is just the automation talking
days-before-issue-stale: 30
days-before-pr-stale: 45
days-before-issue-close: 5
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
- cd ../../
- wsl ansible-playbook test.yml -i inventory --syntax-check
# Running tests
- wsl ansible-playbook test.yml -i inventory --extra-vars 'ansible_user=ansible ansible_password=Ans1ble_User! ansible_connection=winrm ansible_winrm_server_cert_validation=ignore ansible_ssh_port=5986'
- wsl ansible-playbook test.yml -i inventory --extra-vars 'ansible_user=ansible ansible_password=Ans1ble_User! ansible_connection=winrm ansible_winrm_server_cert_validation=ignore
ansible_ssh_port=5986'
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
42 changes: 21 additions & 21 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
# for versions >= 10.x
gitlab_runner_package_name: 'gitlab-runner'
gitlab_runner_package_name: gitlab-runner

gitlab_runner_system_mode: yes
gitlab_runner_system_mode: true

# gitlab_runner_package_version for version pinning on debian/redhat
# The following are for version pinning on MacOSX
Expand All @@ -17,27 +17,27 @@ gitlab_runner_config_file_location: "{{ gitlab_runner_config_file | dirname }}"
gitlab_runner_executable: "{{ gitlab_runner_package_name }}"

# Maximum number of global jobs to run concurrently
gitlab_runner_concurrent: '{{ ansible_processor_vcpus }}'
gitlab_runner_concurrent: "{{ ansible_processor_vcpus }}"

# GitLab coordinator URL
gitlab_runner_coordinator_url: 'https://gitlab.com'
gitlab_runner_coordinator_url: https://gitlab.com
# GitLab registration token
gitlab_runner_registration_token: ''
gitlab_runner_registration_token: ""

gitlab_runner_sentry_dsn: ''
gitlab_runner_sentry_dsn: ""

# GitLab server IP
gitlab_server_ip: ''
gitlab_server_ip: ""

# GitLab TLS CA file
tls_ca_file: ''
tls_ca_file: ""

# Prometheus Metrics & Monitoring
gitlab_runner_listen_address: ''
gitlab_runner_listen_address: ""

# Session server configuration
gitlab_runner_session_server_listen_address: ''
gitlab_runner_session_server_advertise_address: ''
gitlab_runner_session_server_listen_address: ""
gitlab_runner_session_server_advertise_address: ""
gitlab_runner_session_server_session_timeout: 1800

# Skip the APT or YUM repository installation
Expand All @@ -51,8 +51,8 @@ gitlab_unregister_runner_executors_which_are_not_longer_configured: false
# The credentials for the Windows user used to run the gitlab-runner service.
# Those credentials will be passed to `gitlab-runner.exe install`.
# https://docs.gitlab.com/runner/install/windows.html
gitlab_runner_windows_service_user: ''
gitlab_runner_windows_service_password: ''
gitlab_runner_windows_service_user: ""
gitlab_runner_windows_service_password: ""

# Whether to try to start the runner on MacOS.
# If set to `false`, it should be started manually.
Expand All @@ -68,7 +68,7 @@ gitlab_runner_container_install: false
gitlab_runner_container_image: gitlab/gitlab-runner
gitlab_runner_container_tag: latest
gitlab_runner_container_name: gitlab-runner
gitlab_runner_container_mount_path: ''
gitlab_runner_container_mount_path: ""
gitlab_runner_container_restart_policy: unless-stopped
gitlab_runner_container_latest_update: false
# you can define a network which the container connects to
Expand All @@ -85,26 +85,26 @@ gitlab_runner_restart_state: restarted
force_accept_gitlab_server_self_signed: false

# controls diffs for assemble config file
gitlab_runner_show_config_diff: no
gitlab_runner_show_config_diff: false

# controls logs on ansible configuration tasks, uncomment to prevent secret leaks (Unix support only).
# gitlab_runner_no_log_secrets: yes

# A list of runners to register and configure
gitlab_runner_runners:
# The identifier of the runner.
- name: '{{ ansible_hostname }}'
# The identifier of the runner.
- name: "{{ ansible_hostname }}"
# set to 'absent' if you want to delete the runner. Defaults to 'present'.
state: present
# The executor used by the runner.
executor: 'shell'
executor: shell
# Set maximum build log size in kilobytes.
output_limit: 4096
# Maximum number of jobs to run concurrently on this specific runner.
# Defaults to 0, simply means don't limit.
concurrent_specific: '0'
concurrent_specific: "0"
# The default Docker image to use. Required when executor is `docker`.
docker_image: ''
docker_image: ""
# Set to override the default helper image that is used.
# docker_helper_image: 'gitlab/gitlab-runner-helper-linux:latest'
#
Expand All @@ -117,7 +117,7 @@ gitlab_runner_runners:
# Docker privileged mode
docker_privileged: false
# Runner Locked. When a runner is locked, it cannot be assigned to other projects
locked: 'false'
locked: "false"
# Add container to a custom network
docker_network_mode: bridge
# Change the services startup timeout
Expand Down
4 changes: 2 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# non macOS
- name: restart_gitlab_runner
service: name=gitlab-runner state={{ gitlab_runner_restart_state }}
become: yes
become: true
when: ansible_os_family != 'Darwin' and ansible_os_family != 'Windows' and not gitlab_runner_container_install

# macOS
Expand All @@ -21,5 +21,5 @@
- name: restart_gitlab_runner_container
docker_container:
name: "{{ gitlab_runner_container_name }}"
restart: yes
restart: true
when: gitlab_runner_container_install
31 changes: 16 additions & 15 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
---
galaxy_info:
author: Erik-jan Riemers
namespace: riemers
description: GitLab Runner
license: MIT
min_ansible_version: 2.7
platforms:
- name: EL
versions:
- all
- name: Ubuntu
versions:
- all
- name: Debian
version:
- all
- name: MacOSX
versions:
- all
- name: Windows
versions:
- all
- name: EL
versions:
- all
- name: Ubuntu
versions:
- all
- name: Debian
version:
- all
- name: MacOSX
versions:
- all
- name: Windows
versions:
- all
galaxy_tags:
- gitlab
- runner
Expand Down
6 changes: 3 additions & 3 deletions tasks/config-runner-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
tempfile:
state: file
path: "{{ temp_runner_config_dir.path }}"
prefix: "gitlab-runner.{{ runner_config_index }}."
prefix: gitlab-runner.{{ runner_config_index }}.
register: temp_runner_config
check_mode: no
check_mode: false
changed_when: false

- name: "{{ conf_name_prefix }} Isolate runner configuration"
copy:
dest: "{{ temp_runner_config.path }}"
content: "{{ runner_config }}"
check_mode: no
check_mode: false
changed_when: false

- include_tasks: update-config-runner.yml
Expand Down
12 changes: 6 additions & 6 deletions tasks/config-runner-windows.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
- name: "(Windows) {{ conf_name_prefix }} Create temporary file"
- name: (Windows) {{ conf_name_prefix }} Create temporary file
win_tempfile:
state: file
path: "{{ temp_runner_config_dir.path }}"
prefix: "gitlab-runner.{{ runner_config_index }}."
prefix: gitlab-runner.{{ runner_config_index }}.
register: temp_runner_config
check_mode: no
check_mode: false
changed_when: false

- name: "(Windows) {{ conf_name_prefix }} Isolate runner configuration"
- name: (Windows) {{ conf_name_prefix }} Isolate runner configuration
win_copy:
dest: "{{ temp_runner_config.path }}"
content: "{{ runner_config }}"
check_mode: no
check_mode: false
changed_when: false

- include_tasks: update-config-runner-windows.yml
Expand All @@ -26,7 +26,7 @@
index_var: gitlab_runner_index
loop_var: gitlab_runner

- name: "(Windows) {{ conf_name_prefix }} Remove runner config"
- name: (Windows) {{ conf_name_prefix }} Remove runner config
win_file:
path: "{{ temp_runner_config.path }}"
state: absent
Expand Down
7 changes: 3 additions & 4 deletions tasks/config-runner.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
---

- name: "{{ conf_name_prefix }} Create temporary file"
tempfile:
state: file
path: "{{ temp_runner_config_dir.path }}"
prefix: "gitlab-runner.{{ runner_config_index }}."
prefix: gitlab-runner.{{ runner_config_index }}.
register: temp_runner_config
check_mode: no
check_mode: false
changed_when: false

- name: "{{ conf_name_prefix }} Isolate runner configuration"
copy:
dest: "{{ temp_runner_config.path }}"
content: "{{ runner_config }}"
check_mode: no
check_mode: false
changed_when: false
no_log: "{{ gitlab_runner_no_log_secrets | default(omit) }}"

Expand Down
8 changes: 4 additions & 4 deletions tasks/config-runners-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
state: directory
suffix: gitlab-runner-config
register: temp_runner_config_dir
check_mode: no
check_mode: false
changed_when: false

- name: Write config section for each runner
Expand All @@ -29,10 +29,10 @@
assemble:
src: "{{ temp_runner_config_dir.path }}"
dest: "{{ gitlab_runner_config_file }}"
delimiter: '[[runners]]\n'
backup: yes
delimiter: "[[runners]]\\n"
backup: true
validate: |
docker run -i --rm -v %s:/gitlab-runner.conf
{{ gitlab_runner_container_image }}:{{ gitlab_runner_container_tag }}
verify -c /gitlab-runner.conf
mode: 0600
mode: "0600"
2 changes: 1 addition & 1 deletion tasks/config-runners-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
state: directory
suffix: gitlab-runner-config
register: temp_runner_config_dir
check_mode: no
check_mode: false
changed_when: false

- name: (Windows) Write config section for each runner
Expand Down
8 changes: 4 additions & 4 deletions tasks/config-runners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
state: directory
suffix: gitlab-runner-config
register: temp_runner_config_dir
check_mode: no
check_mode: false
changed_when: false

- name: Write config section for each runner
Expand All @@ -32,9 +32,9 @@
assemble:
src: "{{ temp_runner_config_dir.path }}"
dest: "{{ gitlab_runner_config_file }}"
delimiter: '[[runners]]\n'
backup: yes
delimiter: "[[runners]]\\n"
backup: true
validate: "{{ gitlab_runner_executable }} verify -c %s"
mode: 0600
mode: "0600"
become: "{{ gitlab_runner_system_mode }}"
diff: "{{ gitlab_runner_show_config_diff|bool }}"
Loading

0 comments on commit fe6c594

Please sign in to comment.