Files
fedora-infra_ansible/roles/nfs/client/tasks/main.yml
Michal Konecny be2e3a6d35 [nfs] Fix the nfs related errors
* intr parameter is now deprecated and it's no longer effective in
newer kernels

* nfs-server needs to run as well on Fedora otherwise the mount request
is rejected
2025-07-04 10:38:17 +02:00

106 lines
3.0 KiB
YAML

# Setup our idmapd.conf file. It should be loaded automagically.
---
- name: Idmapd.conf
ansible.builtin.copy: src=idmapd.conf dest=/etc/idmapd.conf
tags:
- nfs/client
# if we need to reload nm, we should do it now, not after roles.
- meta: flush_handlers
# on builders re-up eth0 to make sure systemd-resolved has updated info
- name: Nmcli c up eth0 on buildvms
ansible.builtin.command: nmcli c up eth0
check_mode: no
changed_when: false
when: inventory_hostname.startswith('buildvm')
tags:
- nfs/client
#
# Install needed packages
#
- name: Install needed nfs packages
ansible.builtin.package:
name: "{{ item }}"
state: present
with_items:
- nfs-utils
- rpcbind
tags:
- nfs/client
- name: Enable rpcbind services and run them (rhel 7+ and Fedora)
service: name={{ item }} enabled=true state=started
with_items:
- rpcbind
when: ansible_distribution_major_version|int >= 7 and ansible_distribution == 'RedHat'
tags:
- nfs/client
- name: Enable nfs-lock service and run them (rhel 7 and Fedora)
service: name={{ item }} enabled=true state=started
with_items:
- nfs-lock
when: ansible_distribution_major_version|int == 7 and ansible_distribution == 'RedHat'
tags:
- nfs/client
- name: Nfs mount points (rdu3)
mount: >
name={{ mnt_dir }}
src=ntap-rdu3-c02-fedora01-nfs01a.neta-002.prod.rdu2.dc.redhat.com:/{{ nfs_src_dir }}
fstype=nfs
opts={{nfs_mount_opts}}
passno=0
dump=0
state=mounted
when: ( datacenter == 'rdu3' or datacenter == 'staging' ) and (env != 'staging' or mount_stg is defined)
tags:
- nfs/client
- name: Nfs mount points (rdu)
mount: >
name={{ mnt_dir }}
src=172.31.1.11:/{{ nfs_src_dir }}
fstype=nfs
opts={{nfs_mount_opts}}
passno=0
dump=0
state=mounted
when: datacenter == 'rdu'
tags:
- nfs/client
#
# In stg we need to mount the koji01.stg volume rw and the
# production nfs volume ro. Since the setup here isn't good
# for multiple nfs mounts, we just hard code needed staging bits
# here. If it becomes more common to have multiple mounts, we
# should revisit how this role works.
#
- name: Nfs mount points (stg) staging koji (rdu3)
mount: >
name=/mnt/fedora_koji
src=10.16.167.64:/mnt/fedora_koji
fstype=nfs4
opts=rw,hard,bg,noatime,nodev,nosuid,nfsvers=4
passno=0
dump=0
state=mounted
when: datacenter == 'rdu3' and env == 'staging' and 'koji' in mnt_dir and '.s390.' not in inventory_hostname and not inventory_hostname.startswith('koji')
tags:
- nfs/client
- name: Nfs mount points (stg) production koji ro (rdu3)
mount: >
name=/mnt/fedora_koji_prod
src=ntap-rdu3-c02-fedora01-nfs01a.neta-002.prod.rdu2.dc.redhat.com:/fedora_koji
fstype=nfs
opts=ro,hard,bg,noatime,nodev,nosuid,nfsvers=3
passno=0
dump=0
state=mounted
when: datacenter == 'rdu3' and env == 'staging' and 'koji' in mnt_dir and '.s390.' not in inventory_hostname
tags:
- nfs/client