mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 08:23:06 -06:00
65 lines
1.3 KiB
YAML
65 lines
1.3 KiB
YAML
---
|
|
|
|
- name: Install distro-specific NFS packages
|
|
include_tasks: "{{ ansible_distribution|lower }}.yml"
|
|
|
|
|
|
- name: Create mountpoint
|
|
file:
|
|
path: "{{ atl_shared_mountpoint }}"
|
|
state: directory
|
|
|
|
- name: Setup the disk partition
|
|
parted:
|
|
device: "{{ atl_nfs_server_device }}"
|
|
label: gpt
|
|
name: "{{ atl_nfs_fs_label }}"
|
|
number: 1
|
|
flags:
|
|
- "{{ atl_nfs_fs_type }}"
|
|
tags:
|
|
- new_only
|
|
|
|
|
|
- name: Create the filesystem
|
|
filesystem:
|
|
dev: "{{ atl_nfs_server_device }}"
|
|
fstype: "{{ atl_nfs_fs_type }}"
|
|
opts: "-L {{ atl_nfs_fs_label }}"
|
|
tags:
|
|
- new_only
|
|
|
|
- name: Setup fstab and mount the filesystem
|
|
mount:
|
|
path: "{{ atl_shared_mountpoint }}"
|
|
src: "LABEL={{ atl_nfs_fs_label }}"
|
|
fstype: "{{ atl_nfs_fs_type }}"
|
|
opts: defaults,nofail
|
|
passno: "2"
|
|
state: mounted
|
|
|
|
|
|
- name: Create the shared home
|
|
file:
|
|
path: "{{ atl_shared_mountpoint }}/{{ atl_product_user }}/shared"
|
|
state: directory
|
|
owner: "{{ atl_product_user }}"
|
|
group: "{{ atl_product_user }}"
|
|
mode: 0750
|
|
tags:
|
|
- new_only
|
|
|
|
|
|
- name: Create the NFS export file
|
|
template:
|
|
src: "media-atl.exports.j2"
|
|
dest: "/etc/exports.d/20-media-atl.exports"
|
|
notify:
|
|
- Restart NFS
|
|
|
|
- name: Enable NFS
|
|
service:
|
|
name: nfs.service
|
|
enabled: true
|
|
state: started
|