-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #811 from jayeshh123/jay_afm_new_var
Changes for AFM
- Loading branch information
Showing
16 changed files
with
326 additions
and
13 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
# Default variables for the IBM Spectrum Scale AFM Cos Configure role - | ||
## Spectrum Scale daemon nodename (defaults to node's hostname) | ||
scale_daemon_nodename: "{{ ansible_hostname }}" | ||
|
||
#"scale_afm_cos_bucket_params": [ | ||
# { | ||
# "bucket": "test", | ||
# "akey": "xxxxxxxx", | ||
# "skey": "xxxxxxxx", | ||
# }, | ||
# { | ||
# "bucket": "test1", | ||
# "akey": "xxxxxxxxx", | ||
# "skey": "xxxxxxxxx", | ||
# }, | ||
#] | ||
|
||
#"scale_afm_cos_filesets_params": [ | ||
# { | ||
# "filesystem": "fs1", | ||
# "fileset": "afmfileset1", | ||
# "endpoint": "https://s3.ap.cos.appdomain.cloud:443/bucket-afm1", | ||
# "bucket": "bucket-afm1", | ||
# "mode": "SW", | ||
# }, | ||
# { | ||
# "filesystem": "fs1", | ||
# "fileset": "afmfileset2", | ||
# "endpoint": "https://s3.ap.cos.appdomain.cloud:443/bucket-afm2", | ||
# "bucket": "bucket-afm2", | ||
# "mode": "SW" | ||
# } | ||
#] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# handlers file for configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
galaxy_info: | ||
author: IBM Corporation | ||
description: Role for configuring IBM Spectrum Scale AFM COS configuration role | ||
company: IBM | ||
|
||
license: Apache-2.0 | ||
|
||
min_ansible_version: 2.9 | ||
|
||
platforms: | ||
- name: EL | ||
versions: | ||
- 7 | ||
- 8 | ||
- 9 | ||
|
||
galaxy_tags: [] | ||
|
||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
- block: | ||
- name: create | Initialize | ||
set_fact: | ||
extra_option_flag: "" | ||
|
||
- name: create | Set existing bucket if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }}{{ item.bucket }}" | ||
when: | ||
- item.bucket is defined | ||
- name: create | Set existing bucket if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }}:{{ item.Region}}" | ||
when: | ||
- item.Region is defined | ||
|
||
- name: create | Set existing bucket if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }}@{{ item.Server}}" | ||
when: | ||
- item.Server is defined | ||
|
||
- name: configure | Set the access key and secret key for new/existing bucket as below at gateway node | ||
command: "{{ scale_command_path }}mmafmcoskeys {{ extra_option_flag }} set {{ item.akey }} {{ item.skey }}" | ||
register: scale_afm_cos_define | ||
failed_when: scale_afm_cos_define.rc != 0 | ||
when: | ||
- item.bucket is defined | ||
- item.akey is defined | ||
- item.skey is defined | ||
|
||
- name: configure | Set the access key and secret key for new/existing bucket as below at gateway node | ||
command: "{{ scale_command_path }}mmafmcoskeys {{ item.bucket }}:{{ item.Region }}@{{ item.Server }} set --keyfile {{ item.KeyfilePath }}" | ||
register: scale_afm_cos_define | ||
failed_when: scale_afm_cos_define.rc != 0 | ||
when: | ||
- item.bucket is defined | ||
- item.Region is defined | ||
- item.Server is defined | ||
- item.KeyfilePath is defined | ||
|
||
- name: configure | FM cos bucket configuration | ||
debug: | ||
msg: AFM cos bucket configured. | ||
rescue: | ||
- name: Failure detected in Configuring AFM cos bucket | ||
fail: | ||
msg: "I caught an error, Please take a look to the output given!." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
- block: | ||
- name: create | Find existing AFM cos enabled Filesystem | ||
shell: mmlsfileset {{ item.filesystem }} {{ item.fileset }} --afm -Y | grep -v HEADER | cut -d ':' -f 20 | uniq | ||
register: scale_existing_afmcos | ||
changed_when: false | ||
failed_when: false | ||
when: | ||
- item.filesystem is defined | ||
- item.fileset is defined | ||
|
||
- name: create | Find existing Bucket(s) | ||
shell: mmafmcoskeys all get --report | tail -n +2 | cut -d '=' -f 1 | uniq | ||
register: scale_existing_bucket | ||
changed_when: false | ||
failed_when: false | ||
|
||
- debug: | ||
msg: "{{scale_existing_bucket.stdout_lines}}" | ||
changed_when: false | ||
failed_when: false | ||
when: | ||
- scale_existing_bucket.stdout_lines is defined | ||
|
||
- name: create | Initialize | ||
set_fact: | ||
extra_option_flag: "" | ||
|
||
- name: create | Set existing bucket if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }} --bucket {{ item.bucket }}" | ||
when: | ||
- item.bucket in scale_existing_bucket.stdout_lines | ||
- item.bucket is defined | ||
|
||
- name: create | Set new bucket if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }} --new-bucket {{ item.bucket }}" | ||
when: | ||
- item.bucket not in scale_existing_bucket.stdout_lines | ||
- item.bucket is defined | ||
|
||
- name: create | Set mode if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }} --mode {{ item.mode | default('sw') }}" | ||
|
||
- name: configure | Create a AFM cos relationship with filesets | ||
command: "{{ scale_command_path }}mmafmcosconfig {{ item.filesystem }} {{ item.fileset }} --endpoint {{ item.endpoint }} {{ extra_option_flag }} --object-fs --xattr --acls" | ||
register: scale_afm_cos_define | ||
failed_when: scale_afm_cos_define.rc != 0 | ||
when: | ||
- not "enabled" in scale_existing_afmcos.stdout_lines | ||
- item.filesystem is defined | ||
- item.fileset is defined | ||
|
||
- name: configure | Add Number of Gateway Flush Threads for AFM filsets | ||
command: "mmchfileset {{ item.filesystem }} {{ item.fileset }} -p afmNumFlushThreads=8" | ||
failed_when: scale_afm_cos_define.rc != 0 | ||
run_once: true | ||
when: | ||
- not "enabled" in scale_existing_afmcos.stdout_lines | ||
- item.filesystem is defined | ||
- item.fileset is defined | ||
|
||
- name: Update permissions for AFM COS filesets | ||
shell: > | ||
find {{ scale_storage[0].defaultMountPoint }}/{{ item.fileset }} -type d ! -path '{{ scale_storage[0].defaultMountPoint }}/{{ item.fileset }}/.snapshots' -exec chmod 777 {} + | ||
failed_when: scale_afm_cos_define.rc != 0 | ||
ignore_errors: yes | ||
run_once: true | ||
when: | ||
- not "enabled" in scale_existing_afmcos.stdout_lines | ||
- item.filesystem is defined | ||
- item.fileset is defined | ||
|
||
- debug: | ||
msg: "{{scale_afm_cos_define}}" | ||
|
||
- name: configure | Create a AFM cos default configuration with filesets | ||
command: "{{ scale_command_path }}mmchfileset {{ item.filesystem }} {{ item.fileset }} -p afmdirlookuprefreshinterval=default -p afmfilelookuprefreshinterval=default -p afmfileopenrefreshinterval=default -p afmdiropenrefreshinterval=default -p afmSkipHomeRefresh=no" | ||
register: scale_afm_cos_config_define | ||
failed_when: false | ||
when: | ||
- not "enabled" in scale_existing_afmcos.stdout_lines | ||
- item.filesystem is defined | ||
- item.fileset is defined | ||
|
||
- debug: | ||
msg: "{{scale_afm_cos_config_define}}" | ||
|
||
- name: configure | FM cos configuration | ||
debug: | ||
msg: AFM cos configured. | ||
rescue: | ||
- name: Failure detected in Configuring AFM cos | ||
fail: | ||
msg: "I caught an error, Please take a look to the output given!." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
- name: configure | Initialize lists | ||
set_fact: | ||
scale_gateway_nodes: [] | ||
|
||
- name: cluster | Find gateway nodes | ||
add_host: | ||
name: "{{ item }}" | ||
groups: scale_gateway_nodes | ||
when: hostvars[item].scale_cluster_gateway | bool | ||
with_items: "{{ ansible_play_hosts }}" | ||
changed_when: false | ||
|
||
- name: configure | Setting server licenses on AFM gateway nodes | ||
vars: | ||
scale_gateway_node: "{{ groups['scale_gateway_nodes'] | list }}" | ||
command: "{{ scale_command_path }}mmchlicense server --accept -N {{ scale_gateway_node | join(',') }}" | ||
when: groups['scale_gateway_nodes'] | list | length > 0 | ||
run_once: true | ||
|
||
- name: configure | Enabling AFM gateway | ||
vars: | ||
scale_gateway_node: "{{ groups['scale_gateway_nodes'] | list }}" | ||
command: "{{ scale_command_path }}mmchnode -N {{ scale_gateway_node | join(',') }} --gateway" | ||
when: groups['scale_gateway_nodes'] | list | length > 0 | ||
register: result_gateway | ||
run_once: true | ||
|
||
- debug: | ||
msg: "{{ result_gateway.cmd }}" | ||
when: result_gateway.cmd is defined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
- name: configure | Initialize lists of AFM Nodes | ||
set_fact: | ||
scale_gateway_nodes: [] | ||
|
||
- name: cluster | Find AFM gateway nodes | ||
add_host: | ||
name: "{{ item }}" | ||
groups: scale_gateway_nodes | ||
when: hostvars[item].scale_cluster_gateway | bool | ||
with_items: "{{ ansible_play_hosts }}" | ||
changed_when: false | ||
|
||
- name: configure | Setting AFM Sensors on AFM gateway nodes | ||
vars: | ||
scale_gateway_node: "{{ groups['scale_gateway_nodes'] | list }}" | ||
command: "{{ scale_command_path }}mmperfmon config update GPFSAFMFS.restrict={{ scale_gateway_node | join(',') }} GPFSAFMFS.period=10 GPFSAFMFSET.restrict={{ scale_gateway_node | join(',') }} GPFSAFMFS.period=10 GPFSAFMFSET.restrict={{ scale_gateway_node | join(',') }} GPFSAFMFSET.period=10 GPFSAFM.restrict={{ scale_gateway_node | join(',') }} GPFSAFM.period=10" | ||
when: groups['scale_gateway_nodes'] | list | length > 0 | ||
run_once: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
# tasks file for configure | ||
- include_tasks: afm_gateway.yml | ||
tags: configure | ||
run_once: true | ||
|
||
- include_tasks: afm_bucket.yml | ||
tags: configure | ||
when: | ||
- scale_afm_cos_bucket_params is defined | ||
with_items: | ||
- "{{ scale_afm_cos_bucket_params }}" | ||
run_once: true | ||
|
||
- include_tasks: afm_configure.yml | ||
tags: configure | ||
when: | ||
- scale_afm_cos_filesets_params is defined | ||
with_items: | ||
- "{{ scale_afm_cos_filesets_params }}" | ||
run_once: true | ||
|
||
- include_tasks: afm_sensor_configure.yml | ||
tags: configure | ||
run_once: true | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
localhost | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- hosts: localhost | ||
remote_user: root | ||
roles: | ||
- configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
# Variables for the IBM Spectrum Scale (ECE) (Erasure Code Edition) role - | ||
# these variables are *not* meant to be overridden | ||
|
||
# default mm command exection path | ||
scale_command_path: /usr/lpp/mmfs/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters