mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
Make everything doing nfs mounts use the nfs_client role.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
roles:
|
||||
- base
|
||||
- { role: nfs_client, when: not inventory_hostname.startswith('arm'), mnt_dir: '/mnt/fedora_koji', nfs_src_dir: 'fedora_koji' }
|
||||
- koji_builder
|
||||
|
||||
tasks:
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
roles:
|
||||
- base
|
||||
- { role: nfs_client, when: not inventory_hostname.startswith('arm'), mnt_dir: '/mnt/fedora_koji', nfs_src_dir: 'fedora_koji' }
|
||||
- koji_builder
|
||||
|
||||
tasks:
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
- download
|
||||
- mod_limitipconn
|
||||
- rsyncd
|
||||
- { role: nfs_client, when: datacenter == "phx2", mnt_dir: '/srv/pub', nfs_src_dir: 'fedora_ftp/fedora.redhat.com/pub' }
|
||||
- { role: nfs_client, when: datacenter == "rdu", mnt_dir: '/srv/pub', nfs_src_dir: 'fedora_ftp/fedora.redhat.com/pub' }
|
||||
|
||||
tasks:
|
||||
- include: "{{ tasks }}/hosts.yml"
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
- fas_client
|
||||
- collectd/base
|
||||
- fedmsg/base
|
||||
- { role: nfs_client, when: env == "staging", mnt_dir: '/web/attachments', nfs_src_dir: 'fedora_app_staging/app/attachments' }
|
||||
- { role: nfs_client, when: env != "staging", mnt_dir: '/web/attachments', nfs_src_dir: 'fedora_app/app/attachments' }
|
||||
- { role: nfs_client, when: env == "staging", mnt_dir: '/mnt/web/attachments', nfs_src_dir: 'fedora_app_staging/app/attachments' }
|
||||
- { role: nfs_client, when: env != "staging", mnt_dir: '/mnt/web/attachments', nfs_src_dir: 'fedora_app/app/attachments' }
|
||||
- mediawiki
|
||||
|
||||
tasks:
|
||||
|
||||
@@ -31,17 +31,9 @@
|
||||
- name: Configure logrotate for /var/log/rsyncd-fedora.log
|
||||
copy: src=logrotate-rsync-fedora dest=/etc/logrotate.d/rsync-fedora
|
||||
|
||||
- name: NFS mount points (phx2)
|
||||
mount: name=/srv/pub src=vtap-fedora-nfs01.storage.phx2.redhat.com:/vol/fedora_ftp/fedora.redhat.com/pub fstype=nfs opts=defaults,fsc,ro,noatime,nodev,nosuid,hard,intr,nfsvers=3,nocto,actimeo=600 state=mounted
|
||||
when: datacenter == 'phx2'
|
||||
|
||||
- name: /srv/pub file contexts
|
||||
command: semanage fcontext -a -t httpd_sys_content_t "/srv/pub(/.*)?"
|
||||
|
||||
- name: NFS mount points (rdu)
|
||||
mount: name=/srv/pub src=172.31.1.10:/vol/fedora_ftp/fedora.redhat.com/pub fstype=nfs opts=defaults,ro,noatime,nodev,nosuid,hard,intr,nfsvers=3 state=mounted
|
||||
when: datacenter == 'rdu'
|
||||
|
||||
- name: Copy wildcard cert from puppet private
|
||||
copy: src="{{puppet_private}}/httpd/wildcard-2014.fedoraproject.org.cert" dest=/etc/pki/tls/wildcard-2014.fedoraproject.org.cert owner=root group=root mode=0600
|
||||
|
||||
|
||||
@@ -39,11 +39,6 @@
|
||||
- name: add builder infra yum repo
|
||||
copy: src=builder-infrastructure.repo dest=/etc/yum.repos.d/builder-infrastructure.repo
|
||||
|
||||
#- name: clean up packages we do not need
|
||||
# yum: state=removed pkg={{ item }}
|
||||
# with_items:
|
||||
# - 'cronie\*'
|
||||
|
||||
- name: add pkgs
|
||||
yum: state=installed pkg={{ item }}
|
||||
with_items:
|
||||
@@ -51,7 +46,6 @@
|
||||
- koji-builder
|
||||
- strace
|
||||
- mock
|
||||
- nfs-utils
|
||||
- kernel-firmware
|
||||
- ntp
|
||||
- ntpdate
|
||||
@@ -121,23 +115,6 @@
|
||||
tags:
|
||||
- configs
|
||||
|
||||
- name: route config for netapp network
|
||||
copy: src=route-eth1 dest=/etc/sysconfig/network-scripts/route-eth1
|
||||
|
||||
- name: check for netapp route
|
||||
command: ip route show
|
||||
register: netapproute
|
||||
always_run: yes
|
||||
changed_when: "1 != 1"
|
||||
|
||||
- name: run netapp route
|
||||
command: /etc/sysconfig/network-scripts/ifup-routes eth1
|
||||
when: netapproute.stdout.find("10.5.88.0") == -1 and not inventory_hostname.startswith('arm')
|
||||
|
||||
- name: nfs mount points
|
||||
mount: name=/mnt/fedora_koji src=vtap-fedora-nfs01.storage.phx2.redhat.com:/vol/fedora_koji fstype=nfs opts=ro,hard,bg,intr,noatime,nodev,nosuid passno=0 dump=0 state=mounted
|
||||
when: inventory_hostname.startswith('build')
|
||||
|
||||
- name: make a mnt/koji link
|
||||
file: state=link src=/mnt/fedora_koji/koji dest=/mnt/koji
|
||||
when: inventory_hostname.startswith('build')
|
||||
@@ -195,21 +172,3 @@
|
||||
with_items:
|
||||
- kmod-hfsplus
|
||||
when: is_rhel is defined and ansible_architecture == 'x86_64'
|
||||
|
||||
- name: enable services and start them on Fedora systems
|
||||
service: name={{ item }} enabled=true state=started
|
||||
with_items:
|
||||
- ntpd
|
||||
- nfs-lock
|
||||
- nfs-idmap
|
||||
- nfs-mountd
|
||||
when: ansible_distribution == 'Fedora'
|
||||
|
||||
- name: enable services and start them on RHEL systems
|
||||
service: name={{ item }} enabled=true state=started
|
||||
with_items:
|
||||
- rpcbind
|
||||
- ntpd
|
||||
- nfslock
|
||||
- nfs
|
||||
when: ansible_distribution == 'RedHat'
|
||||
|
||||
1
roles/nfs_client/files/route-eth1.rdu
Normal file
1
roles/nfs_client/files/route-eth1.rdu
Normal file
@@ -0,0 +1 @@
|
||||
10.11.254.0/24 via 10.11.29.254 dev eth1
|
||||
@@ -1,5 +1,5 @@
|
||||
- name: route config for netapp network
|
||||
copy: src=route-eth1 dest=/etc/sysconfig/network-scripts/route-eth1
|
||||
copy: src=route-eth1.{{ datacenter }} dest=/etc/sysconfig/network-scripts/route-eth1
|
||||
|
||||
- name: check for netapp route
|
||||
command: ip route show
|
||||
@@ -7,28 +7,53 @@
|
||||
always_run: yes
|
||||
changed_when: "1 != 1"
|
||||
|
||||
- name: run netapp route
|
||||
- name: run netapp route if needed in phx2
|
||||
command: /etc/sysconfig/network-scripts/ifup-routes eth1
|
||||
when: netapproute.stdout.find("10.5.88.0") == -1 and not inventory_hostname.startswith('arm')
|
||||
when: netapproute.stdout.find("10.5.88.0") == -1 and not inventory_hostname.startswith('arm') and datacenter is phx2
|
||||
|
||||
- name: install nfs-utils
|
||||
yum: pkg=nfs-utils state=installed
|
||||
#
|
||||
# Install needed packages
|
||||
#
|
||||
- name: Install needed nfs packages
|
||||
yum: pkg={{ item }} state=installed
|
||||
with_items:
|
||||
- nfs-utils
|
||||
- rpcbind
|
||||
|
||||
- name: install rpcbind
|
||||
yum: pkg=rpcbind state=installed
|
||||
- name: enable nfs-related services and run them (fedora)
|
||||
action: service name={{ item }} enabled=true state=started
|
||||
with_items:
|
||||
- nfs-idmapd
|
||||
- nfs-lock
|
||||
when: ansible_distribution == 'Fedora'
|
||||
|
||||
- name: start rpcbind
|
||||
service: name=rpcbind state=started enabled=yes
|
||||
- name: enable nfs-related services and run them (rhel)
|
||||
action: service name={{ item }} enabled=true state=started
|
||||
with_items:
|
||||
- rpcidmapd
|
||||
- rpcbind
|
||||
- nfs
|
||||
- nfslock
|
||||
when: ansible_distribution == 'RedHat'
|
||||
|
||||
- name: start nfslock
|
||||
service: name=nfslock state=started enabled=yes
|
||||
|
||||
- name: nfs mount points
|
||||
- name: nfs mount points (phx2)
|
||||
mount: >
|
||||
name=/mnt/{{ mnt_dir }}
|
||||
name=/{{ mnt_dir }}
|
||||
src=vtap-fedora-nfs01.storage.phx2.redhat.com:/vol/{{ nfs_src_dir }}
|
||||
fstype=nfs
|
||||
opts={{nfs_mount_opts}}
|
||||
passno=0
|
||||
dump=0
|
||||
state=mounted
|
||||
when: datacenter == 'phx2'
|
||||
|
||||
- name: nfs mount points (rdu)
|
||||
mount: >
|
||||
name=/{{ mnt_dir }}
|
||||
src=172.31.1.10:/vol/{{ nfs_src_dir }}
|
||||
fstype=nfs
|
||||
opts={{nfs_mount_opts}}
|
||||
passno=0
|
||||
dump=0
|
||||
state=mounted
|
||||
when: datacenter == 'rdu'
|
||||
|
||||
Reference in New Issue
Block a user