Browse Source

Merge pull request #565 from blesson-james/omnia_config_changes

Issue #561: setting default values for domain & realm name variables
Lucas A. Wilson 3 years ago
parent
commit
59cfe9e69d

+ 4 - 4
omnia_config.yml

@@ -1,4 +1,4 @@
-# Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved.
 #
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  you may not use this file except in compliance with the License.
@@ -57,11 +57,11 @@ login_node_required: true
 
 
 # This variable is used to accept the domain name the user intends to configure
 # This variable is used to accept the domain name the user intends to configure
 # Eg: ipa.test
 # Eg: ipa.test
-domain_name: ""
+domain_name: "omnia.test"
 
 
 # A Kerberos realm is the domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. 
 # A Kerberos realm is the domain over which a Kerberos authentication server has the authority to authenticate a user, host or service. 
 # A realm name is often, but not always the upper case version of the name of the DNS domain over which it presides
 # A realm name is often, but not always the upper case version of the name of the DNS domain over which it presides
-realm_name: ""
+realm_name: "OMNIA.TEST"
 
 
 # The directory server operations require an administrative user. 
 # The directory server operations require an administrative user. 
 # This user is referred to as the Directory Manager and has full access to the Directory for system management tasks 
 # This user is referred to as the Directory Manager and has full access to the Directory for system management tasks 
@@ -72,4 +72,4 @@ directory_manager_password: ""
 
 
 # The IPA server requires an administrative user, named 'admin'. 
 # The IPA server requires an administrative user, named 'admin'. 
 # This user is a regular system account used for IPA server administration
 # This user is a regular system account used for IPA server administration
-ipa_admin_password: ""
+ipa_admin_password: ""

+ 11 - 37
roles/cluster_validation/tasks/fetch_password.yml

@@ -1,4 +1,4 @@
-#  Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
+#  Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved.
 #
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  you may not use this file except in compliance with the License.
@@ -12,6 +12,7 @@
 #  See the License for the specific language governing permissions and
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 #  limitations under the License.
 ---
 ---
+
 - name: Check if omnia_vault_key exists
 - name: Check if omnia_vault_key exists
   stat:
   stat:
     path: "{{ role_path }}/../../{{ config_vaultname }}"
     path: "{{ role_path }}/../../{{ config_vaultname }}"
@@ -72,12 +73,12 @@
 - name: Assert mariadb_password
 - name: Assert mariadb_password
   assert:
   assert:
     that:
     that:
-        - mariadb_password | length > min_length | int - 1
-        - mariadb_password | length < max_length | int + 1
-        - '"-" not in mariadb_password '
-        - '"\\" not in mariadb_password '
-        - '"\"" not in mariadb_password '
-        - " \"'\" not in mariadb_password "
+      - mariadb_password | length > min_length | int - 1
+      - mariadb_password | length < max_length | int + 1
+      - '"-" not in mariadb_password '
+      - '"\\" not in mariadb_password '
+      - '"\"" not in mariadb_password '
+      - " \"'\" not in mariadb_password "
     success_msg: "{{ success_msg_mariadb_password }}"
     success_msg: "{{ success_msg_mariadb_password }}"
     fail_msg: "{{ fail_msg_mariadb_password }}"
     fail_msg: "{{ fail_msg_mariadb_password }}"
 
 
@@ -89,7 +90,8 @@
 
 
 - name: Assert kubernetes cni
 - name: Assert kubernetes cni
   assert:
   assert:
-    that: "('calico' in k8s_cni) or ('flannel' in k8s_cni)"
+    that:
+      - "('calico' in k8s_cni) or ('flannel' in k8s_cni)"
     success_msg: "{{ success_msg_k8s_cni }}"
     success_msg: "{{ success_msg_k8s_cni }}"
     fail_msg: "{{ fail_msg_k8s_cni }}"
     fail_msg: "{{ fail_msg_k8s_cni }}"
 
 
@@ -112,38 +114,10 @@
     ansible_conf_file_path: "{{ ansible_config_file_path }}"
     ansible_conf_file_path: "{{ ansible_config_file_path }}"
   no_log: True
   no_log: True
 
 
-- name: Check whether ansible config file exists
-  stat:
-    path: "{{ ansible_conf_file_path }}/ansible.cfg"
-  register: ansible_conf_exists
-
-- name: Create the directory if it does not exist
-  file:
-    path: "{{ ansible_conf_file_path }}"
-    state: directory
-    mode: "{{ file_perm }}"
-  when: not ansible_conf_exists.stat.exists
-
-- name: Create ansible config file if it does not exist
-  copy:
-    dest: "{{ ansible_conf_file_path }}/ansible.cfg"
-    mode: "{{ file_perm }}"
-    content: |
-      [defaults]
-      log_path = /var/log/omnia.log
-  when: not ansible_conf_exists.stat.exists
-
-- name: Set omnia.log file
-  replace:
-    path: "{{ ansible_conf_file_path }}/ansible.cfg"
-    regexp: '#log_path = /var/log/ansible.log'
-    replace: 'log_path = /var/log/omnia.log'
-  when: ansible_conf_exists.stat.exists
-
 - name: Verify the value of login_node_required
 - name: Verify the value of login_node_required
   assert:
   assert:
     that:
     that:
