From 495547f28af90be5652193d7ba4722dedf038f09 Mon Sep 17 00:00:00 2001 From: Arvind Shyamsundar Date: Mon, 20 Nov 2023 20:27:52 -0800 Subject: [PATCH] Address miscellaneous issues * Address an Ansible deprecation warning by changing the ansible.cfg file to use `callbacks_enabled`. * Use native Ansible module to create ADLS Gen2 storage accounts. * Resize filesystems to match provisioned disk space. * Move user specific environment (PATH definition) to bashrc to ensure that SSH command invocation also leverages correct path definition. --- ansible/conf/ansible.cfg | 2 +- ansible/roles/azure/tasks/create_adlsgen2.yml | 23 +++++++------------ ansible/roles/common/tasks/azure.yml | 1 + ansible/roles/common/templates/bash_profile | 2 -- ansible/roles/common/templates/bashrc | 7 ++++++ 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/ansible/conf/ansible.cfg b/ansible/conf/ansible.cfg index e99d4ed3..65e5f0b8 100644 --- a/ansible/conf/ansible.cfg +++ b/ansible/conf/ansible.cfg @@ -17,5 +17,5 @@ host_key_checking = False forks = 50 gathering = smart -callback_whitelist = profile_tasks +callbacks_enabled = profile_tasks timeout=30 diff --git a/ansible/roles/azure/tasks/create_adlsgen2.yml b/ansible/roles/azure/tasks/create_adlsgen2.yml index 71c783f7..d4fedd0c 100644 --- a/ansible/roles/azure/tasks/create_adlsgen2.yml +++ b/ansible/roles/azure/tasks/create_adlsgen2.yml @@ -69,7 +69,7 @@ set_fact: InstanceVolumes: "{{ InstanceVolumesManual if instance_volumes_input.split('|')[0].split(',') == [''] else InstanceVolumesAuto }}" -- name: Update instance_volumes_adls in muchos.props +- name: Update instance_volumes_adls in muchos.props lineinfile: path: "{{ deploy_path }}/conf/muchos.props" regexp: '^instance_volumes_adls\s*=\s*|^[#]instance_volumes_adls\s*=\s*' @@ -77,21 +77,14 @@ # Not registering variable because storage values are not visible immediately - name: Create ADLS Gen2 storage account using REST API - azure_rm_resource: - resource_group: "{{ resource_group }}" - provider: Storage - resource_type: storageAccounts - resource_name: "{{ item.split('@')[1].split('.')[0] }}" - api_version: "2019-04-01" - idempotency: yes + azure.azcollection.azure_rm_storageaccount: state: present - body: - sku: - name: "{{ adls_storage_type }}" - kind: StorageV2 - properties: - isHnsEnabled: yes - location: "{{ location }}" + resource_group: "{{ resource_group }}" + name: "{{ item.split('@')[1].split('.')[0] }}" + type: "{{ adls_storage_type }}" + kind: "StorageV2" + is_hns_enabled: True + location: "{{ location }}" loop: "{{ InstanceVolumes }}" # Creating User Assigned identity with vmss_name suffixed by ua-msi if not specified in muchos.props diff --git a/ansible/roles/common/tasks/azure.yml b/ansible/roles/common/tasks/azure.yml index 20a31048..a69cc721 100644 --- a/ansible/roles/common/tasks/azure.yml +++ b/ansible/roles/common/tasks/azure.yml @@ -24,6 +24,7 @@ filesystem: fstype: xfs dev: "{{ item.path }}" + resizefs: yes with_items: "{{ files_matched.files }}" - name: Get UUID command: "blkid {{ item.path }} -s UUID -o value" diff --git a/ansible/roles/common/templates/bash_profile b/ansible/roles/common/templates/bash_profile index af790875..719140b0 100644 --- a/ansible/roles/common/templates/bash_profile +++ b/ansible/roles/common/templates/bash_profile @@ -7,8 +7,6 @@ fi # User specific environment and startup programs PATH=$JAVA_HOME/bin:$PATH -PATH=$PATH:$HOME/.local/bin -PATH=$PATH:$HOME/bin PATH=$PATH:{{ accumulo_home }}/bin PATH=$PATH:{{ fluo_home }}/bin PATH=$PATH:{{ fluo_yarn_home }}/bin diff --git a/ansible/roles/common/templates/bashrc b/ansible/roles/common/templates/bashrc index fd6b387b..604aabf0 100644 --- a/ansible/roles/common/templates/bashrc +++ b/ansible/roles/common/templates/bashrc @@ -5,6 +5,13 @@ if [ -f /etc/bashrc ]; then . /etc/bashrc fi +# User specific environment +if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]] +then + PATH="$HOME/.local/bin:$HOME/bin:$PATH" +fi +export PATH + export JAVA_HOME={{ java_home }} {% if hadoop_major_version == '2' %}