ソースを参照

Issue #172: Removed NTP changes from slurm_common

Signed-off-by: Krishnaraj <Vishnupriya_Krishnar@Dellteam.com>
VishnupriyaKrish 4 年 前
コミット
2408eeabb9

+ 0 - 40
roles/slurm_common/handlers/main.yml

@@ -1,40 +0,0 @@
-#  Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
-#
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
----
-
-- name: Restart ntpd
-  systemd:
-    name: ntpd
-    state: started
-    enabled: yes
-
-- name: Restart chrony
-  systemd:
-    name: chronyd
-    state: started
-    enabled: yes
-
-- name: Sync tp clocks
-  command: ntpdc -np
-  register: ntp_clock
-  until:  ntp_clock.stdout.find('*') > -1
-  retries: "{{ retry_count_one }}"
-  delay: "{{ delay_count_one }}"
-
-- name: Sync chrony sources
-  command: chronyc sources
-  register: chrony_src
-  until:  chrony_src.stdout.find('^*') > -1
-  retries: "{{ retry_count }}"
-  delay: "{{ delay_count }}"

+ 2 - 16
roles/slurm_common/tasks/main.yml

@@ -24,7 +24,7 @@
     regexp: localhost.localdomain
     regexp: localhost.localdomain
     replace: "{{ host_name.stdout }}"
     replace: "{{ host_name.stdout }}"
     backup: yes
     backup: yes
-    mode: "{{ common_mode ]}"
+    mode: "{{ common_mode }}"
 
 
 - name: Add host name in hosts file
 - name: Add host name in hosts file
   lineinfile:
   lineinfile:
@@ -34,12 +34,6 @@
     create: yes
     create: yes
     mode: "{{ common_mode }}"
     mode: "{{ common_mode }}"
 
 
-- name: Install epel repository
-  package:
-    name: epel-release
-    state: present
-  tags: install
-
 - name: Install packages for slurm
 - name: Install packages for slurm
   package:
   package:
     name: "{{ item }}"
     name: "{{ item }}"
@@ -193,12 +187,4 @@
     state: restarted
     state: restarted
     enabled: yes
     enabled: yes
   tags: install
   tags: install
-  ignore_errors: yes
-
-- name: Disable selinux
-  selinux:
-    state: disabled
-  tags: install
-
-- name: Deploy time ntp/chrony
-  include_tasks: ntp.yml
+  ignore_errors: yes

+ 0 - 56
roles/slurm_common/tasks/ntp.yml

@@ -1,56 +0,0 @@
-#  Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
-#
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
----
-
-  - name: Deploy ntp servers
-    block:
-      - name: Deploy ntpd
-        package:
-          name: ntp
-          state: present
-      - name: Deploy ntpdate
-        package:
-          name: ntpdate
-          state: present
-      - name: Update ntp servers
-        template:
-          src: ntp.conf.j2
-          dest: "{{ ntp_path }}"
-          owner: root
-          group: root
-          mode: "{{ ntp_mode }}"
-          backup: yes
-        notify:
-          - Restart ntpd
-          - Sync tp clocks
-    when:  ( ansible_distribution == "CentOS" or   ansible_distribution == "RedHat" ) and ansible_distribution_major_version  < os_higher_version
-
-  - name: Deploy chrony server
-    block:
-      - name: Deploy chrony
-        package:
-            name: chrony
-            state: present
-      - name: Update ntp servers
-        template:
-          src: chrony.conf.j2
-          dest: "{{ chrony_path }}"
-          owner: root
-          group: root
-          mode: "{{ ntp_mode }}"
-          backup: yes
-        notify:
-          - Restart chrony
-          - Sync chrony sources
-    when:  ( ansible_distribution == "CentOS" or   ansible_distribution == "RedHat" ) and ansible_distribution_major_version  > os_version

+ 0 - 41
roles/slurm_common/templates/chrony.conf.j2

