From 8b3cbb232a4bbcf9720ccf0eef5a4d1252cef308 Mon Sep 17 00:00:00 2001 From: Bert Van Vreckem Date: Thu, 12 May 2016 09:48:59 +0200 Subject: [PATCH] Moved hard coded packages to vars/, use package: module --- tasks/main.yml | 15 ++++++++------- vars/os_Debian.yml | 6 ++++++ vars/os_RedHat.yml | 9 +++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index b82c30e..fc0f323 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -5,18 +5,19 @@ with_first_found: - "os_{{ ansible_distribution }}.yml" - "os_{{ ansible_os_family }}.yml" - - "default.yml" - name: Install Samba packages - action: "{{ ansible_pkg_mgr }} pkg={{ item }} state=installed" - with_items: - - samba-common - - samba - - samba-client + package: + name: "{{ item }}" + state: present + with_items: "{{ samba_packages }}" tags: samba - name: Install SELinux package - action: "{{ ansible_pkg_mgr }} pkg=libsemanage-python state=installed" + package: + name: "{{ item }}" + state: present + with_items: "{{ samba_selinux_packages }}" when: ansible_selinux - name: Make sure SELinux boolean settings are correct diff --git a/vars/os_Debian.yml b/vars/os_Debian.yml index 3705309..0855730 100644 --- a/vars/os_Debian.yml +++ b/vars/os_Debian.yml @@ -1,4 +1,10 @@ +# roles/samba/vars/os_Debian.yml --- +samba_packages: + - samba-common + - samba + - samba-client + samba_service: smbd winbind_service: nmbd diff --git a/vars/os_RedHat.yml b/vars/os_RedHat.yml index 2a4155d..9f247d7 100644 --- a/vars/os_RedHat.yml +++ b/vars/os_RedHat.yml @@ -1,4 +1,13 @@ +# roles/samba/vars/os_RedHat.yml --- +samba_packages: + - samba-common + - samba + - samba-client + +samba_selinux_packages: + - libselinux-python + samba_service: smb winbind_service: nmb