Files
fedora-infra_ansible/roles/nfs/client/tasks/main.yml
Kevin Fenzi f9c8e842b7 download / rdu3: add rdu3 download servers
This will allow us to test ro mounts from the rdu3 netapp.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-06-16 14:02:36 -07:00

119 lines
3.3 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 (iad2)
mount: >
name={{ mnt_dir }}
src=ntap-iad2-c02-fedora01-nfs01a:/{{ nfs_src_dir }}
fstype=nfs
opts={{nfs_mount_opts}}
passno=0
dump=0
state=mounted
when: ( datacenter == 'iad2' or datacenter == 'staging' ) and (env != 'staging' or mount_stg is defined)
tags:
- nfs/client
- name: Nfs mount points (rdu3)
mount: >
name={{ mnt_dir }}
src=ntap-rdu3-c02-fedora01-nfs01a:/{{ 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
mount: >
name=/mnt/fedora_koji
src=10.3.167.64:/mnt/fedora_koji
fstype=nfs4
opts=rw,hard,bg,intr,noatime,nodev,nosuid,nfsvers=4
passno=0
dump=0
state=mounted
when: 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
mount: >
name=/mnt/fedora_koji_prod
src=ntap-iad2-c02-fedora01-nfs01a:/fedora_koji
fstype=nfs
opts=ro,hard,bg,intr,noatime,nodev,nosuid,nfsvers=3
passno=0
dump=0
state=mounted
when: env == 'staging' and 'koji' in mnt_dir and '.s390.' not in inventory_hostname
tags:
- nfs/client