From 303cd59aa1d983d196179c6bd58b68e8ee0d9192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Thu, 13 Jan 2022 00:29:03 +0100 Subject: [PATCH] Change common conditional --- project/roles/common/tasks/packages.yml | 5 +++-- project/roles/common/tasks/packages_debian.yml | 2 +- project/roles/common/tasks/packages_redhat.yml | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/project/roles/common/tasks/packages.yml b/project/roles/common/tasks/packages.yml index bde8318..f3ab8ef 100644 --- a/project/roles/common/tasks/packages.yml +++ b/project/roles/common/tasks/packages.yml @@ -6,11 +6,12 @@ - htop - xfsprogs - iotop + state: present - name: Ensure debian-specific packages are installed import_tasks: packages_debian.yml - when: ansible_facts['os-family']|lower == 'debian' + when: ansible_facts['os-family'] == 'Debian' - name: Ensure rhel-specific packages are installed import_tasks: packages_redhat.yml - when: ansible_facts['os-family']|lower == 'redhat' + when: ansible_facts['os-family'] == 'RedHat' diff --git a/project/roles/common/tasks/packages_debian.yml b/project/roles/common/tasks/packages_debian.yml index ccb3c81..d1ab7e1 100644 --- a/project/roles/common/tasks/packages_debian.yml +++ b/project/roles/common/tasks/packages_debian.yml @@ -3,4 +3,4 @@ ansible.builtin.package: name: - vim - - xfsprogs \ No newline at end of file + state: present \ No newline at end of file diff --git a/project/roles/common/tasks/packages_redhat.yml b/project/roles/common/tasks/packages_redhat.yml index 40b40cc..5ef218e 100644 --- a/project/roles/common/tasks/packages_redhat.yml +++ b/project/roles/common/tasks/packages_redhat.yml @@ -4,3 +4,4 @@ name: - vim-enhanced - yum-cron + state: present