-
Notifications
You must be signed in to change notification settings - Fork 1
/
rhel7-provision-fedora-nfs.yml
101 lines (77 loc) · 2.29 KB
/
rhel7-provision-fedora-nfs.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
- name: Configure nfs for Fedora
remote_user: ulsprovision
hosts: islandora_fedora_servers
become: yes
tasks:
# Stop Tomcat
- name: Stop Tomcat.
systemd:
state: stopped
name: tomcat
- pause:
seconds: 30
# Create fedoradata dir
- name: Create fedoradata directory
file:
path: /fedoradata
state: directory
- name: yum install net-utils
yum:
name: nfs-utils
state: latest
- name: Start and enable nfs service
service:
name: nfs
state: started
enabled: yes
# Mount NFS
- name: mount network share
mount:
src: pa-nfs-02.library.pitt.edu:/fedora_prod_data_01_clone
path: /fedoradata
fstype: nfs
opts: rw,hard,intr,rsize=8192,wsize=8192,timeo=1400,tcp,context="system_u:object_r:public_content_rw_t:s0"
state: mounted
# Move original datastreamstore and objectstore
# - name: Move original datastreamStore
# command: mv /usr/local/fedora/data/datastreamStore /usr/local/fedora/data/datastreamStore.orig
# - name: Move original objectStore
# command: mv /usr/local/fedora/data/objectStore /usr/local/fedora/data/objectStore.orig
# Link new datastreamstore and objectstore
- name: Link datastreamStore
file:
src: /fedoradata/fedora/data/datastreamStore
dest: /usr/local/fedora/data/datastreamStore
owner: tomcat
group: tomcat
state: link
follow: false
- name: Link objectStore
file:
src: /fedoradata/fedora/data/objectStore
dest: /usr/local/fedora/data/objectStore
owner: tomcat
group: tomcat
state: link
follow: false
- name: Replace fedora_inst with fedora_prod in fedora.fcfg
replace:
path: /usr/local/fedora/server/config/fedora.fcfg
regexp: 'fedora_inst'
replace: 'fedora_prod'
backup: yes
- name: copy custom selinux modules for nfs
copy:
src: resources/fedora/NFS
dest: /tmp
- name: Run selinux policy nfs
command: semodule -i /tmp/NFS/tomcatnfs.pp
- name: Run selinux policy nfs
command: semodule -i /tmp/NFS/local_tomcat.cil
# Start Tomcat
- name: Start Tomcat
systemd:
state: started
name: tomcat
- pause:
seconds: 30