From f2870ade3684a71e3c2ce3a5f2f34662468aa34a Mon Sep 17 00:00:00 2001 From: mg Date: Wed, 27 Jan 2021 09:15:34 +0100 Subject: [PATCH] Gitlab-CI: ansible-lint --- .gitlab-ci.yml | 13 +++++++++++++ .gitmodules | 3 +++ group_vars/gitlabrunner.yml | 9 +++++++++ host_vars/gitlab-runner-staging.grote.lan.yml | 10 ---------- host_vars/gitlab-runner-test.grote.lan.yml | 10 ---------- host_vars/gitlab-runner.grote.lan.yml | 10 ---------- playbooks/service/gitlab-runner.yml | 2 +- roles/riemers.gitlab-runner | 1 + 8 files changed, 27 insertions(+), 31 deletions(-) create mode 100644 .gitlab-ci.yml delete mode 100644 host_vars/gitlab-runner-staging.grote.lan.yml delete mode 100644 host_vars/gitlab-runner-test.grote.lan.yml delete mode 100644 host_vars/gitlab-runner.grote.lan.yml create mode 160000 roles/riemers.gitlab-runner diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..9084a547 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,13 @@ +image: python:3-slim + +before_script: + - pip install ansible-lint + - ansible-lint --version + +stages: + - ansible-lint + +ansible-lint: + stage: ansible-lint + script: + - ansible-lint . diff --git a/.gitmodules b/.gitmodules index 3845f19b..31d6d6f7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -37,3 +37,6 @@ [submodule "roles/geerlingguy.gitlab"] path = roles/geerlingguy.gitlab url = https://github.com/geerlingguy/ansible-role-gitlab +[submodule "roles/riemers.gitlab-runner"] + path = roles/riemers.gitlab-runner + url = https://github.com/riemers/ansible-gitlab-runner diff --git a/group_vars/gitlabrunner.yml b/group_vars/gitlabrunner.yml index 6435c2bf..482a2724 100644 --- a/group_vars/gitlabrunner.yml +++ b/group_vars/gitlabrunner.yml @@ -9,3 +9,12 @@ pip_package: python3-pip pip_install_packages: - name: python-gitlab + ### riemers.gitlab-runner + gitlab_runner_coordinator_url: https://git.mgrote.net + gitlab_runner_registration_token: "{{ lookup('keepass', 'gitlab_runner_registration_token', 'password') }}" + gitlab_runner_runners: + - name: "{{ ansible_hostname }}-docker" + executor: docker + docker_image: 'alpine' + docker_volumes: + - "/var/run/docker.sock:/var/run/docker.sock" diff --git a/host_vars/gitlab-runner-staging.grote.lan.yml b/host_vars/gitlab-runner-staging.grote.lan.yml deleted file mode 100644 index 576b21de..00000000 --- a/host_vars/gitlab-runner-staging.grote.lan.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - ### mgrote.gitlab-runner - gitlab_runner: - - api_url: https://git.mgrote.net - registration_token: "{{ lookup('keepass', 'gitlab_runner_registration_token', 'password') }}" - api_token: "{{ lookup('keepass', 'gitlab_runner_api_token', 'password') }}" #Token: ansible-gitlab-runner - api_username: root - description: "{{ ansible_hostname }}" - active: "false" - state: "absent" diff --git a/host_vars/gitlab-runner-test.grote.lan.yml b/host_vars/gitlab-runner-test.grote.lan.yml deleted file mode 100644 index 576b21de..00000000 --- a/host_vars/gitlab-runner-test.grote.lan.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - ### mgrote.gitlab-runner - gitlab_runner: - - api_url: https://git.mgrote.net - registration_token: "{{ lookup('keepass', 'gitlab_runner_registration_token', 'password') }}" - api_token: "{{ lookup('keepass', 'gitlab_runner_api_token', 'password') }}" #Token: ansible-gitlab-runner - api_username: root - description: "{{ ansible_hostname }}" - active: "false" - state: "absent" diff --git a/host_vars/gitlab-runner.grote.lan.yml b/host_vars/gitlab-runner.grote.lan.yml deleted file mode 100644 index cb4a0321..00000000 --- a/host_vars/gitlab-runner.grote.lan.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - ### mgrote.gitlab-runner - gitlab_runner: - - api_url: https://git.mgrote.net - registration_token: "{{ lookup('keepass', 'gitlab_runner_registration_token', 'password') }}" - api_token: "{{ lookup('keepass', 'gitlab_runner_api_token', 'password') }}" #Token: ansible-gitlab-runner - api_username: root - description: "{{ ansible_hostname }}" - active: "true" - state: "present" diff --git a/playbooks/service/gitlab-runner.yml b/playbooks/service/gitlab-runner.yml index 4a416c60..a295515d 100644 --- a/playbooks/service/gitlab-runner.yml +++ b/playbooks/service/gitlab-runner.yml @@ -4,4 +4,4 @@ - { role: geerlingguy.pip, tags: "pip", become: true } - { role: geerlingguy.docker, tags: "docker", become: true } - { role: gantsign.ctop, tags: "ctop", become: true } - - { role: mgrote.gitlab-runner, tags: "gitlab-runner", become: true } + - { role: riemers.gitlab-runner, tags: "gitlab-runner", become: true } diff --git a/roles/riemers.gitlab-runner b/roles/riemers.gitlab-runner new file mode 160000 index 00000000..860652c8 --- /dev/null +++ b/roles/riemers.gitlab-runner @@ -0,0 +1 @@ +Subproject commit 860652c8a2b61d2b93a42aaca6895caaf757afef