-      - 'login_node_required | type_debug == "bool"'
+      - login_node_required == true or login_node_required == false
     success_msg: "{{ login_node_required_success_msg }}"
     success_msg: "{{ login_node_required_success_msg }}"
     fail_msg: "{{ login_node_required_fail_msg }}"
     fail_msg: "{{ login_node_required_fail_msg }}"
 
 

+ 2 - 2
roles/k8s_common/vars/main.yml

@@ -1,4 +1,4 @@
-#  Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
+#  Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved.
 #
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  you may not use this file except in compliance with the License.
@@ -24,4 +24,4 @@ k8s_conf_dest: /etc/sysctl.d/
 
 
 k8s_repo_file_mode: 0644
 k8s_repo_file_mode: 0644
 
 
-k8s_conf_file_mode: 0644
+k8s_conf_file_mode: 0644

+ 2 - 2
roles/k8s_manager/tasks/main.yml

@@ -1,4 +1,4 @@
-#  Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
+#  Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved.
 #
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
 #  you may not use this file except in compliance with the License.
@@ -36,4 +36,4 @@
   register: install_helm
   register: install_helm
   until: install_helm is not failed
   until: install_helm is not failed
   retries: 20
   retries: 20
-  tags: manager
+  tags: manager

+ 3 - 5
roles/login_server/tasks/install_ipa_server.yml

@@ -32,10 +32,8 @@
 
 
 - name: Install ipa server
 - name: Install ipa server
   command: >-
   command: >-
-    ipa-server-install -n '{{ hostvars['127.0.0.1']['domain_name'] }}' --hostname='{{ server_hostname }}'
-    -a '{{ hostvars['127.0.0.1']['ipa_admin_password'] }}'
-    -p '{{ hostvars['127.0.0.1']['directory_manager_password'] }}' -r '{{ hostvars['127.0.0.1']['realm_name'] }}'
-    --setup-dns --auto-forwarders --auto-reverse -U
+    ipa-server-install -n '{{ hostvars['127.0.0.1']['domain_name'] }}' --hostname='{{ server_hostname }}' -a '{{ hostvars['127.0.0.1']['ipa_admin_password'] }}'
+    -p '{{ hostvars['127.0.0.1']['directory_manager_password'] }}' -r '{{ hostvars['127.0.0.1']['realm_name'] }}' --setup-dns --auto-forwarders --auto-reverse -U
   changed_when: true
   changed_when: true
   no_log: true
   no_log: true
 
 
@@ -49,4 +47,4 @@
     src: "{{ temp_resolv_conf_path }}"
     src: "{{ temp_resolv_conf_path }}"
     dest: "{{ resolv_conf_path }}"
     dest: "{{ resolv_conf_path }}"
     mode: "{{ file_mode }}"
     mode: "{{ file_mode }}"
-    remote_src: yes
+    remote_src: yes

+ 5 - 5
roles/slurm_exporter/tasks/main.yml

@@ -16,8 +16,8 @@
 - name: Verify if slurm-exporter is already installed
 - name: Verify if slurm-exporter is already installed
   command: ls /usr/bin/prometheus-slurm-exporter
   command: ls /usr/bin/prometheus-slurm-exporter
   register: slurm_exporter_status
   register: slurm_exporter_status
-  changed_when: False
-  ignore_errors: yes
+  changed_when: false
+  failed_when: false
 
 
 - name: Install slurm exporter
 - name: Install slurm exporter
   include_tasks: install_slurm_exporter.yml
   include_tasks: install_slurm_exporter.yml
@@ -29,11 +29,11 @@
 - name: Verify if kubernetes is already installed
 - name: Verify if kubernetes is already installed
   command: ls /usr/bin/kubectl
   command: ls /usr/bin/kubectl
   register: k8s_installation_status
   register: k8s_installation_status
-  changed_when: False
-  ignore_errors: yes
+  changed_when: false
+  failed_when: false
 
 
 - name: Install prometheus on host
 - name: Install prometheus on host
   include_tasks: install_prometheus.yml
   include_tasks: install_prometheus.yml
   when:
   when:
     - "'kubernetes' in ansible_skip_tags"
     - "'kubernetes' in ansible_skip_tags"
-    - "'No such file' in k8s_installation_status.stderr"
+    - "'No such file' in k8s_installation_status.stderr"