diff --git a/playbooks/ansible/roles/sit.gpfs/tasks/main.yml b/playbooks/ansible/roles/sit.gpfs/tasks/main.yml index 264b0e78..29c45607 100644 --- a/playbooks/ansible/roles/sit.gpfs/tasks/main.yml +++ b/playbooks/ansible/roles/sit.gpfs/tasks/main.yml @@ -75,8 +75,54 @@ - name: Define block size and mountpoint command: "{{ gpfs_toolkit }} filesystem modify -B 128K -m /gpfs/sit_fs sit_fs" + - name: Configure SMB protocol + when: config.be.variant == 'scale' + block: + - name: Define protocol nodes + command: "{{ gpfs_toolkit }} node add {{ item }} -p" + loop: "{{ config.groups['cluster'] }}" + + - name: Enable SMB protocol + command: "{{ gpfs_toolkit }} enable smb" + + - name: Configure shared directory + command: >- + {{ gpfs_toolkit }} config protocols -f sit_fs -m /gpfs/sit_fs + -e {{ + config.nodes | + dict2items | + selectattr('value.ctdb.public', 'defined') | + map(attribute='value.ctdb.public') | + join(',') + }} + - name: Install on all nodes command: "{{ gpfs_toolkit }} install" - name: Create admin user for GUI command: /usr/lpp/mmfs/gui/cli/mkuser admin -p admin123 -g SecurityAdmin + + - name: Configure SMB shares + when: config.be.variant == 'scale' + block: + - name: Deploy protocols + command: "{{ gpfs_toolkit }} deploy" + + - name: Configure authentication + command: /usr/lpp/mmfs/bin/mmuserauth service create --data-access-method file --type userdefined + + - name: Create shares + vars: + name: "{{ item.name }}" + path: "{{ config.paths.mount }}/{{ item.name }}" + volume: "{{ item }}" + include_tasks: + file: new_volume.yml + loop: "{{ samba_shares }}" + + - name: Configure shares + command: >- + /usr/lpp/mmfs/bin/mmsmb export add + {{ item.name }}-{{ config.be.name }}-{{ config.be.variant }} + /gpfs/sit_fs/{{ item.name }} + loop: "{{ samba_shares }}" diff --git a/playbooks/roles/local.defaults/tasks/main.yml b/playbooks/roles/local.defaults/tasks/main.yml index 68c5d1f3..7de4e3fe 100644 --- a/playbooks/roles/local.defaults/tasks/main.yml +++ b/playbooks/roles/local.defaults/tasks/main.yml @@ -12,6 +12,10 @@ - name: Generate configuration when: not config_yml.stat.exists + vars: + os: "{{ use_distro | default('centos9') }}" + be: "{{ (backend | default('xfs') | split('.'))[0] }}" + variant: "{{ (backend | default('xfs') | split('.'))[1] | default('default') }}" block: - name: Load global settings include_vars: @@ -47,9 +51,6 @@ src: config.yml.j2 dest: ./ansible/config.yml vars: - os: "{{ use_distro | default('centos9') }}" - be: "{{ (backend | default('xfs') | split('.'))[0] }}" - variant: "{{ (backend | default('xfs') | split('.'))[1] | default('default') }}" max_memory: "{{ ansible_memfree_mb }}" max_cpu: "{{ ansible_processor_nproc }}" diff --git a/playbooks/settings.yml b/playbooks/settings.yml index ae1a3e02..51aff4b9 100644 --- a/playbooks/settings.yml +++ b/playbooks/settings.yml @@ -359,6 +359,7 @@ environments: cpus: 2 memory: 1024 domain: sit.test + samba: "{{ variant != 'scale' }}" data: # A zip file is necessary to install GPFS but it's not included with