This repository has been archived by the owner on Nov 1, 2018. It is now read-only.
forked from cyverse-archive/DE
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
michael-conway
committed
Mar 15, 2016
1 parent
cd11eb4
commit 2e888e3
Showing
13 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
nfs_exports: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
- name: restart nfs | ||
service: "name={{ nfs_server_daemon }} state=restarted" | ||
when: nfs_exports|length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
dependencies: [] | ||
|
||
galaxy_info: | ||
author: geerlingguy | ||
description: NFS installation for Linux. | ||
company: "Midwestern Mac, LLC" | ||
license: "license (BSD, MIT)" | ||
min_ansible_version: 2.0 | ||
platforms: | ||
- name: EL | ||
versions: | ||
- all | ||
- name: Fedora | ||
versions: | ||
- all | ||
- name: Debian | ||
versions: | ||
- all | ||
- name: Ubuntu | ||
versions: | ||
- all | ||
galaxy_tags: | ||
- system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
# Include variables and define needed variables. | ||
- name: Include OS-specific variables. | ||
include_vars: "{{ ansible_os_family }}.yml" | ||
|
||
- name: Include overrides specific to RHEL 7. | ||
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' | ||
|
||
- include: setup-Debian.yml | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: Ensure directories to export exist | ||
file: 'path="{{ item.strip().split()[0] }}" state=directory' | ||
with_items: "{{ nfs_exports }}" | ||
notify: restart nfs | ||
|
||
- name: Copy exports file. | ||
template: | ||
src: exports.j2 | ||
dest: /etc/exports | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
register: nfs_exports_copy | ||
notify: restart nfs | ||
|
||
- name: Restart NFS immediately if exports are updated. | ||
service: "name={{ nfs_server_daemon }} state=restarted" | ||
when: nfs_exports_copy.changed | ||
|
||
- name: Ensure nfs is running. | ||
service: "name={{ nfs_server_daemon }} state=started enabled=yes" | ||
when: nfs_exports|length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- name: Ensure NFS utilities are installed. | ||
apt: "name={{ item }} state=installed" | ||
with_items: | ||
- nfs-common | ||
- nfs-kernel-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- name: Ensure NFS utilities are installed. | ||
package: name=nfs-utils state=installed | ||
|
||
- name: Ensure rpcbind is running. | ||
service: name=rpcbind state=started enabled=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# /etc/exports: the access control list for filesystems which may be exported | ||
# to NFS clients. See exports(5). | ||
# | ||
# Example for NFSv2 and NFSv3: | ||
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check) | ||
# | ||
# Example for NFSv4: | ||
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check) | ||
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check) | ||
# | ||
{% for export in nfs_exports %} | ||
{{ export }} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- hosts: localhost | ||
remote_user: root | ||
roles: | ||
- ansible-role-nfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
nfs_server_daemon: nfs-kernel-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
nfs_server_daemon: nfs-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
nfs_server_daemon: nfs-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
nfs_server_daemon: nfs |