@@ -1,41 +0,0 @@
-# Use public servers from the pool.ntp.org project.
-# Please consider joining the pool (http://www.pool.ntp.org/join.html).
-{% for item in chrony_servers %}
-pool {{ item }} iburst
-{% endfor %}
-
-
-# Record the rate at which the system clock gains/losses time.
-driftfile /var/lib/chrony/drift
-
-# Allow the system clock to be stepped in the first three updates
-# if its offset is larger than 1 second.
-makestep 1.0 3
-
-# Enable kernel synchronization of the real-time clock (RTC).
-rtcsync
-
-# Enable hardware timestamping on all interfaces that support it.
-#hwtimestamp *
-
-# Increase the minimum number of selectable sources required to adjust
-# the system clock.
-#minsources 2
-
-# Allow NTP client access from local network.
-#allow 192.168.0.0/16
-
-# Serve time even if not synchronized to a time source.
-#local stratum 10
-
-# Specify file containing keys for NTP authentication.
-keyfile /etc/chrony.keys
-
-# Get TAI-UTC offset and leap seconds from the system tz database.
-leapsectz right/UTC
-
-# Specify directory for log files.
-logdir /var/log/chrony
-
-# Select which information is logged.
-#log measurements statistics tracking

+ 0 - 14
roles/slurm_common/templates/ntp.conf.j2

@@ -1,14 +0,0 @@
-driftfile /var/lib/ntp/drift
-
-restrict default nomodify notrap nopeer noquery
-
-restrict 127.0.0.1
-restrict ::1
-
-{% for item in ntp_servers %}
-server  {{ item }} iburst
-{% endfor %}
-
-includefile /etc/ntp/crypto/pw
-
-keys /etc/ntp/keys

+ 1 - 18
roles/slurm_common/vars/main.yml

@@ -21,7 +21,6 @@ common_packages:
    - munge-devel
    - munge-devel
    - mariadb-server
    - mariadb-server
    - mariadb-devel
    - mariadb-devel
-   - python3
    - man2html
    - man2html
    - MySQL-python
    - MySQL-python
 
 
@@ -47,20 +46,4 @@ slurmctld_pid: "/var/run/slurmctld.pid"
 slurmd_pid: "/var/run/slurmd.pid"
 slurmd_pid: "/var/run/slurmd.pid"
 cluster_name : "manager,compute"
 cluster_name : "manager,compute"
 slurmctld_log: "/var/log/slurm/slurmctld.log"
 slurmctld_log: "/var/log/slurm/slurmctld.log"
-slurmd_log: "/var/log/slurm/slurmd.log"
-chrony_path: "/etc/chrony.conf"
-ntp_path: "/etc/ntp.conf"
-ntp_mode: "0644"
-os_higher_version: "8"
-os_version: "7"
-retry_count_one: "10"
-delay_count_one: "60"
-retry_count: "6"
-delay_count: "10"
-
-ntp_servers:
-  - 0.centos.pool.ntp.org
-  - 1.centos.pool.ntp.org
-  - 2.centos.pool.ntp.org
-chrony_servers:
-  - 2.centos.pool.ntp.org
+slurmd_log: "/var/log/slurm/slurmd.log"

+ 0 - 10
roles/slurm_manager/tasks/main.yml

@@ -47,16 +47,6 @@
   with_items:
   with_items:
     - "{{ log_files_master }}"
     - "{{ log_files_master }}"
 
 
-- name: Get mariadb password from vault
-  command: ansible-vault view {{ input_config_pth }} --vault-password-file {{ vault_path }}
-  register: vault_contents
-  delegate_to: localhost
-  changed_when: true
-
-- name: Extract db password from input config file
-  set_fact:
-    db_password="{{ vault_contents.stdout | regex_findall('[\n\r].*mariadb_password:\s*\"([^\n\r]*)\"') }}"
-
 - name: Install packages for slurm
 - name: Install packages for slurm
   package:
   package:
     name: "{{ item }}"
     name: "{{ item }}"

+ 1 - 4
roles/slurm_manager/vars/main.yml

@@ -14,7 +14,6 @@
 ---
 ---
 
 
 slurm_packages:
 slurm_packages:
-   - python3
    - gcc
    - gcc
    - openssl
    - openssl
    - numactl
    - numactl
