Skip to content

Commit

Permalink
Merge pull request #625 from rajan-mis/cloud_prereq_master
Browse files Browse the repository at this point in the history
Optional prereqs package install logic in the core/precheck role
  • Loading branch information
rajan-mis authored Apr 26, 2022
2 parents 8b2d945 + 6b1d62c commit 61298bd
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/core/cluster/tasks/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@

- block:
- debug:
msg: Wait for 60 second for NSD configuration to be synced across cluster. Please be patient...
msg: Wait for 240 second for NSD configuration to be synced across cluster. Please be patient...

- name: storage | Wait for NSD configuration to be synced across cluster
wait_for:
timeout: 60
timeout: 240

- name: storage | wait-nsd-active
shell: /usr/lpp/mmfs/bin/mmlsnsd -a -Y | grep -v HEADER | cut -d ':' -f 8
Expand Down
6 changes: 6 additions & 0 deletions roles/core/precheck/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ scale_build_gplsrc_prereqs:
- kernel-devel
- make

## List of optional prereq package to install
scale_prereqs_package:
- numactl

## List of optional prereq package to install flag
scale_install_prereqs_packages: false

## Default cluster name
scale_cluster_clustername: gpfs1.local
Expand Down
36 changes: 36 additions & 0 deletions roles/core/precheck/tasks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,39 @@
name: yum-utils
state: present
when: ansible_pkg_mgr == 'yum'

- block: ## when: scale_install_prereqs_packages is defined
- name: prepare | Install prerequisite packages
yum:
name: "{{ scale_prereqs_package }}"
state: present
disable_excludes: all
when: ansible_pkg_mgr == 'yum'
register: scale_gpl_yum_result
retries: 10
until: scale_gpl_yum_result is success
delay: 20

- name: prepare | Install prerequisite packages
dnf:
name: "{{ scale_prereqs_package }}"
state: present
disable_excludes: all
when: ansible_pkg_mgr == 'dnf'
register: scale_gpl_dnf_result
retries: 10
until: scale_gpl_dnf_result is success
delay: 20

- name: prepare | Install prerequisite packages
apt:
name: "{{ scale_prereqs_package }}"
state: present
when: ansible_pkg_mgr == 'apt'

- name: prepare | Install prerequisite packages
zypper:
name: "{{ scale_prereqs_package }}"
state: present
when: ansible_pkg_mgr == 'zypper'
when: scale_install_prereqs_packages | bool
59 changes: 59 additions & 0 deletions roles/remote_mount/tasks/precheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,62 @@
msg: "item.scale_remotemount_storage_filesystem_name is not defined"
when: item.scale_remotemount_storage_filesystem_name is undefined
loop: "{{ scale_remotemount_filesystem_name }}"


# This block is for systems with Scale GUI/RESTAPI on both Accessing cluster and Remote Cluster.
#
- block: # RESTAPI - when: scale_remotemount_client_no_gui == false
- name: Main | Storage Cluster (owner) | Check Connectivity to Storage Cluster GUI
uri:
validate_certs: "{{ validate_certs_uri }}"
force_basic_auth: yes
url: https://{{ scale_remotemount_storage_gui_hostname }}:{{ storage_cluster_gui_port }}/{{ scalemgmt_endpoint }}/cluster
method: GET
user: "{{ scale_remotemount_storage_gui_username }}"
password: "{{ scale_remotemount_storage_gui_password }}"
body_format: json
status_code:
- 200
register: storage_cluster_status
until:
- storage_cluster_status.status == 200
retries: 15
delay: 30
changed_when: false


- name: Main | Storage Cluster (owner) | Conenction Refused Storage Cluster
run_once: True
fail:
msg: "There is issues connection to GUI/RestAPI, http return code: {{ storage_cluster_status.status }}"
when:
- storage_cluster_status.status != 200

- name: Main | Client Cluster (access) | Check Connectivity to Client Cluster GUI
uri:
validate_certs: "{{ validate_certs_uri }}"
force_basic_auth: yes
url: https://{{ scale_remotemount_client_gui_hostname }}:{{ client_cluster_gui_port }}/{{ scalemgmt_endpoint }}/cluster
method: GET
user: "{{ scale_remotemount_client_gui_username }}"
password: "{{ scale_remotemount_client_gui_password }}"
body_format: json
status_code:
- 200
register: access_cluster_status
until:
- access_cluster_status.status == 200
retries: 15
delay: 30
changed_when: false

- name: Main | Client Cluster (access) | Conenction Refused Client Cluster
run_once: True
fail:
msg: "There is issues connection to GUI/RestAPI, http return code: {{ access_cluster_status.status }}"
when:
- access_cluster_status.status != 200

when:
- scale_remotemount_client_no_gui == false

44 changes: 44 additions & 0 deletions samples/legacy/playbook_cloud_network_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# Playbook for deploying IBM Spectrum Scale (GPFS) sysctl config
- hosts: all
any_errors_fatal: true
tasks:
- name: OS config | install python bindings
yum:
name:
- libselinux-python3
state: present
when: ansible_pkg_mgr == 'yum'

- name: OS config | install python bindings
dnf:
name:
- libselinux-python3
state: present
when: ansible_pkg_mgr == 'dnf'

- name: OS config | sysctl config value
sysctl:
name: "{{ item.key }}"
value: "{{ item.value }}"
sysctl_set: yes
state: present
reload: yes
with_dict:
net.ipv4.tcp_max_syn_backlog: "65536"
net.ipv4.tcp_timestamps: "0"
net.ipv4.tcp_sack: "1"
net.core.netdev_max_backlog: "250000"
net.core.rmem_max: "16777216"
net.core.wmem_max: "16777216"
net.core.rmem_default: "16777216"
net.core.wmem_default: "16777216"
net.core.optmem_max: "16777216"
net.ipv4.tcp_rmem: "4096 87380 16777216"
net.ipv4.tcp_wmem: "4096 65536 16777216"
net.ipv4.tcp_low_latency: "1"
net.ipv4.tcp_adv_win_scale: "1"
net.core.somaxconn: "2048"
net.ipv4.neigh.eth0.gc_stale_time: "2000000"
net.ipv4.neigh.eth0.base_reachable_time_ms: "120000"
net.ipv4.neigh.eth0.mcast_solicit: "18"

0 comments on commit 61298bd

Please sign in to comment.