diff --git a/playbooks/groups/buildhw.yml b/playbooks/groups/buildhw.yml index ccd72ed32e..b1509a48b3 100644 --- a/playbooks/groups/buildhw.yml +++ b/playbooks/groups/buildhw.yml @@ -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: diff --git a/playbooks/groups/buildvm.yml b/playbooks/groups/buildvm.yml index 63d74f823a..24d90ac467 100644 --- a/playbooks/groups/buildvm.yml +++ b/playbooks/groups/buildvm.yml @@ -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: diff --git a/playbooks/groups/download.yml b/playbooks/groups/download.yml index ef191f8517..8bfd706d77 100644 --- a/playbooks/groups/download.yml +++ b/playbooks/groups/download.yml @@ -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" diff --git a/playbooks/groups/wiki.yml b/playbooks/groups/wiki.yml index 2bd982508f..4ccc33fb31 100644 --- a/playbooks/groups/wiki.yml +++ b/playbooks/groups/wiki.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: diff --git a/roles/download/tasks/main.yml b/roles/download/tasks/main.yml index 06aea2cfde..2c834d11c0 100644 --- a/roles/download/tasks/main.yml +++ b/roles/download/tasks/main.yml @@ -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 diff --git a/roles/koji_builder/tasks/main.yml b/roles/koji_builder/tasks/main.yml index 443a9c6e15..4299a32d4c 100644 --- a/roles/koji_builder/tasks/main.yml +++ b/roles/koji_builder/tasks/main.yml @@ -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' diff --git a/roles/nfs_client/files/route-eth1 b/roles/nfs_client/files/route-eth1.phx2 similarity index 100% rename from roles/nfs_client/files/route-eth1 rename to roles/nfs_client/files/route-eth1.phx2 diff --git a/roles/nfs_client/files/route-eth1.rdu b/roles/nfs_client/files/route-eth1.rdu new file mode 100644 index 0000000000..6a94e20075 --- /dev/null +++ b/roles/nfs_client/files/route-eth1.rdu @@ -0,0 +1 @@ +10.11.254.0/24 via 10.11.29.254 dev eth1 diff --git a/roles/nfs_client/tasks/main.yml b/roles/nfs_client/tasks/main.yml index 10712880f9..be3841cdc5 100644 --- a/roles/nfs_client/tasks/main.yml +++ b/roles/nfs_client/tasks/main.yml @@ -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'