diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml new file mode 100644 index 0000000..d436fa7 --- /dev/null +++ b/.github/workflows/yamllint.yml @@ -0,0 +1,35 @@ +--- +name: Lint + +on: + push: + branches: + - "*" + pull_request: + branches: + - "*" + +jobs: + yamllint: + runs-on: ubuntu-latest + steps: + - name: Check out the codebase. + uses: actions/checkout@v4 + + - name: Set up Python 3. + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install test dependencies. + run: | + python3 -m pip install --upgrade pip + python3 -m pip install -r requirements-test.txt + + - name: yamllint + run: | + yamllint . + + - name: ansible-lint + run: | + ansible-lint . diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..b9d032d --- /dev/null +++ b/.yamllint @@ -0,0 +1,5 @@ +--- +extends: relaxed + +rules: + line-length: disable diff --git a/ansible-lint.yml b/ansible-lint.yml new file mode 100644 index 0000000..442befe --- /dev/null +++ b/ansible-lint.yml @@ -0,0 +1,2 @@ +skip_list: + - var-naming[no-role-prefix] # remove when https://github.com/ansible/ansible-lint/discussions/3451 is done diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 index 0000000..6574038 --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1,2 @@ +ansible +ansible-lint \ No newline at end of file diff --git a/roles/repos/tasks/Debian.yml b/roles/repos/tasks/Debian.yml index f4b5f9e..2441ba0 100644 --- a/roles/repos/tasks/Debian.yml +++ b/roles/repos/tasks/Debian.yml @@ -1,10 +1,10 @@ --- -- name: apt - Add repositiory key +- name: Apt - Add repositiory key ansible.builtin.apt_key: state: present url: "{{ influxdb_repos_key_url }}" -- name: apt - Add repository to list - ansible.builtin.apt_repository: - repo: "{{ influxdb_repos_stable }}" +- name: Apt - Add repository to list + ansible.builtin.apt_repository: + repo: "{{ influxdb_repos_stable }}" state: present diff --git a/roles/repos/tasks/RedHat.yml b/roles/repos/tasks/RedHat.yml index fcbf74e..92f5bad 100644 --- a/roles/repos/tasks/RedHat.yml +++ b/roles/repos/tasks/RedHat.yml @@ -1,10 +1,10 @@ --- -- name: yum - Add repositiory key +- name: Yum - Add repositiory key ansible.builtin.rpm_key: state: present key: "{{ influxdb_repos_key_url }}" -- name: yum - Add repository to list +- name: Yum - Add repository to list ansible.builtin.yum_repository: state: present name: influxdb diff --git a/roles/repos/vars/Debian.yml b/roles/repos/vars/Debian.yml index fdc0454..bb35f40 100644 --- a/roles/repos/vars/Debian.yml +++ b/roles/repos/vars/Debian.yml @@ -1,2 +1,2 @@ --- -influxdb_repos_stable: "deb https://repos.influxdata.com/{{ ansible_distribution|lower }} {{ ansible_distribution_release|lower }} stable" \ No newline at end of file +influxdb_repos_stable: "deb https://repos.influxdata.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }} stable" diff --git a/roles/repos/vars/default.yml b/roles/repos/vars/default.yml index f330686..746d187 100644 --- a/roles/repos/vars/default.yml +++ b/roles/repos/vars/default.yml @@ -1,2 +1,2 @@ --- -# default variables for influxdb.repos \ No newline at end of file +# default variables for influxdb.repos diff --git a/vagrant-tests.yml b/vagrant-tests.yml index 56c70bb..52126cb 100644 --- a/vagrant-tests.yml +++ b/vagrant-tests.yml @@ -3,4 +3,4 @@ become: true roles: - - repos \ No newline at end of file + - repos