Skip to content

Commit 4a2633e

Browse files
authored
Merge pull request #585 from rajan-mis/node_name_obj_issue_master
Fix for object OS validation when item host is not matching with inve…
2 parents c95ef79 + e9de200 commit 4a2633e

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

roles/nfs/common/tasks/configure.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,48 +51,55 @@
5151
package:
5252
name: iputils-arping
5353
state: present
54-
when: ansible_distribution in scale_ubuntu_distribution and ansible_fqdn in scale_protocol_node_list
54+
when: (ansible_distribution in scale_ubuntu_distribution) and
55+
(ansible_fqdn in scale_protocol_node_list or inventory_hostname in scale_protocol_node_list)
5556

5657
- name: configure | Check if SMB is running
5758
shell:
5859
cmd: "{{ scale_command_path }}mmces service list|grep SMB"
5960
register: scale_service_status
60-
when: ansible_fqdn in scale_protocol_node_list
61+
when: (ansible_fqdn in scale_protocol_node_list) or
62+
(inventory_hostname in scale_protocol_node_list)
6163
ignore_errors: true
6264
failed_when: false
6365
run_once: true
6466

6567
- name: configure | Add SMB service to list
6668
set_fact:
6769
scale_service_list: "{{ scale_service_list + [scale_service_status.stderr|regex_search('SMB')] }}"
68-
when: ansible_fqdn in scale_protocol_node_list and scale_service_status.rc > 0
70+
when: (ansible_fqdn in scale_protocol_node_list or inventory_hostname in scale_protocol_node_list) and
71+
( scale_service_status.rc > 0 )
6972
run_once: true
7073

7174
- name: configure | Add SMB service to list
7275
set_fact:
7376
scale_service_list: "{{ scale_service_list + ['SMB'] }}"
74-
when: ansible_fqdn in scale_protocol_node_list and scale_service_status.rc == 0
77+
when: (ansible_fqdn in scale_protocol_node_list or inventory_hostname in scale_protocol_node_list) and
78+
( scale_service_status.rc == 0 )
7579
run_once: true
7680

7781
- name: configure | Check if NFS is running
7882
shell:
7983
cmd: "{{ scale_command_path }}mmces service list|grep NFS"
8084
register: scale_service_status
81-
when: ansible_fqdn in scale_protocol_node_list
85+
when: (ansible_fqdn in scale_protocol_node_list) or
86+
(inventory_hostname in scale_protocol_node_list)
8287
ignore_errors: true
8388
failed_when: false
8489
run_once: true
8590

8691
- name: configure | Add NFS service to the list
8792
set_fact:
8893
scale_service_list: "{{ scale_service_list + [scale_service_status.stderr|regex_search('NFS')] }}"
89-
when: ansible_fqdn in scale_protocol_node_list and scale_service_status.rc > 0
94+
when: (ansible_fqdn in scale_protocol_node_list or inventory_hostname in scale_protocol_node_list) and
95+
( scale_service_status.rc > 0 )
9096
run_once: true
9197

9298
- name: configure | Add NFS service to the list
9399
set_fact:
94100
scale_service_list: "{{ scale_service_list + ['NFS'] }}"
95-
when: ansible_fqdn in scale_protocol_node_list and scale_service_status.rc == 0
101+
when: (ansible_fqdn in scale_protocol_node_list or inventory_hostname in scale_protocol_node_list) and
102+
( scale_service_status.rc == 0 )
96103
run_once: true
97104

98105
- import_role:
@@ -185,7 +192,8 @@
185192

186193
- name: configure | Assign export ips as pool for CES groups
187194
command: "{{ scale_command_path }}mmces address add --ces-ip {{ item.export_ip_pool|join(',') }} --ces-group {{ item.group_name}}"
188-
when: ansible_fqdn in scale_protocol_node_list
195+
when: (ansible_fqdn in scale_protocol_node_list) or
196+
(inventory_hostname in scale_protocol_node_list)
189197
delegate_to: "{{ scale_protocol_node_list.0 }}"
190198
with_items:
191199
- "{{ scale_protocols.scale_ces_groups }}"

roles/scale_object/precheck/tasks/check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
- name: check | Check for supported operating system
2929
assert:
3030
that:
31-
- hostvars[item]['ansible_distribution'] in scale_rhel_distribution
31+
- hostvars[item]['ansible_distribution'] in scale_rhel_distribution
3232
- hostvars[item]['ansible_distribution_major_version'] == '8'
3333
msg: >-
3434
Object is only supported for Rhel 8 and higher!
3535
with_items:
36-
- "{{ scale_obj_nodes_list }}"
36+
- "{{ ansible_play_hosts }}"
37+
when: hostvars[item]['is_protocol_node'] is defined and hostvars[item]['is_protocol_node']|bool
3738
delegate_to: localhost
3839
run_once: true
39-

0 commit comments

Comments
 (0)