From 3273aab3f70f4b62c9a422ee9d1f49dd7a75b9f7 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 16 Aug 2023 20:32:52 +0200 Subject: fix some ansible-lint warnings --- .ansible-lint | 8 ++++++++ galaxy.yml | 3 ++- roles/apt_repo/tasks/main.yml | 9 +++++++-- roles/my_workspace/tasks/project.yml | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 .ansible-lint diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..2947d6c --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,8 @@ +skip_list: + # No, the changelog is not required, it works perfectly fine without it. + - galaxy[no-changelog] + # Tags are not required either. + - galaxy[tags] + # These are just plain stupid. + - galaxy[version-incorrect] + - name[casing] diff --git a/galaxy.yml b/galaxy.yml index 1d8823f..72b605b 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -4,6 +4,7 @@ version: 0.0.15 description: Some common Ansible roles used by me to manage things repository: https://github.com/egor-tensin/infra-ansible readme: README.md -license: MIT +license: + - MIT authors: - Egor Tensin diff --git a/roles/apt_repo/tasks/main.yml b/roles/apt_repo/tasks/main.yml index 3ad7642..4c1d92f 100644 --- a/roles/apt_repo/tasks/main.yml +++ b/roles/apt_repo/tasks/main.yml @@ -21,11 +21,16 @@ dest: '{{ key_path }}' mode: '644' - - name: Get host distribution + - name: Get host distro ansible.builtin.setup: gather_subset: [distribution_release] + - name: Set repository defaults + ansible.builtin.set_fact: + apt_repo_distro: '{{ apt_repo_distro | default(ansible_distribution_release) }}' + apt_repo_component: '{{ apt_repo_component | default("main") }}' + - name: 'Add repository: {{ apt_repo_name }}' ansible.builtin.apt_repository: - repo: 'deb [signed-by={{ key_path }}] {{ apt_repo_url }} {{ apt_repo_distro | default(ansible_distribution_release) }} {{ apt_repo_component | default("main") }}' + repo: 'deb [signed-by={{ key_path }}] {{ apt_repo_url }} {{ apt_repo_distro }} {{ apt_repo_component }}' filename: '{{ apt_repo_name }}' diff --git a/roles/my_workspace/tasks/project.yml b/roles/my_workspace/tasks/project.yml index ae139f5..f9a138a 100644 --- a/roles/my_workspace/tasks/project.yml +++ b/roles/my_workspace/tasks/project.yml @@ -33,7 +33,7 @@ chdir: '{{ project_dir }}' register: make_output when: makefile_check is succeeded - + - name: Show make output ansible.builtin.debug: var: make_output -- cgit v1.2.3