<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom Users in User Data in HPE Morpheus Enterprise</title>
    <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/custom-users-in-user-data/m-p/7249742#M2916</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I recently had a request for help completely overriding the users list within the Cloud Init User Data of a virtual machine deployment. Please note this is an edge case requirement. Morpheus automatically configures users within Cloud Init for you, and you should not need to use this approach. It serves as an example for custom Cloud Init User Data only. You should be able to achieve what you need with Users and User Groups in Morpheus.&lt;/P&gt;
&lt;P&gt;I will briefly document how you can achieve this below. This assumes prior knowledge of Morpheus Variables, Option Type Inputs and the customOptions variable, Cloud Init User Data and also Morpheus library items.&lt;BR /&gt;
This example will allow someone to dynamically change the name of the custom user in the User Data during deployment. This can be extended further to support additional users, password configuration and Cypher secrets.&lt;/P&gt;
&lt;P&gt;Add the custom user data to the Virtual Image settings for the library item. This could also be set on the Cloud level settings:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Annotation on 2025-02-19 at 14-02-58"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149659i9BC111DC1D5DBBFF/image-size/large?v=v2&amp;amp;px=2000" role="button" title="33dcad03b9f0946457a784b8b40cfa6df6ad3a91.png" alt="33dcad03b9f0946457a784b8b40cfa6df6ad3a91.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Here is the redacted example user data:&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;users:
  - name: &amp;lt;%= customOptions?.name ?: 'taylor' %&amp;gt;
    lock-passwd: false 
    shell: /bin/bash 
    passwd: &amp;lt;redacted&amp;gt;
    sudo: ALL=(ALL) ALL
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will fallback to setting the name to &lt;CODE style="background : #f0f1f2;"&gt;taylor&lt;/CODE&gt; if the customOption is not specified.&lt;/P&gt;
&lt;P&gt;Create a text option type input with &lt;CODE style="background : #f0f1f2;"&gt;name&lt;/CODE&gt; as the field name:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot on 2025-02-19 at 14-06-06"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149807i71443605BDC8B249/image-size/large?v=v2&amp;amp;px=2000" role="button" title="f8c0230a269852fc709f8db1b37beefc2038dce8.png" alt="f8c0230a269852fc709f8db1b37beefc2038dce8.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Add this to the library item configuration, in this example, I add it to the layout:&lt;BR /&gt;
&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot on 2025-02-19 at 14-06-20"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149535i35469E4DCE474BC3/image-size/large?v=v2&amp;amp;px=2000" role="button" title="a6cf720b5e45088167a1a90e912ff96f30aa78c6.png" alt="a6cf720b5e45088167a1a90e912ff96f30aa78c6.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Now when I deploy the instance using this layout I am presented with a text box to specify a name. The input I specify will be used for the name of the user in the users list.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2025 14:09:28 GMT</pubDate>
    <dc:creator>cdtaylor</dc:creator>
    <dc:date>2025-02-19T14:09:28Z</dc:date>
    <item>
      <title>Custom Users in User Data</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/custom-users-in-user-data/m-p/7249742#M2916</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I recently had a request for help completely overriding the users list within the Cloud Init User Data of a virtual machine deployment. Please note this is an edge case requirement. Morpheus automatically configures users within Cloud Init for you, and you should not need to use this approach. It serves as an example for custom Cloud Init User Data only. You should be able to achieve what you need with Users and User Groups in Morpheus.&lt;/P&gt;
&lt;P&gt;I will briefly document how you can achieve this below. This assumes prior knowledge of Morpheus Variables, Option Type Inputs and the customOptions variable, Cloud Init User Data and also Morpheus library items.&lt;BR /&gt;
This example will allow someone to dynamically change the name of the custom user in the User Data during deployment. This can be extended further to support additional users, password configuration and Cypher secrets.&lt;/P&gt;
&lt;P&gt;Add the custom user data to the Virtual Image settings for the library item. This could also be set on the Cloud level settings:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Annotation on 2025-02-19 at 14-02-58"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149659i9BC111DC1D5DBBFF/image-size/large?v=v2&amp;amp;px=2000" role="button" title="33dcad03b9f0946457a784b8b40cfa6df6ad3a91.png" alt="33dcad03b9f0946457a784b8b40cfa6df6ad3a91.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Here is the redacted example user data:&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;users:
  - name: &amp;lt;%= customOptions?.name ?: 'taylor' %&amp;gt;
    lock-passwd: false 
    shell: /bin/bash 
    passwd: &amp;lt;redacted&amp;gt;
    sudo: ALL=(ALL) ALL
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will fallback to setting the name to &lt;CODE style="background : #f0f1f2;"&gt;taylor&lt;/CODE&gt; if the customOption is not specified.&lt;/P&gt;
&lt;P&gt;Create a text option type input with &lt;CODE style="background : #f0f1f2;"&gt;name&lt;/CODE&gt; as the field name:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot on 2025-02-19 at 14-06-06"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149807i71443605BDC8B249/image-size/large?v=v2&amp;amp;px=2000" role="button" title="f8c0230a269852fc709f8db1b37beefc2038dce8.png" alt="f8c0230a269852fc709f8db1b37beefc2038dce8.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Add this to the library item configuration, in this example, I add it to the layout:&lt;BR /&gt;
&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot on 2025-02-19 at 14-06-20"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149535i35469E4DCE474BC3/image-size/large?v=v2&amp;amp;px=2000" role="button" title="a6cf720b5e45088167a1a90e912ff96f30aa78c6.png" alt="a6cf720b5e45088167a1a90e912ff96f30aa78c6.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Now when I deploy the instance using this layout I am presented with a text box to specify a name. The input I specify will be used for the name of the user in the users list.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 14:09:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise/custom-users-in-user-data/m-p/7249742#M2916</guid>
      <dc:creator>cdtaylor</dc:creator>
      <dc:date>2025-02-19T14:09:28Z</dc:date>
    </item>
  </channel>
</rss>

