From b5576ed885c1cdbbb7876bb924d9c325db535704 Mon Sep 17 00:00:00 2001
From: CVL-GitHub <jupiter.hu@monash.edu>
Date: Thu, 8 Jan 2015 23:51:52 +0000
Subject: [PATCH] Fixed fake nvsServer

---
 roles/installPackage/tasks/main.yml        | 32 ++++++++++++++++++++++
 roles/nfs-client/tasks/mountFileSystem.yml | 12 +++++++-
 roles/syncExports/handlers/main.yml        |  3 +-
 3 files changed, 44 insertions(+), 3 deletions(-)
 create mode 100644 roles/installPackage/tasks/main.yml

diff --git a/roles/installPackage/tasks/main.yml b/roles/installPackage/tasks/main.yml
new file mode 100644
index 0000000..7bc78f6
--- /dev/null
+++ b/roles/installPackage/tasks/main.yml
@@ -0,0 +1,32 @@
+---
+- name: Pre installation
+  shell: "{{ preInstallation }}" 
+  sudo: true
+  when: ansible_distribution == 'CentOS' and preInstallation is defined
+  
+- name: Add new repo file 
+  shell: "{{ importRepo.command }}" "{{ importRepo.destination }}"" 
+  sudo: true
+  run_once: true
+  args:
+    creates: "{{ importRepo.destination }}"
+  when: ansible_distribution == 'CentOS' and importRepo is defined
+
+- name: Install yum packages 
+  yum: name={{ item }} state=latest
+  with_items: yumPackageList
+  sudo: true
+  when: ansible_distribution == 'CentOS' and yumPackageList is defined
+
+- name: Install yum group packages 
+  shell: yum --setopt=protected_multilib=false -y groupinstall "{{ item }}"
+  with_items: yumGroupPackageList
+  sudo: true
+  when: ansible_distribution == 'CentOS' and yumGroupPackageList is defined
+
+- name: Post installation
+  shell: "{{ postInstallation }}" 
+  sudo: true
+  when: ansible_distribution == 'CentOS' and postInstallation is defined
+  
+
diff --git a/roles/nfs-client/tasks/mountFileSystem.yml b/roles/nfs-client/tasks/mountFileSystem.yml
index 883b49f..e1e6b59 100644
--- a/roles/nfs-client/tasks/mountFileSystem.yml
+++ b/roles/nfs-client/tasks/mountFileSystem.yml
@@ -4,7 +4,7 @@
   register: nfsServer
   run_once: true
   delegate_to: "{{ nfs_server }}"
-  when: nfsServer is not defined
+  when: naNfsServer is not defined
 
 - name: "Mounting NFS mounts"
   mount: "name={{ item.name }} src={{ nfsServer['ansible_facts']['ansible_'+item.interface]['ipv4']['address'] }}:{{ item.src }} fstype={{ item.fstype }} opts={{ item.opts }} state=mounted"
@@ -12,3 +12,13 @@
   notify: "restart authentication"
   notify: "restart idmap"
   sudo: true 
+  when: naNfsServer is not defined
+
+- name: "Mounting non-ansible NFS server"
+  mount: "name={{ item.name }} src={{ naNfsServer['ansible_facts']['ansible_'+item.interface]['ipv4']['address'] }}:{{ item.src }} fstype={{ item.fstype }} opts={{ item.opts }} state=mounted"
+  with_items: exportList
+  notify: "restart authentication"
+  notify: "restart idmap"
+  sudo: true
+  when: naNfsServer is defined
+
diff --git a/roles/syncExports/handlers/main.yml b/roles/syncExports/handlers/main.yml
index c861000..967ec24 100644
--- a/roles/syncExports/handlers/main.yml
+++ b/roles/syncExports/handlers/main.yml
@@ -1,6 +1,5 @@
 ---
-- name: Reload exports 
+- name: "Reload exports" 
   command: exportfs -ra
   delegate_to: "{{ nfs_server }}"
-  run_once: true
   sudo: true
-- 
GitLab