Browse Source

Merge pull request #758 from abhishek-sa1/awx_logo

Issue #753: Update AWX logo to Omnia
Sujit Jadhav 3 years ago
parent
commit
b976ecc567

BIN
control_plane/roles/webui_awx/files/omnia.png


+ 33 - 0
control_plane/roles/webui_awx/tasks/awx_logo.yml

@@ -0,0 +1,33 @@
+# Copyright 2022 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: Convert logo to base64
+  shell: >
+    set -o pipefail && \
+    echo -n "data:image/png;base64,$(cat {{ omnia_logo_path }} | base64 | tr -d '\r\n')" > {{ logo_txt_path }}
+  changed_when: false
+
+- name: Fetch logo output
+  command: cat {{ logo_txt_path }}
+  register: logo_base64
+  changed_when: false
+
+- name: Configure AWX logo to Omnia
+  command: awx --conf.host http://{{ awx_cluster_ip.stdout }}:{{ awx_port }} --conf.username admin --conf.password {{ awx_admin_password.stdout }} settings modify CUSTOM_LOGO "{{ logo_base64.stdout }}"
+  changed_when: false
+
+- name: Configure AWX login info
+  command: awx --conf.host http://{{ awx_cluster_ip.stdout }}:{{ awx_port }} --conf.username admin --conf.password {{ awx_admin_password.stdout }} settings modify CUSTOM_LOGIN_INFO "{{ awx_login_info }}"
+  changed_when: false

+ 5 - 6
control_plane/roles/webui_awx/tasks/main.yml

@@ -13,27 +13,26 @@
 # limitations under the License.
 ---
 
-# Tasks for Deploying AWX on the system
+# Tasks for deploying AWX on the system
 
 - name: Internet validation
   include_tasks: ../../control_plane_common/tasks/internet_validation.yml
-  tags: install
 
 - name: Check awx prequisites
   include_tasks: check_prerequisites.yml
-  tags: install
 
 - name: Install AWX
   include_tasks: install_awx.yml
   when: not awx_pod_deployment_status
-  tags: install
 
 - name: Configure settings
   include_tasks: configure_settings.yml
   when: not awx_ui_status
-  tags: install
   
+- name: Changing login logo of AWX UI
+  include_tasks: awx_logo.yml
+  when: not awx_configuration_status
+
 - name: Configure AWX
   include_tasks: awx_configuration.yml
   when: not awx_configuration_status
-  tags: install

+ 7 - 2
control_plane/roles/webui_awx/vars/main.yml

@@ -52,6 +52,11 @@ awx_ui_wait_time: 30
 # Usage: check_prerequisites.yml
 min_retries: 2
 
+# Usage: awx_logo.yml
+awx_login_info: "An open-source toolkit for deploying and managing high performance clusters for HPC, AI, and data analytics workloads."
+omnia_logo_path: "{{ role_path }}/files/omnia.png"
+logo_txt_path: "{{ role_path }}/files/.logo_base64.txt"
+
 # Usage: awx_configuration.yml
 default_org: Default
 default_template: 'Demo Job Template'
@@ -77,7 +82,7 @@ credential_details:
   - { name: ethernet_credential, type: Machine, username: "{{ ethernet_switch_username }}", password: "{{ ethernet_switch_password }}", flag: "{{ ethernet_switch_support }}" }
   - { name: infiniband_credential, type: Network, username: "{{ ib_username }}", password: "{{ ib_password }}", flag: "{{ ib_switch_support }}" }
   - { name: powervault_me4_credential, type: Network, username: "{{ powervault_me4_username }}", password: "{{ powervault_me4_password }}", flag: "{{ powervault_support }}" }
-  - { name: node_credential, type: Machine, username: root, password: omnia@123, flag: true }
+  - { name: node_credential, type: Machine, username: root, password: "{{ provision_password }}", flag: true }
 job_template_details:
   - { name: idrac_template, inventory: idrac_inventory, playbook: control_plane/idrac.yml, credential: idrac_credential, flag: true }
   - { name: ethernet_template, inventory: ethernet_inventory, playbook: control_plane/ethernet.yml, credential: ethernet_credential, flag: "{{ ethernet_switch_support }}" }
@@ -89,4 +94,4 @@ omnia_job_template_details:
   - { name: deploy_omnia_template, inventory: node_inventory, playbook: omnia.yml, credential: node_credential }  
 scheduled_templates:
   - { name: NodeInventorySchedule, template: node_inventory_job, schedule_rule: "DTSTART:20210815T120000Z RRULE:FREQ=MINUTELY;INTERVAL=10" }
-  - { name: DeviceInventorySchedule, template: device_inventory_job, schedule_rule: "DTSTART:20210815T060000Z RRULE:FREQ=DAILY;INTERVAL=1"}
+  - { name: DeviceInventorySchedule, template: device_inventory_job, schedule_rule: "DTSTART:20210815T060000Z RRULE:FREQ=DAILY;INTERVAL=1"}