From 6c8c828300f20da59f9256490e82f2711bf66a22 Mon Sep 17 00:00:00 2001 From: Adrien Reslinger Date: Tue, 16 Aug 2022 14:36:32 +0200 Subject: [PATCH] Fix lint errors --- tasks/add_repo_Debian.yml | 4 +-- tasks/install.yml | 22 ++++++++--------- tasks/main.yml | 5 ++-- tasks/uninstall.yml | 52 +++++++++++++++++++-------------------- 4 files changed, 42 insertions(+), 41 deletions(-) diff --git a/tasks/add_repo_Debian.yml b/tasks/add_repo_Debian.yml index 2309219..5ca1655 100644 --- a/tasks/add_repo_Debian.yml +++ b/tasks/add_repo_Debian.yml @@ -3,7 +3,7 @@ ansible.builtin.apt_repository: repo: ppa:ansible/ansible state: present - update_cache: yes + update_cache: true when: - ansible_distribution == "Ubuntu" @@ -12,7 +12,7 @@ repo: deb http://ppa.launchpad.net/ansible/ansible/ubuntu {{ ansible_distribution_name }} main filename: ansible.list state: present - update_cache: yes + update_cache: true mode: "0644" # owner: root # ansible.builtin.group: root diff --git a/tasks/install.yml b/tasks/install.yml index 0d363ab..60018d8 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,13 +1,13 @@ --- - - name: Define repo for {{ ansible_os_family }} - ansible.builtin.include_tasks: add_repo_{{ ansible_os_family }}.yml - tags: - - config +- name: Define repo for {{ ansible_os_family }} + ansible.builtin.include_tasks: add_repo_{{ ansible_os_family }}.yml + tags: + - config - - name: Install packages - ansible.builtin.package: - name: '{{ ansible_packages }}' - state: present - update_cache: true - tags: - - installation +- name: Install packages + ansible.builtin.package: + name: '{{ ansible_packages }}' + state: present + update_cache: true + tags: + - installation diff --git a/tasks/main.yml b/tasks/main.yml index 4238262..b597cb5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,6 @@ --- -- block: +- name: Ansible tasks + block: - name: Include vars for {{ ansible_os_family }} ansible.builtin.include_vars: "{{ ansible_os_family }}.yml" @@ -14,4 +15,4 @@ - ansible_uninstall|bool tags: - - ansible \ No newline at end of file + - ansible diff --git a/tasks/uninstall.yml b/tasks/uninstall.yml index fa0c9ab..4275bba 100644 --- a/tasks/uninstall.yml +++ b/tasks/uninstall.yml @@ -1,30 +1,30 @@ --- - - name: Remove Ansible's files - ansible.builtin.file: - path: "/etc/yum.repos.d/ansible.repo" - state: absent - when: - - ansible_os_family == 'RedHat' +- name: Remove Ansible's files + ansible.builtin.file: + path: "/etc/yum.repos.d/ansible.repo" + state: absent + when: + - ansible_os_family == 'RedHat' - - name: Registering Ubuntu Ansible repository - ansible.builtin.apt_repository: - repo: ppa:ansible/ansible - state: absent - update_cache: true - when: - - ansible_distribution == "Ubuntu" +- name: Registering Ubuntu Ansible repository + ansible.builtin.apt_repository: + repo: ppa:ansible/ansible + state: absent + update_cache: true + when: + - ansible_distribution == "Ubuntu" - - name: Registering Debian Ansible repository - ansible.builtin.apt_repository: - repo: deb http://ppa.launchpad.net/ansible/ansible/ubuntu {{ ansible_distribution_name }} main - filename: ansible.list - state: absent - update_cache: true - when: - - ansible_distribution == "Debian" +- name: Registering Debian Ansible repository + ansible.builtin.apt_repository: + repo: deb http://ppa.launchpad.net/ansible/ansible/ubuntu {{ ansible_distribution_name }} main + filename: ansible.list + state: absent + update_cache: true + when: + - ansible_distribution == "Debian" - - name: Remove Ansible's packages - ansible.builtin.package: - name: '{{ ansible_packages }}' - state: absent - update_cache: true +- name: Remove Ansible's packages + ansible.builtin.package: + name: '{{ ansible_packages }}' + state: absent + update_cache: true