diff --git a/roles/installPackage/tasks/main.yml b/roles/installPackage/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..7bc78f6d6c1676c3fd66d0978c110603175c76f3 --- /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 883b49f1c78942ca3b9c27e693a3135abdbbcf6f..e1e6b598a774ccf3be5cfab7da3d87ca2b5ae246 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 c861000952d44fd51172e1fd7d608e3dfc94a23a..967ec246c1ccf327d7e57a86e54b855907703a45 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