@@ -72,6 +71,4 @@ logfile: "/var/log/slurm/slurmdbd.log"
 pidfile: "/var/run/slurmdbd.pid"
 pidfile: "/var/run/slurmdbd.pid"
 buffer_path: "/tmp/slurm.conf"
 buffer_path: "/tmp/slurm.conf"
 rpm_path: "/root/rpmbuild/RPMS/x86_64/"
 rpm_path: "/root/rpmbuild/RPMS/x86_64/"
-slurm_mode: "0644"
-input_config_pth: "omnia/appliance/input_config.yml"
-vault_path: "omnia/appliance/roles/common/files/.vault_key"
+slurm_mode: "0644"

+ 68 - 0
test/test_common.yml

@@ -0,0 +1,68 @@
+# Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+---
+
+# Testcase OMNIA_USP_US_VFSP_TC_009
+# Execute common role in manager & compute nodes with os installed centos 7.9
+- name: OMNIA_USP_US_VFSP_TC_009
+  hosts: manager, compute
+  vars_files:
+    - test_vars/test_common_vars.yml
+  tasks:
+    - block:
+        - name: Call  common role
+          include_role:
+            name: ../roles/common
+      tags: TC_009
+
+    - name: Checking ntpd service status
+      systemd:
+        name: ntpd
+      register: ntpd_service
+      tags: TC_009, VERIFY_009
+
+    - name: Validating ntpd service status
+      assert:
+        that:
+          - ntpd_service.status.ActiveState == 'active'
+        fail_msg: "{{ ntpd_service_fail_msg }}"
+        success_msg: "{{ ntpd_service_success_msg }}"
+      tags: TC_009, VERIFY_009
+
+# Testcase OMNIA_USP_US_VFSP_TC_010
+# Execute common role in manager & compute nodes with common role already executed once
+- name: OMNIA_USP_US_VFSP_TC_010
+  hosts: manager, compute
+  vars_files:
+    - test_vars/test_common_vars.yml
+  tasks:
+    - block:
+        - name: Call  common role
+          include_role:
+            name: ../roles/common
+      tags: TC_010
+
+    - name: Checking ntpd service status
+      systemd:
+        name: ntpd
+      register: ntpd_service
+      tags: TC_010, VERIFY_010
+
+    - name: Validating ntpd service status
+      assert:
+        that:
+          - ntpd_service.status.ActiveState == 'active'
+        fail_msg: "{{ ntpd_service_fail_msg }}"
+        success_msg: "{{ ntpd_service_success_msg }}"
+      tags: TC_010, VERIFY_010

+ 0 - 28
test/test_slurm_common.yml

@@ -37,12 +37,6 @@
       register: munge_service
       register: munge_service
       tags: TC_001, VERIFY_001
       tags: TC_001, VERIFY_001
 
 
-    - name: Checking ntpd service status
-      systemd:
-        name: ntpd
-      register: ntpd_service
-      tags: TC_001, VERIFY_001
-
     - name: Verify all required packages are installed
     - name: Verify all required packages are installed
       assert:
       assert:
         that: "'{{ item }}' in ansible_facts.packages"
         that: "'{{ item }}' in ansible_facts.packages"
@@ -59,14 +53,6 @@
         success_msg: "{{ munge_service_success_msg }}"
         success_msg: "{{ munge_service_success_msg }}"
       tags: TC_001, VERIFY_001
       tags: TC_001, VERIFY_001
 
 
-    - name: Validating ntpd service status
-      assert:
-        that:
-          - ntpd_service.status.ActiveState == 'active'
-        fail_msg: "{{ ntpd_service_fail_msg }}"
-        success_msg: "{{ ntpd_service_success_msg }}"
-      tags: TC_001, VERIFY_001
-
 # Testcase OMNIA_USP_US_VFSP_TC_002
 # Testcase OMNIA_USP_US_VFSP_TC_002
 # Execute slurm_common role in manager & compute nodes with common packages already installed
 # Execute slurm_common role in manager & compute nodes with common packages already installed
 - name: OMNIA_USP_US_VFSP_TC_002
 - name: OMNIA_USP_US_VFSP_TC_002
