You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fluo.apache.org by ar...@apache.org on 2021/12/16 21:33:36 UTC

[fluo-muchos] branch main updated: Use cloud-init for Azure deployments (#420)

This is an automated email from the ASF dual-hosted git repository.

arvindsh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluo-muchos.git


The following commit(s) were added to refs/heads/main by this push:
     new 912a3b0  Use cloud-init for Azure deployments (#420)
912a3b0 is described below

commit 912a3b0c6fe19dc014c7b85f90b13c78f6a5fe45
Author: Arvind Shyamsundar <ar...@apache.org>
AuthorDate: Thu Dec 16 13:33:13 2021 -0800

    Use cloud-init for Azure deployments (#420)
    
    Define and use a cloud-init config which is then passed to the Azure
    instance creation modules as custom data. Currently the only
    per-instance configuration specified is to upgrade the existing CentOS
    packages on the VM. This also provides an interim Azure-specific
    solution to an Azure-specific requirement (as there is not a more recent
    version of CentOS 7.x for Azure). Without this, currently Muchos cannot
    be used to setup a cluster on Azure as the CA certificates are outdated
    and prevent Ansible from downloading tarballs on the proxy host.
    
    Future work will be done to evaluate and potentially use a more modern
    default image for Azure, as well as generalize using cloud-init  across
    both EC2 and Azure cluster types in Muchos.
---
 ansible/roles/azure/files/cloud-init.yml           | 23 ++++++++++++++++++++++
 ansible/roles/azure/tasks/create_multiple_vmss.yml |  1 +
 .../roles/azure/tasks/create_optional_proxy.yml    |  1 +
 ansible/roles/azure/tasks/create_vmss.yml          |  1 +
 4 files changed, 26 insertions(+)

diff --git a/ansible/roles/azure/files/cloud-init.yml b/ansible/roles/azure/files/cloud-init.yml
new file mode 100644
index 0000000..e658085
--- /dev/null
+++ b/ansible/roles/azure/files/cloud-init.yml
@@ -0,0 +1,23 @@
+#cloud-config
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+#
+# NOTE: do not modify the first line in this file - it is a mandatory
+# header to designate the contents as a cloud-init configuration
+#
+# Upgrade the instance on first boot:
+package_upgrade: true
diff --git a/ansible/roles/azure/tasks/create_multiple_vmss.yml b/ansible/roles/azure/tasks/create_multiple_vmss.yml
index dd17caf..0eda6b5 100644
--- a/ansible/roles/azure/tasks/create_multiple_vmss.yml
+++ b/ansible/roles/azure/tasks/create_multiple_vmss.yml
@@ -63,6 +63,7 @@
         {%- set _ = data_disks.append({'lun': lun, 'disk_size_gb': item.data_disk_size_gb, 'managed_disk_type': item.data_disk_sku, 'caching': item.data_disk_caching|default('ReadOnly') }) -%}
       {%- endfor -%}
       {{ data_disks }}
+    custom_data: "{{ lookup('file', 'cloud-init.yml') }}"
   with_items:
     - "{{ azure_multiple_vmss_vars.vars_list }}"
   vars:
diff --git a/ansible/roles/azure/tasks/create_optional_proxy.yml b/ansible/roles/azure/tasks/create_optional_proxy.yml
index 2933a16..6845307 100644
--- a/ansible/roles/azure/tasks/create_optional_proxy.yml
+++ b/ansible/roles/azure/tasks/create_optional_proxy.yml
@@ -83,6 +83,7 @@
      - lun: 0
        disk_size_gb: 64
        managed_disk_type: "{{ data_disk_sku }}"
+    custom_data: "{{ lookup('file', 'cloud-init.yml') }}"
   vars:
   - image_offer: "{{ azure_proxy_image_reference.split('|')[0] }}"
   - image_publisher: "{{ azure_proxy_image_reference.split('|')[1] }}"
diff --git a/ansible/roles/azure/tasks/create_vmss.yml b/ansible/roles/azure/tasks/create_vmss.yml
index b520f18..cf85207 100644
--- a/ansible/roles/azure/tasks/create_vmss.yml
+++ b/ansible/roles/azure/tasks/create_vmss.yml
@@ -66,6 +66,7 @@
       sku: "{{ image_sku if image_sku else omit }}"
       version: "{{ image_version if image_version else omit }}"
     data_disks: "{{ luns_dict if data_disk_count > 0 else omit }}"
+    custom_data: "{{ lookup('file', 'cloud-init.yml') }}"
   vars:
   - image_offer: "{{ azure_image_reference.split('|')[0] }}"
   - image_publisher: "{{ azure_image_reference.split('|')[1] }}"