diff --git a/ansible/ceph-client.yml b/ansible/ceph-client.yml index 6d4253e..5796b97 100644 --- a/ansible/ceph-client.yml +++ b/ansible/ceph-client.yml @@ -10,7 +10,7 @@ # This playbook applies site config for Ceph client support, # in particular CephFS home directories - hosts: cluster_ceph_client - remote_user: centos + remote_user: "{{ cluster_guest }}" become: yes roles: - role: ceph_setup diff --git a/ansible/generic.yml b/ansible/generic.yml index aaa0a9e..d418db4 100644 --- a/ansible/generic.yml +++ b/ansible/generic.yml @@ -8,7 +8,7 @@ # This playbook applies site config for Ceph support, # in particular CephFS home directories - hosts: cluster - remote_user: centos + remote_user: "{{ cluster_guest }}" become: yes roles: - role: cluster_setup @@ -24,7 +24,7 @@ # if required. Generate an RSA public key and configure as # an OpenStack-aware login node. - hosts: control - remote_user: centos + remote_user: "{{ cluster_guest }}" become: yes roles: - role: user_setup @@ -32,7 +32,7 @@ homedir: "{{ alaska_homedir }}" - hosts: compute - remote_user: centos + remote_user: "{{ cluster_guest }}" become: yes roles: - role: user_propagate diff --git a/ansible/group_vars/all b/ansible/group_vars/all index b636d0a..6d00d6b 100644 --- a/ansible/group_vars/all +++ b/ansible/group_vars/all @@ -4,6 +4,9 @@ cluster_name: stack cluster_groups: [] cluster_roles: [] +# Cloud guest user used for Ansible access and password-less sudo. +cluster_guest: centos + # This keypair should exist in OpenStack. It will be assigned # for the cloud user for the next phase of deployment. cluster_keypair: rsa_keypair diff --git a/ansible/openhpc.yml b/ansible/openhpc.yml index a259128..f0c04b0 100644 --- a/ansible/openhpc.yml +++ b/ansible/openhpc.yml @@ -4,19 +4,19 @@ - include: users.yml - hosts: cluster_login - remote_user: centos + remote_user: "{{ cluster_guest }}" become: yes roles: - role: openhpc_control - hosts: cluster_batch - remote_user: centos + remote_user: "{{ cluster_guest }}" become: yes roles: - role: openhpc_compute - hosts: cluster - remote_user: centos + remote_user: "{{ cluster_guest }}" become: yes roles: - role: openhpc_runtime diff --git a/ansible/orangefs.yml b/ansible/orangefs.yml new file mode 100644 index 0000000..ce4fede --- /dev/null +++ b/ansible/orangefs.yml @@ -0,0 +1,17 @@ +--- +- include: setup.yml + +- hosts: orange_meta + remote_user: "{{ cluster_guest }}" + become: yes + tasks: + - name: Ensure the /scratch filesystem is present on Metadata servers + become: yes + file: path=/scratch state=directory + +- hosts: cluster + remote_user: "{{ cluster_guest }}" + become: yes + roles: + - role: orange_setup + - role: orangefs diff --git a/ansible/roles/cluster_setup/tasks/time.yml b/ansible/roles/cluster_setup/tasks/time.yml index 80e37bc..f3e2ac7 100644 --- a/ansible/roles/cluster_setup/tasks/time.yml +++ b/ansible/roles/cluster_setup/tasks/time.yml @@ -4,10 +4,15 @@ name: Europe/London - name: Ensure NTP packages are installed - yum: + package: name: ntp state: present +- name: Ensure SELinux python bindings are installed + package: + name: libselinux-python + state: present + - name: Apply Site NTP configuration copy: src: ntp.conf diff --git a/ansible/roles/orange_setup/files/orangefs-2.9.7-1.fc25.x86_64.rpm b/ansible/roles/orange_setup/files/orangefs-2.9.7-1.fc25.x86_64.rpm new file mode 100644 index 0000000..66e57a0 Binary files /dev/null and b/ansible/roles/orange_setup/files/orangefs-2.9.7-1.fc25.x86_64.rpm differ diff --git a/ansible/roles/orange_setup/files/orangefs-debuginfo-2.9.7-1.fc25.x86_64.rpm b/ansible/roles/orange_setup/files/orangefs-debuginfo-2.9.7-1.fc25.x86_64.rpm new file mode 100644 index 0000000..d3bba16 Binary files /dev/null and b/ansible/roles/orange_setup/files/orangefs-debuginfo-2.9.7-1.fc25.x86_64.rpm differ diff --git a/ansible/roles/orange_setup/files/orangefs-devel-2.9.7-1.fc25.x86_64.rpm b/ansible/roles/orange_setup/files/orangefs-devel-2.9.7-1.fc25.x86_64.rpm new file mode 100644 index 0000000..b71c160 Binary files /dev/null and b/ansible/roles/orange_setup/files/orangefs-devel-2.9.7-1.fc25.x86_64.rpm differ diff --git a/ansible/roles/orange_setup/files/orangefs-server-2.9.7-1.fc25.x86_64.rpm b/ansible/roles/orange_setup/files/orangefs-server-2.9.7-1.fc25.x86_64.rpm new file mode 100644 index 0000000..10ea320 Binary files /dev/null and b/ansible/roles/orange_setup/files/orangefs-server-2.9.7-1.fc25.x86_64.rpm differ diff --git a/ansible/roles/orange_setup/files/orangefs_client.service b/ansible/roles/orange_setup/files/orangefs_client.service new file mode 100644 index 0000000..eb716bf --- /dev/null +++ b/ansible/roles/orange_setup/files/orangefs_client.service @@ -0,0 +1,10 @@ +[Unit] +Description=OrangeFS Parallel File System Client +After=network.target + +[Service] +Type=forking +ExecStart=/usr/sbin/pvfs2-client -p /usr/sbin/pvfs2-client-core + +[Install] +WantedBy=multi-user.target diff --git a/ansible/roles/orange_setup/tasks/main.yml b/ansible/roles/orange_setup/tasks/main.yml new file mode 100644 index 0000000..2a58fd4 --- /dev/null +++ b/ansible/roles/orange_setup/tasks/main.yml @@ -0,0 +1,29 @@ +--- +- name: copy rpms to server + copy: src={{ item.src }} dest={{ item.dest }} + with_items: + - { src: '{{ role_path }}/files/orangefs-2.9.7-1.fc25.x86_64.rpm', + dest: '/tmp/orangefs-2.9.7-1.fc25.x86_64.rpm' } + - { src: '{{ role_path }}/files/orangefs-server-2.9.7-1.fc25.x86_64.rpm', + dest: '/tmp/orangefs-server-2.9.7-1.fc25.x86_64.rpm' } + +- name: copy unit file for client + copy: src={{ item.src }} dest={{ item.dest }} + with_items: + - { src: '{{ role_path }}/files/orangefs_client.service', + dest: '/usr/lib/systemd/system/' } + become: yes + when: inventory_hostname in groups['orange_client'] + +- name: orange dependencys + dnf: + name: perl-Math-BigInt + state: present + +- name: install orangefs packages + dnf: + name: "{{ item }}" + state: present + with_items: + - /tmp/orangefs-2.9.7-1.fc25.x86_64.rpm + - /tmp/orangefs-server-2.9.7-1.fc25.x86_64.rpm diff --git a/ansible/roles/orangefs/tasks/main.yml b/ansible/roles/orangefs/tasks/main.yml new file mode 100644 index 0000000..c27aed8 --- /dev/null +++ b/ansible/roles/orangefs/tasks/main.yml @@ -0,0 +1,89 @@ +--- +# Generate the configuration file on one server and then distribute globally. +# If we don't do this, pvfs2-genconfig will not apply our config changes to /etc/pvfs2.conf... +- name: Generate a PVFS2 configuration file + block: + - name: Ensure PVFS2 config file is not present + file: + path: /etc/pvfs2.conf + state: absent + - name: Generate a sample config file + command: pvfs2-genconfig --quiet --protocol tcp --ioservers "{{ groups['orange_data'] | join(',') }}" --metaservers "{{ groups['orange_data'] |join(',') }}" --storage /export/orangefs /etc/pvfs2.conf + args: + creates: /etc/pvfs2.conf + - name: Update DataStorageSpace setting + lineinfile: + path: /etc/pvfs2.conf + regexp: 'DataStorageSpace .*$' + line: ' DataStorageSpace /export/orangefs/data' + insertbefore: '^' + - name: Update MetadataStorageSpace setting + lineinfile: + path: /etc/pvfs2.conf + regexp: 'MetadataStorageSpace .*$' + line: ' MetadataStorageSpace /export/orangefs/meta' + insertbefore: '^' + - name: Retrieve generated PVFS2 config + fetch: + dest: "{{ playbook_dir }}/pvfs2.conf.tmp" + src: /etc/pvfs2.conf + fail_on_missing: yes + flat: yes + run_once: true + +- name: Copy out the PVFS2 config + copy: + src: pvfs2.conf.tmp + dest: /etc/pvfs2.conf + mode: 0644 + owner: root + group: root + force: yes + +- name: Remove temporary PVFS2 config file + local_action: + module: file + path: "{{ playbook_dir }}/pvfs2.conf.tmp" + state: absent + become: false + run_once: true + +- name: probe the orangefs module + modprobe: + name: orangefs + state: present + +- name: Setup for data servers + block: + - name: Obliterate previous filesystem local data + file: + path: "{{ item }}" + state: absent + with_items: + - /export/orangefs/data + - /export/orangefs/meta + - name: Format PVFS2 storage + command: pvfs2-server -f -a "{{ inventory_hostname }}" /etc/pvfs2.conf creates=/export/orangefs/data + - name: Start PVFS2 server + systemd: + name: orangefs + enabled: yes + state: restarted + when: inventory_hostname in groups['orange_data'] + +- name: Start PVFS2 client + systemd: + name: orangefs_client + enabled: yes + state: restarted + when: inventory_hostname in groups['orange_client'] + +- name: create mountpoint scratch + file: + path: /scratch + state: directory + when: inventory_hostname in groups['orange_client'] + +- name: run the mount comand + command: "mount -t pvfs2 tcp://{{ groups['orange_data'] | first }}:3334/orangefs /scratch" + when: inventory_hostname in groups['orange_client'] diff --git a/ansible/roles/user_setup/tasks/keystone.yml b/ansible/roles/user_setup/tasks/keystone.yml index bc961c4..f1b25ef 100644 --- a/ansible/roles/user_setup/tasks/keystone.yml +++ b/ansible/roles/user_setup/tasks/keystone.yml @@ -1,6 +1,6 @@ --- - name: Ensure that Keystone user auth packages are installed - yum: + package: name: "{{item}}" state: present with_items: diff --git a/ansible/setup.yml b/ansible/setup.yml index d09fc25..5704f19 100644 --- a/ansible/setup.yml +++ b/ansible/setup.yml @@ -9,7 +9,7 @@ # Apply generic setup configuration that is universally useful - hosts: cluster - remote_user: centos + remote_user: "{{ cluster_guest }}" become: yes roles: - role: cluster_setup diff --git a/ansible/users.yml b/ansible/users.yml index e1199a6..cda2445 100644 --- a/ansible/users.yml +++ b/ansible/users.yml @@ -3,7 +3,7 @@ # if required. Generate an RSA public key and configure as # an OpenStack-aware login node. - hosts: cluster_login - remote_user: centos + remote_user: "{{ cluster_guest }}" become: yes roles: - role: user_setup @@ -11,7 +11,7 @@ homedir: "{{ alaska_homedir }}" - hosts: cluster_batch - remote_user: centos + remote_user: "{{ cluster_guest }}" become: yes roles: - role: user_propagate diff --git a/config/orangefs.yml b/config/orangefs.yml index 7017c6d..962f089 100644 --- a/config/orangefs.yml +++ b/config/orangefs.yml @@ -1,6 +1,15 @@ --- cluster_name: orange cluster_keypair: ilab_sclt100 + +# We are using Fedora images for this deployment: +# We need to use the Fedora cloud image guest user +cluster_guest: "fedora" + +# Site-specific network configuration. +cluster_net: + - { net: "ilab", subnet: "ilab" } + cluster_groups: - "{{ orangefs_meta }}" - "{{ orangefs_data }}" @@ -24,3 +33,4 @@ orangefs_client: image: "FedoraCore" num_nodes: 4 +cluster_roles: []