@@ -91,12 +77,6 @@
       register: munge_service
       register: munge_service
       tags: TC_002, VERIFY_002
       tags: TC_002, VERIFY_002
 
 
-    - name: Checking ntpd service status
-      systemd:
-        name: ntpd
-      register: ntpd_service
-      tags: TC_002, VERIFY_002
-
     - name: Verify all required packages are installed
     - name: Verify all required packages are installed
       assert:
       assert:
         that: "'{{ item }}' in ansible_facts.packages"
         that: "'{{ item }}' in ansible_facts.packages"
@@ -111,12 +91,4 @@
           - munge_service.status.ActiveState == 'active'
           - munge_service.status.ActiveState == 'active'
         fail_msg: "{{ munge_service_fail_msg }}"
         fail_msg: "{{ munge_service_fail_msg }}"
         success_msg: "{{ munge_service_success_msg }}"
         success_msg: "{{ munge_service_success_msg }}"
-      tags: TC_002, VERIFY_002
-
-    - name: Validating ntpd service status
-      assert:
-        that:
-          - ntpd_service.status.ActiveState == 'active'
-        fail_msg: "{{ ntpd_service_fail_msg }}"
-        success_msg: "{{ ntpd_service_success_msg }}"
       tags: TC_002, VERIFY_002
       tags: TC_002, VERIFY_002

+ 16 - 2
test/test_slurm_manager.yml

@@ -19,12 +19,19 @@
   hosts: manager
   hosts: manager
   vars_files:
   vars_files:
     - test_vars/test_slurm_manager_vars.yml
     - test_vars/test_slurm_manager_vars.yml
+    - ../appliance/roles/common/vars/main.yml
   tasks:
   tasks:
     - block:
     - block:
+        - name: Call cluster_validation role
+          include_role:
+            name: ../roles/cluster_validation
+            tasks_from: fetch_password
+          tags: TC_003
+
         - name: Call slurm manager role
         - name: Call slurm manager role
           include_role:
           include_role:
             name: ../roles/slurm_manager
             name: ../roles/slurm_manager
-      tags: TC_003
+          tags: TC_003
 
 
     - name: Fetch slurm packages installed
     - name: Fetch slurm packages installed
       package_facts:
       package_facts:
@@ -88,12 +95,19 @@
   hosts: manager
   hosts: manager
   vars_files:
   vars_files:
     - test_vars/test_slurm_manager_vars.yml
     - test_vars/test_slurm_manager_vars.yml
+    - ../appliance/roles/common/vars/main.yml
   tasks:
   tasks:
     - block:
     - block:
+        - name: Call cluster_validation role
+          include_role:
+            name: ../roles/cluster_validation
+            tasks_from: fetch_password
+          tags: TC_004
+
         - name: Call slurm manager role
         - name: Call slurm manager role
           include_role:
           include_role:
             name: ../roles/slurm_manager
             name: ../roles/slurm_manager
-      tags: TC_004
+          tags: TC_004
 
 
     - name: Fetch slurm packages installed
     - name: Fetch slurm packages installed
       package_facts:
       package_facts:

+ 18 - 0
test/test_vars/test_common_vars.yml

@@ -0,0 +1,18 @@
+# Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+---
+
+ntpd_service_fail_msg: "Ntpd service is not running"
+
+ntpd_service_success_msg: "Ntpd service is running"

+ 0 - 4
test/test_vars/test_slurm_common_vars.yml

@@ -21,10 +21,6 @@ munge_service_fail_msg: "Munge service is not running"
 
 
 munge_service_success_msg: "Munge service is running"
 munge_service_success_msg: "Munge service is running"
 
 
-ntpd_service_fail_msg: "Ntpd service is not running"
-
-ntpd_service_success_msg: "Ntpd service is running"
-
 common_packages:
 common_packages:
    - munge
    - munge
    - munge-libs
    - munge-libs

+ 0 - 1
test/test_vars/test_slurm_manager_vars.yml

@@ -14,7 +14,6 @@
 ---
 ---
 
 
 slurm_packages:
 slurm_packages:
-   - python3
    - gcc
    - gcc
    - openssl
    - openssl
    - numactl
    - numactl