Files
dc-deployments-automation/roles/nfs_server/tasks/main.yml
Lee Goolsbee 6151f01534 Merged in al2022 (pull request #187)
Add support for Amazon Linux 2022

* first pass at basic AL2022 support

* unpin git version on AL2022

* resolve a few package issues/discrepancies

* fix non-Amazon distro support

* fix missing nfs.service symlink on AL2022

* remove Ubuntu/Debian install task from aws_common (no existing ubuntu dependency tasks)

* add amazonlinux:2022 to list of images for testing via molecule

* install amazon-cloudwatch-agent from package sources instead of direct RPM on AL2022; add workaround for missing group

* fix typo in task name

* add mising amazonlinux:2022 test for product_install role

* al2022 -> al2023

* al2023 ships with rpm-installed versions of setuptools and distlib that aren't removable and older than what pipenv requires; use py3.11 instead


Approved-by: Vadym Kovalskiy
Approved-by: Eugene Ivantsov
Approved-by: Yurii Kuzan
2023-05-17 17:11:12 +00:00

69 lines
1.7 KiB
YAML

---
- name: Install Amazon-Linux-specific NFS packages
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}.yml"
when: ansible_distribution | lower == 'amazon'
- name: Install Ubuntu/Debian-specific NFS packages
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}.yml"
when: ansible_distribution | lower != 'amazon'
- name: Create mountpoint
ansible.builtin.file:
path: "{{ atl_shared_mountpoint }}"
state: directory
- name: Setup the disk partition
community.general.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
community.general.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
ansible.posix.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
ansible.builtin.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
ansible.builtin.template:
src: "media-atl.exports.j2"
dest: "/etc/exports.d/20-media-atl.exports"
notify:
- Restart NFS
- name: Enable NFS
ansible.builtin.service:
name: nfs.service
enabled: true
state: started