From 06bd8dfd92c39c6e6eacb6ae62e0b338a5139f88 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 4 Jun 2014 18:07:59 +0000 Subject: Reorg the nfs role to have client and server as subroles. --- playbooks/groups/buildhw.yml | 2 +- playbooks/groups/buildvm.yml | 2 +- playbooks/groups/download.yml | 2 +- playbooks/groups/wiki.yml | 4 +-- roles/nfs/client/files/route-eth1.phx2 | 1 + roles/nfs/client/files/route-eth1.rdu | 1 + roles/nfs/client/tasks/main.yml | 64 ++++++++++++++++++++++++++++++++++ roles/nfs_client/files/route-eth1.phx2 | 1 - roles/nfs_client/files/route-eth1.rdu | 1 - roles/nfs_client/tasks/main.yml | 64 ---------------------------------- 10 files changed, 71 insertions(+), 71 deletions(-) create mode 100644 roles/nfs/client/files/route-eth1.phx2 create mode 100644 roles/nfs/client/files/route-eth1.rdu create mode 100644 roles/nfs/client/tasks/main.yml delete mode 100644 roles/nfs_client/files/route-eth1.phx2 delete mode 100644 roles/nfs_client/files/route-eth1.rdu delete mode 100644 roles/nfs_client/tasks/main.yml diff --git a/playbooks/groups/buildhw.yml b/playbooks/groups/buildhw.yml index a7e7b6277..3e438aedb 100644 --- a/playbooks/groups/buildhw.yml +++ b/playbooks/groups/buildhw.yml @@ -14,7 +14,7 @@ roles: - base - - { role: nfs_client, when: inventory_hostname.startswith('build') , mnt_dir: '/mnt/fedora_koji', nfs_src_dir: 'fedora_koji' } + - { role: nfs/client, when: inventory_hostname.startswith('build') , mnt_dir: '/mnt/fedora_koji', nfs_src_dir: 'fedora_koji' } - koji_builder - { role: bkernel, when: inventory_hostname.startswith('bkernel') } diff --git a/playbooks/groups/buildvm.yml b/playbooks/groups/buildvm.yml index c52e201f2..b0f206ebc 100644 --- a/playbooks/groups/buildvm.yml +++ b/playbooks/groups/buildvm.yml @@ -33,7 +33,7 @@ roles: - base - - { role: nfs_client, when: not inventory_hostname.startswith('arm'), mnt_dir: '/mnt/fedora_koji', nfs_src_dir: 'fedora_koji' } + - { 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 bbe6ffe85..c51a6609a 100644 --- a/playbooks/groups/download.yml +++ b/playbooks/groups/download.yml @@ -56,7 +56,7 @@ - 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 == "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: diff --git a/playbooks/groups/wiki.yml b/playbooks/groups/wiki.yml index 7d8bc4300..5be804464 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: '/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' } + - { 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/nfs/client/files/route-eth1.phx2 b/roles/nfs/client/files/route-eth1.phx2 new file mode 100644 index 000000000..b94a496bf --- /dev/null +++ b/roles/nfs/client/files/route-eth1.phx2 @@ -0,0 +1 @@ +10.5.88.0/24 via 10.5.127.254 dev eth1 diff --git a/roles/nfs/client/files/route-eth1.rdu b/roles/nfs/client/files/route-eth1.rdu new file mode 100644 index 000000000..6a94e2007 --- /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 new file mode 100644 index 000000000..3bccd8e9d --- /dev/null +++ b/roles/nfs/client/tasks/main.yml @@ -0,0 +1,64 @@ +- name: route config for netapp network + copy: src=route-eth1.{{ datacenter }} dest=/etc/sysconfig/network-scripts/route-eth1 + when: datacenter == 'phx2' or datacenter == 'rdu2' + +- name: check for netapp route + command: ip route show + register: netapproute + always_run: yes + changed_when: "1 != 1" + +- 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 datacenter == 'phx2' + +- name: run netapp route if needed in rdu + command: /etc/sysconfig/network-scripts/ifup-routes eth1 + when: netapproute.stdout.find("172.31.1.0") == -1 and datacenter == 'rdu' + +# +# Install needed packages +# +- name: Install needed nfs packages + yum: pkg={{ item }} state=installed + with_items: + - nfs-utils + - rpcbind + +- name: enable nfs-related services and run them (fedora) + action: service name={{ item }} enabled=true state=started + with_items: + - nfs-idmap + - nfs-lock + when: ansible_distribution == 'Fedora' + +- 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: nfs mount points (phx2) + mount: > + 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' diff --git a/roles/nfs_client/files/route-eth1.phx2 b/roles/nfs_client/files/route-eth1.phx2 deleted file mode 100644 index b94a496bf..000000000 --- a/roles/nfs_client/files/route-eth1.phx2 +++ /dev/null @@ -1 +0,0 @@ -10.5.88.0/24 via 10.5.127.254 dev eth1 diff --git a/roles/nfs_client/files/route-eth1.rdu b/roles/nfs_client/files/route-eth1.rdu deleted file mode 100644 index 6a94e2007..000000000 --- a/roles/nfs_client/files/route-eth1.rdu +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 3bccd8e9d..000000000 --- a/roles/nfs_client/tasks/main.yml +++ /dev/null @@ -1,64 +0,0 @@ -- name: route config for netapp network - copy: src=route-eth1.{{ datacenter }} dest=/etc/sysconfig/network-scripts/route-eth1 - when: datacenter == 'phx2' or datacenter == 'rdu2' - -- name: check for netapp route - command: ip route show - register: netapproute - always_run: yes - changed_when: "1 != 1" - -- 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 datacenter == 'phx2' - -- name: run netapp route if needed in rdu - command: /etc/sysconfig/network-scripts/ifup-routes eth1 - when: netapproute.stdout.find("172.31.1.0") == -1 and datacenter == 'rdu' - -# -# Install needed packages -# -- name: Install needed nfs packages - yum: pkg={{ item }} state=installed - with_items: - - nfs-utils - - rpcbind - -- name: enable nfs-related services and run them (fedora) - action: service name={{ item }} enabled=true state=started - with_items: - - nfs-idmap - - nfs-lock - when: ansible_distribution == 'Fedora' - -- 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: nfs mount points (phx2) - mount: > - 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' -- cgit