From e7c2f5a1752ad02e5409ac5966183bb159294953 Mon Sep 17 00:00:00 2001 From: Nikola Dipanov Date: Fri, 11 Mar 2016 14:24:57 +0000 Subject: [PATCH] Make the role work on Fedora systems The commit makes sure that we include the correct overrides for service names, and also that we don't assume yum as the package manager since newer Fedora versions (22 and above) use dnf. Tested on Fedora 23. --- tasks/main.yml | 4 ++++ tasks/setup-RedHat.yml | 2 +- vars/Fedora.yml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 vars/Fedora.yml diff --git a/tasks/main.yml b/tasks/main.yml index b8f5f7c..9cb7bab 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,6 +7,10 @@ include_vars: RedHat-7.yml when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7" +- name: Include overrides specific to Fedora. + include_vars: Fedora.yml + when: ansible_os_family == 'RedHat' and ansible_distribution == "Fedora" + # Setup/install tasks. - include: setup-RedHat.yml when: ansible_os_family == 'RedHat' diff --git a/tasks/setup-RedHat.yml b/tasks/setup-RedHat.yml index bb95978..18beb5a 100644 --- a/tasks/setup-RedHat.yml +++ b/tasks/setup-RedHat.yml @@ -1,6 +1,6 @@ --- - name: Ensure NFS utilities are installed. - yum: name=nfs-utils state=installed + package: name=nfs-utils state=installed - name: Ensure rpcbind is running. service: name=rpcbind state=started enabled=yes diff --git a/vars/Fedora.yml b/vars/Fedora.yml new file mode 100644 index 0000000..0538858 --- /dev/null +++ b/vars/Fedora.yml @@ -0,0 +1,2 @@ +--- +nfs_server_daemon: nfs-server