blob: fe7f83cbb98f8f5cc74a809547b07114da32dfd7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
---
- name: Install nfs-utils
action: "{{ ansible_pkg_mgr }} name=nfs-utils state=present"
- name: Configure NFS
lineinfile:
dest: /etc/sysconfig/nfs
regexp: '^RPCNFSDARGS=.*$'
line: 'RPCNFSDARGS="-N 2 -N 3"'
register: nfs_config
- name: Restart nfs-config
service: name=nfs-config state=restarted
when: nfs_config | changed
- name: Ensure exports directory exists
file:
path: "{{ openshift.hosted.registry.storage.nfs.directory }}"
state: directory
- name: Ensure export directories exist
file:
path: "{{ openshift.hosted.registry.storage.nfs.directory }}/{{ item }}"
state: directory
mode: 0777
owner: nfsnobody
group: nfsnobody
with_items:
- "{{ openshift.hosted.registry.storage.volume.name }}"
- name: Configure exports
template:
dest: /etc/exports
src: exports.j2
notify:
- restart nfs-server
- name: Enable and start services
service:
name: "{{ item }}"
state: started
enabled: yes
register: start_result
with_items:
- nfs-server
- set_fact:
nfs_service_status_changed: "{{ start_result | changed }}"
|