diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000000000000000000000000000000000000..8d40d067c46c42adf88f5922bc7fc9c6407ce7bb --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,7 @@ +--- +warn_list: # or 'skip_list' to silence them completely + - git-latest # Git checkouts must contain explicit version + - ignore-errors # Use failed_when and specify error conditions instead of using ignore_errors + - no-changed-when # Commands should not change things if nothing needs doing + - no-handler # Tasks that run when changed should likely be handlers + - package-latest # Package installs should not use latest diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000000000000000000000000000000000000..fbebdb8c3eabfec06b071490a73331e2e80152fe --- /dev/null +++ b/.yamllint @@ -0,0 +1,39 @@ +--- +# Based on ansible-lint config +extends: default + +rules: + braces: + max-spaces-inside: 1 + level: error + brackets: + max-spaces-inside: 1 + level: error + colons: + max-spaces-after: -1 + level: error + commas: + max-spaces-after: -1 + level: error + # comments enable + comments: enable + comments-indentation: enable + document-start: enable + empty-lines: + max: 3 + level: error + hyphens: + level: error + indentation: + level: warning + indent-sequences: consistent + spaces: 4 + check-multi-line-strings: true + key-duplicates: enable + line-length: disable + new-line-at-end-of-file: enable + new-lines: + type: unix + # trailing-spaces enable + trailing-spaces: enable + truthy: enable diff --git a/meta/main.yml b/meta/main.yml index ce822b35d8743dbe9a8ca2b53cfce6378752b81c..cc66855fe0fd862b078d12b5a3049dabc972ab0e 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,13 +1,13 @@ --- galaxy_info: - author: Rémi - description: Role for deploying and configuring GitLab CE edition - company: Le Filament (https://le-filament.com) - license: AGPL-3.0-or-later - min_ansible_version: 2.1 - platforms: - - name: Ubuntu - versions: - - focal - galaxy_tags: - - gitlab + author: lefilament + description: Role for deploying and configuring GitLab CE edition + company: Le Filament (https://le-filament.com) + license: AGPL-3.0-or-later + min_ansible_version: "2.1" + platforms: + - name: Ubuntu + versions: + - focal + galaxy_tags: + - gitlab diff --git a/tasks/main.yml b/tasks/main.yml index 1505f4d7ffbffa10b1b162a829046596a7750e29..11ef8b0a74a148e520c42a24079902fbd136d9a6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,38 +1,38 @@ --- - name: Install apt-transport-https package - package: - name: apt-transport-https - state: latest + ansible.builtin.package: + name: apt-transport-https + state: latest async: 120 poll: 10 when: ansible_os_family == "Debian" and not ansible_check_mode - name: Add GitLab Runner GPG key to APT - get_url: - url: "{{ gitlab_runner_gpg_key_url }}" - dest: /etc/apt/trusted.gpg.d/gitlab-runner.asc - mode: '0644' + ansible.builtin.get_url: + url: "{{ gitlab_runner_gpg_key_url }}" + dest: /etc/apt/trusted.gpg.d/gitlab-runner.asc + mode: '0644' when: ansible_os_family == "Debian" - name: Add GitLab repo to APT repositories - apt_repository: - repo: deb {{ gitlab_runner_packages_url }}/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} main - update_cache: true + ansible.builtin.apt_repository: + repo: deb {{ gitlab_runner_packages_url }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main + update_cache: true when: ansible_os_family == "Debian" - name: Install GitLab Runner package - package: - name: - - gitlab-runner - - docker.io - state: latest + ansible.builtin.package: + name: + - gitlab-runner + - docker.io + state: latest async: 300 poll: 10 when: not ansible_check_mode - name: Check installed GitLab Runner package - package: - name: gitlab-runner - state: latest + ansible.builtin.package: + name: gitlab-runner + state: latest when: ansible_check_mode