Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions roles/core_configure/tasks/cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
name: "{{ item }}"
groups: scale_cluster_members
when:
- hostvars[item].scale_cluster_clusterId.stdout
- hostvars[item].scale_cluster_clusterId.stdout | bool
with_items: "{{ ansible_play_hosts }}"
changed_when: false

Expand All @@ -43,9 +43,9 @@
name: "{{ item }}"
groups: scale_cluster_candidates
when:
- not hostvars[item].scale_cluster_clusterId.stdout
- hostvars[item].scale_cluster_clusterId.stderr
- hostvars[item].scale_state is defined and hostvars[item].scale_state != 'absent'
- not hostvars[item].scale_cluster_clusterId.stdout | bool
- hostvars[item].scale_cluster_clusterId.stderr | bool
- (hostvars[item].scale_state is defined and hostvars[item].scale_state != 'absent') | bool
with_items: "{{ ansible_play_hosts }}"
changed_when: false

Expand Down Expand Up @@ -134,26 +134,26 @@
set_fact:
profile_type: "--profile {{ scale_cluster_profile_name }}"
when:
- scale_cluster_profile_name is defined and scale_cluster_profile_name != 'None'
- (stat_profile_result.matched is defined and stat_profile_result.matched == 1) or (stat_user_profile_result.matched is defined and stat_user_profile_result.matched == 1)
- (scale_cluster_profile_name is defined and scale_cluster_profile_name != 'None') | bool
- ((stat_profile_result.matched is defined and stat_profile_result.matched == 1) or (stat_user_profile_result.matched is defined and stat_user_profile_result.matched == 1)) | bool

- name: cluster | Set gpfs remote shell command if it is defined
set_fact:
extra_option: "{{ extra_option }} -r {{ scale_cluster_config.remote_shell }}"
when:
- scale_cluster_config is defined and scale_cluster_config.remote_shell is defined
- (scale_cluster_config is defined and scale_cluster_config.remote_shell is defined) | bool

- name: cluster | Set gpfs remote file copy if it is defined
set_fact:
extra_option: "{{ extra_option }} -R {{ scale_cluster_config.remote_file_copy }}"
when:
- scale_cluster_config is defined and scale_cluster_config.remote_file_copy is defined
- (scale_cluster_config is defined and scale_cluster_config.remote_file_copy is defined) | bool

- name: cluster | Set gpfs cluster user defined port if it is defined
set_fact:
extra_option: "{{ extra_option }} --port {{ scale_cluster_config.scale_port_number }}"
when:
- scale_cluster_config is defined and scale_cluster_config.scale_port_number is defined
- (scale_cluster_config is defined and scale_cluster_config.scale_port_number is defined) | bool

- name: cluster | Create new cluster
command: /usr/lpp/mmfs/bin/mmcrcluster -N /var/mmfs/tmp/NodeFile -C {{ scale_cluster_clustername }} {{ profile_type }} {{ extra_option }}
Expand Down Expand Up @@ -181,10 +181,11 @@
src: ChangeFile.j2
dest: /var/mmfs/tmp/ChangeFile
when:
- groups['scale_cluster_candidates'] is defined
- groups['scale_cluster_members'] is undefined
- '"scale_cluster_candidates" in groups'
- '"scale_cluster_members" not in groups'
- groups['scale_cluster_candidates'] | length > 0
run_once: true
delegate_to: "{{ groups['scale_cluster_candidates'].0 }}"
delegate_to: "{{ (groups['scale_cluster_candidates'][0] if 'scale_cluster_candidates' in groups and groups['scale_cluster_candidates'] | length > 0 else inventory_hostname) }}"

#
# Add nodes to existing cluster
Expand Down Expand Up @@ -215,10 +216,13 @@
path: /var/mmfs/tmp/NodeFile
state: absent
when:
- groups['scale_cluster_candidates'] is defined
- groups['scale_cluster_members'] is defined
- '"scale_cluster_candidates" in groups'
- '"scale_cluster_members" in groups'
- groups['scale_cluster_candidates'] | length > 0
- groups['scale_cluster_members'] | length > 0
run_once: true
delegate_to: "{{ groups['scale_cluster_members'].0 }}"
delegate_to: "{{ (groups['scale_cluster_members'][0] if 'scale_cluster_members' in groups and groups['scale_cluster_members'] | length > 0 else inventory_hostname) }}"


- meta: flush_handlers

Expand Down
13 changes: 7 additions & 6 deletions roles/core_configure/tasks/cluster_start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
- block: ## when: delegate_node is defined
- name: cluster | Start daemons
command: /usr/lpp/mmfs/bin/mmstartup -N "{{ scale_daemon_node_list | join(',') }}"
when: scale_daemon_node_list is defined and scale_daemon_node_list | length > 0
when: "(scale_daemon_node_list is defined and scale_daemon_node_list | length > 0) | bool"
notify: wait-daemon-active
when:
- delegate_node is defined
- "(delegate_node is defined) | bool"
run_once: true
delegate_to: "{{ delegate_node }}"
delegate_to: "{{ delegate_node if delegate_node is defined else inventory_hostname }}"

- meta: flush_handlers

Expand All @@ -60,11 +60,12 @@
command: /usr/lpp/mmfs/bin/mmchnode -S /var/mmfs/tmp/ChangeFile
notify: accept-licenses

when: scale_cluster_changefile is changed
when: "(scale_cluster_changefile is changed) | bool"
when:
- groups['scale_cluster_members'] is defined
- "'scale_cluster_members' in groups"
- groups['scale_cluster_members'] | length > 0
- scale_node_role_change | bool
run_once: true
delegate_to: "{{ groups['scale_cluster_members'].0 }}"
delegate_to: "{{ (groups['scale_cluster_members'][0] if 'scale_cluster_members' in groups and groups['scale_cluster_members'] | length > 0 else inventory_hostname) }}"

- meta: flush_handlers
4 changes: 2 additions & 2 deletions roles/core_configure/tasks/removenode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
groups: scale_cluster_members
when:
- hostvars[item].scale_state is defined and hostvars[item].scale_state == 'present'
- hostvars[item].scale_admin_node is defined and hostvars[item].scale_admin_node|bool
- hostvars[item].scale_admin_node is defined and hostvars[item].scale_admin_node | bool
- hostvars[item].scale_cluster_clusterId.stdout
with_items: "{{ ansible_play_hosts }}"
changed_when: false
Expand All @@ -36,7 +36,7 @@
state: absent
name: "{{ delete_nodes | join(',') }}"
register: scale_delete_node
delegate_to: "{{ groups['scale_cluster_members'].0 }}"
delegate_to: "{{ (groups['scale_cluster_members'] | default([]) | list | first | default('localhost')) }}"

when: groups['scale_remove_nodes'] is defined and groups['scale_remove_nodes'] | length > 0
run_once: true
15 changes: 9 additions & 6 deletions roles/core_configure/tasks/scaleadmd_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,11 @@
src: ChangeFile.j2
dest: /var/mmfs/tmp/ChangeFile
when:
- groups['scale_cluster_candidates'] is defined
- groups['scale_cluster_members'] is undefined
- '"scale_cluster_candidates" in groups'
- '"scale_cluster_members" not in groups'
- groups['scale_cluster_candidates'] | length > 0
run_once: true
delegate_to: "{{ groups['scale_cluster_candidates'].0 }}"
delegate_to: "{{ (groups['scale_cluster_candidates'][0] if 'scale_cluster_candidates' in groups and groups['scale_cluster_candidates'] | length > 0 else inventory_hostname) }}"

#
# Inspect existing cluster and inventory
Expand Down Expand Up @@ -320,10 +321,12 @@
ignore_errors: yes

when:
- groups['scale_cluster_candidates'] is defined
- groups['scale_cluster_members'] is defined
- '"scale_cluster_candidates" in groups'
- '"scale_cluster_members" in groups'
- groups['scale_cluster_candidates'] | length > 0
- groups['scale_cluster_members'] | length > 0
run_once: true
delegate_to: "{{ groups['scale_cluster_members'].0 }}"
delegate_to: "{{ (groups['scale_cluster_members'][0] if 'scale_cluster_members' in groups and groups['scale_cluster_members'] | length > 0 else inventory_hostname) }}"

- name: cluster | Node identity
command: /usr/lpp/mmfs/bin/scalectl node config get
Expand Down
9 changes: 5 additions & 4 deletions roles/core_configure/tasks/scaleadmd_cluster_start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
- block: ## when: delegate_node is defined
- name: cluster | Start daemons
command: /usr/lpp/mmfs/bin/scalectl node start -N "{{ scale_daemon_node_list | join(',') }}"
when: scale_daemon_node_list is defined and scale_daemon_node_list | length > 0
when: "(scale_daemon_node_list is defined and scale_daemon_node_list | length > 0) | bool"
register: scalectl_startup
notify: wait-daemon-active
when:
- delegate_node is defined
run_once: true
delegate_to: "{{ delegate_node }}"
delegate_to: "{{ delegate_node if delegate_node is defined else inventory_hostname }}"

- debug:
msg: "{{scalectl_startup}}"
Expand Down Expand Up @@ -73,9 +73,10 @@

when: scale_cluster_changefile is changed
when:
- groups['scale_cluster_members'] is defined
- '"scale_cluster_members" in groups'
- scale_node_role_change | bool
- groups['scale_cluster_members'] | length > 0
run_once: true
delegate_to: "{{ groups['scale_cluster_members'].0 }}"
delegate_to: "{{ (groups['scale_cluster_members'][0] if 'scale_cluster_members' in groups and groups['scale_cluster_members'] | length > 0 else inventory_hostname) }}"

- meta: flush_handlers
8 changes: 4 additions & 4 deletions roles/core_install/tasks/yum/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
set_fact:
scale_install_updated: true
when:
- ("'installed' in scale_install_packagelist.results | map(attribute='yumstate') | list") or
("'installed' in scale_install_dnfpackagelist.results | map(attribute='yumstate' | list")
- (scale_install_packageresult.changed) or (scale_install_dnfpackageresult.changed)
when: ansible_pkg_mgr == 'yum' or ansible_pkg_mgr == 'dnf'
- (("'installed' in scale_install_packagelist.results | map(attribute='yumstate') | list") | bool or
("'installed' in scale_install_dnfpackagelist.results | map(attribute='yumstate') | list") | bool)
- ((scale_install_packageresult.changed) | bool or (scale_install_dnfpackageresult.changed) | bool)
when: (ansible_pkg_mgr == 'yum') | bool or (ansible_pkg_mgr == 'dnf') | bool
when: not scale_daemon_running

- block:
Expand Down
2 changes: 1 addition & 1 deletion roles/gui_configure/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- scale_gui_admin_user is defined
- scale_gui_admin_hc_vault_user is not defined
- groups['scale_gui_defined_listnodes'] is defined and groups['scale_gui_defined_listnodes'] | length > 0
delegate_to: "{{ groups['scale_gui_defined_listnodes'].0 }}"
delegate_to: "{{ (groups['scale_gui_defined_listnodes'] | default([]) | list | first | default('localhost')) }}"
tags: users

- import_tasks: ldap.yml
Expand Down