<?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 Re: Automating a phpIPAM deployment with a catalog item in HPE Morpheus Enterprise</title>
    <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/automating-a-phpipam-deployment-with-a-catalog-item/m-p/7248576#M1750</link>
    <description>&lt;P&gt;This is amazing!  I love it&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 13:53:31 GMT</pubDate>
    <dc:creator />
    <dc:date>2023-08-28T13:53:31Z</dc:date>
    <item>
      <title>Automating a phpIPAM deployment with a catalog item</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/automating-a-phpipam-deployment-with-a-catalog-item/m-p/7248574#M1748</link>
      <description>&lt;P&gt;&lt;STRONG&gt;What is covered?&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;phpIPAM&lt;/LI&gt;
&lt;LI&gt;Catalog items&lt;/LI&gt;
&lt;LI&gt;Ansible&lt;/LI&gt;
&lt;LI&gt;Options
&lt;UL&gt;
&lt;LI&gt;Forms&lt;/LI&gt;
&lt;LI&gt;Inputs&lt;/LI&gt;
&lt;LI&gt;REST option lists&lt;/LI&gt;
&lt;LI&gt;Translation scripts&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;File Templates&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;GitHub: &lt;A href="https://github.com/tyboyd02/phpIPAM"&gt;https://github.com/tyboyd02/phpIPAM&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Goal&lt;/STRONG&gt;&lt;BR /&gt;
Create a catalog item to easily deploy different versions of phpIPAM from a dynamic option list, through an automated process with an Ansible playbook.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Adding the Ansible integration to Morpheus&lt;/STRONG&gt;&lt;BR /&gt;
Start by going to integrations under Administration and add the repo that hosts the playbook. You can add the public repo provided above.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Note: The ansible playbook and the Morpheus items have been exported to the repository above.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150023iBE2E9BB7F930E5B8/image-size/large?v=v2&amp;amp;px=2000" role="button" title="e1accdfcf0b8815f0cba99a2d398fb897c29eae0.png" alt="e1accdfcf0b8815f0cba99a2d398fb897c29eae0.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Create a task&lt;/STRONG&gt;&lt;BR /&gt;
This task will use the ansible playbook to install phpIPAM.&lt;BR /&gt;
Under the Library Automation tab add a task.&lt;/P&gt;
&lt;P&gt;Type: Ansible Playbook&lt;BR /&gt;
Ansible Repo: Select the one you added in the previous step.&lt;BR /&gt;
GIT REF: Main&lt;BR /&gt;
Playbook: phpipaminstall.yml&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="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150148i2BBB6864DF930C7B/image-size/large?v=v2&amp;amp;px=2000" role="button" title="97a9a98d868ec9aed57107a089690de1c63f204a.png" alt="97a9a98d868ec9aed57107a089690de1c63f204a.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;You will then create a workflow and add the newly created task in the post-Provision section.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;File Template&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Next, we will take advantage of Morpheus file templates to automatically add the phpIPAM configuration. To do this go to File Templates section under the library templates.&lt;/P&gt;
&lt;P&gt;File Name: phpipam.conf&lt;BR /&gt;
File path: /etc/apache2/sites-available&lt;BR /&gt;
Phase: Post Provision&lt;BR /&gt;
Template:&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;&amp;lt;VirtualHost *:80&amp;gt;
    ServerAdmin admin@example.com
    DocumentRoot "/var/www/html/phpipam"
    ServerName &amp;lt;%=server.internalIp%&amp;gt;
    Redirect permanent / &lt;A href="https://&amp;lt;%=server.internalIp%&amp;gt;" target="_blank"&gt;https://&amp;lt;%=server.internalIp%&amp;gt;&lt;/A&gt;;
    &amp;lt;Directory "/var/www/html/phpipam"&amp;gt;
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    &amp;lt;/Directory&amp;gt;
    ErrorLog "/var/log/apache2/phpipam-error_log"
    CustomLog "/var/log/apache2/phpipam-access_log" combined
&amp;lt;/VirtualHost&amp;gt;

&amp;lt;VirtualHost *:443&amp;gt;
    ServerAdmin adminexample.com
    DocumentRoot "/var/www/html/phpipam"
    ServerName &amp;lt;%=server.internalIp%&amp;gt;
    &amp;lt;Directory "/var/www/html/phpipam"&amp;gt;
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    &amp;lt;/Directory&amp;gt;
    SSLEngine on
    SSLCertificateFile /etc/ssl/phpipam.crt
    SSLCertificateKeyFile /etc/ssl/phpipam.key
    ErrorLog "/var/log/apache2/phpipam-error_log"
    CustomLog "/var/log/apache2/phpipam-access_log" combined
&amp;lt;/VirtualHost&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Later we will add this to the phpIPAM node so it will automatically be added to the server when the catalog item is ordered.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150031iE1404D5362702E53/image-size/large?v=v2&amp;amp;px=2000" role="button" title="a5d8b97358c5b022bce7ec7c3d39af40f513cd58.png" alt="a5d8b97358c5b022bce7ec7c3d39af40f513cd58.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Option lists&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Next, we will make two option lists that will allow you to select what version of phpIPAM you want to be installed in the catalog item. Since phpIPAM has a version currently in development that you can install I first created an option list that lets you select between Development or Production install. Navigate to option lists under Library options.&lt;/P&gt;
&lt;P&gt;Type: Manual&lt;BR /&gt;
Dataset:&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;[
    {"name": "Dev", "value": "Dev"},
    {"name": "Prod", "value": "Prod"}
]
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Following this create a dynamic option list that will pull available versions of phpIPAM. This will take advantage of the rest type and pull the tags available in phpIPAM GitHub.&lt;/P&gt;
&lt;P&gt;Type: REST&lt;BR /&gt;
Source URL: &lt;A href="https://api.github.com/repos/phpipam/phpipam/tags"&gt;https://api.github.com/repos/phpipam/phpipam/tags&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You will need to use a translation script to parse the JSON reply and to only add the version you want to be displayed. From my testing, my playbook only worked from version 1.3.2. Below is the translation script I used.&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;var results = [];
for (var x = 0; x &amp;lt; data.length; x++) {
    var version = data[x].name; 
    if (version.localeCompare("v1.3.2") &amp;gt;= 0) {
        results.push({ name: version, value: data[x].tarball_url });
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Form&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Next, create a form that meets your needs. I created one that allows them to select the name, group assignment, VMware clouds, resource pool, network, Prod or Dev install, version of phpIPAM, and the password for the phpIPAM MySQL user.&lt;/P&gt;
&lt;P&gt;For my use case, it will only be used for quick testing, so I did not give them the ability to choose VM sizing within the forms. If this is needed feel free to add it.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Note: The playbook provided requires Lifecycle state, version, and password to be passed as variables to complete.&lt;/EM&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;morpheus[‘customOptions’][‘lifecyclestage’]&lt;/LI&gt;
&lt;LI&gt;morpheus[‘customOptions’][‘prodversions’]&lt;/LI&gt;
&lt;LI&gt;morpheus[‘customOptions’][‘phpipammysqlpw’]&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149440i5A0FD7A0597F7CF7/image-size/large?v=v2&amp;amp;px=2000" role="button" title="ced88a96718de66b09c4f7f6c758342f13ca65ae.png" alt="ced88a96718de66b09c4f7f6c758342f13ca65ae.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;First, add an input to allow the user to select if they want a production or development install in the development stage. Choose the option list that we created earlier that let the user choose “Dev” or “Prod”&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150510iD5646AD436EB7231/image-size/large?v=v2&amp;amp;px=2000" role="button" title="0cbfad54809d5ca6618432e9b6a6de6edb261065.png" alt="0cbfad54809d5ca6618432e9b6a6de6edb261065.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;We will then want another input that becomes viewable if a prod install is selected that uses our phpIPAM version option list.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149506i4EAD60CB1578BE87/image-size/large?v=v2&amp;amp;px=2000" role="button" title="7a339ba48b8f354faa368da9165cb241dcd53623.png" alt="7a339ba48b8f354faa368da9165cb241dcd53623.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To make it become visible only when prod is selected in the previous option, we will take advantage of the advanced tab at the bottom.&lt;BR /&gt;
Visibility field: lifecyclestage:(Prod$)&lt;/P&gt;
&lt;P&gt;We will also want to make it so it requires a version to be specified when prod is selected.&lt;BR /&gt;
Require filed: lifecyclestage:(Prod$)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150491i66CDF033855220B7/image-size/large?v=v2&amp;amp;px=2000" role="button" title="3daa8bbafcf806cf9e4043e2feebb2033437d3db.png" alt="3daa8bbafcf806cf9e4043e2feebb2033437d3db.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You will also have a section to allow what the phpIPAM mysql password will be.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150467i0C603DDF0400B062/image-size/large?v=v2&amp;amp;px=2000" role="button" title="45e006d8a6fd2566e0a9762f49d94ba25e260998.png" alt="45e006d8a6fd2566e0a9762f49d94ba25e260998.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Instance type&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Under Library, blueprints we will add an instance type to use for our catalog item.&lt;/P&gt;
&lt;P&gt;Create an instance and a layout with the “install phpIPAM” workflow that we created earlier.&lt;/P&gt;
&lt;P&gt;Then create a node within the layout and add the phpIPAM.conf file template here.&lt;BR /&gt;&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149645iBD25A6014CF83771/image-size/large?v=v2&amp;amp;px=2000" role="button" title="1ddbfbecd7bd80de72af12b12f22d3a86819fca5.png" alt="1ddbfbecd7bd80de72af12b12f22d3a86819fca5.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Create a phpIPAM Catalog&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Go to Library, blueprints, catalog items, and click add. Create a new catalog item and fill out the information to your liking. Click Configure and choose the instance type we created earlier. Then follow the prompt and configure it to fit your needs.&lt;/P&gt;
&lt;P&gt;For my purposes, I gave it 2 CPU cores with 8 GB of RAM and 200 GB of disk space.&lt;/P&gt;
&lt;P&gt;Note: You do &lt;STRONG&gt;not&lt;/STRONG&gt; need to select a workflow as it was added to the instance layout.&lt;/P&gt;
&lt;P&gt;Next, add the form we created earlier.&lt;/P&gt;
&lt;P&gt;For the instance name I wanted to be able to leave it blank to follow the naming policy or let them specify a name they wanted. To do this I added logic to the name in the config section.&lt;BR /&gt;
&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150381iD38167CCDB104454/image-size/large?v=v2&amp;amp;px=2000" role="button" title="0c1a80b295448c07935e5102f08fbfedd75f3bc9.png" alt="0c1a80b295448c07935e5102f08fbfedd75f3bc9.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Content&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I also wanted to have a nice home page with text and images that give the user an idea of what the catalog item provides with some additional information. In the Content section, I wrote a home page with markdown.&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;![Image](https://morpheusaio/tools/archives/download/Images/phpipam%20homepage.png)

## phpIPAM
phpIPAM is an open-source web IP address management application (IPAM). Its goal is to provide light IP address management. It is php-based application with MySQL database backend, using jQuery libraries, ajax and HTML5/CSS3 features.

[phpIPAM Releases](https://github.com/phpipam/phpipam/releases)

![Subnet Page](https://morpheusaio/tools/archives/download/Images/phpIPAMsubnet.png)

---

## Default Creds 
* Username: Admin
* Password: ipamadmin

---

## Dev branch: 
Use if you are comfortable using the development release of phpIPAM. 
[Github](https://github.com/phpipam/phpipam)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149437i306510684929C487/image-size/large?v=v2&amp;amp;px=2000" role="button" title="3b5f0f67b31c14f8bfb91ec7c570103fb283a0e9.png" alt="3b5f0f67b31c14f8bfb91ec7c570103fb283a0e9.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This uses Morpheus archives to host the images in a S3 bucket.&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149402i81F1983CCC72D706/image-size/large?v=v2&amp;amp;px=2000" role="button" title="9e86e26ab7ed3307cda14fb5e9ef4da9f5d193f0.png" alt="9e86e26ab7ed3307cda14fb5e9ef4da9f5d193f0.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Final product&lt;BR /&gt;
&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149468i3B3DB2ECFCA0F6DE/image-size/large?v=v2&amp;amp;px=2000" role="button" title="fd9a6c47add3e83ba8d7c7a901ee3227da99409e.jpeg" alt="fd9a6c47add3e83ba8d7c7a901ee3227da99409e.jpeg" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 13:23:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise/automating-a-phpipam-deployment-with-a-catalog-item/m-p/7248574#M1748</guid>
      <dc:creator>tyboyd</dc:creator>
      <dc:date>2023-08-28T13:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a phpIPAM deployment with a catalog item</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/automating-a-phpipam-deployment-with-a-catalog-item/m-p/7248575#M1749</link>
      <description>&lt;P&gt;Stealing this for my Quickstarts. Very nice work &lt;IMG src="https://emoji.discourse-cdn.com/twitter/+1.png?v=12" title=":+1:" class="emoji" alt=":+1:" loading="lazy" width="20" height="20" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 11:57:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise/automating-a-phpipam-deployment-with-a-catalog-item/m-p/7248575#M1749</guid>
      <dc:creator>Ollie-Phillips</dc:creator>
      <dc:date>2023-08-29T11:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a phpIPAM deployment with a catalog item</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/automating-a-phpipam-deployment-with-a-catalog-item/m-p/7248576#M1750</link>
      <description>&lt;P&gt;This is amazing!  I love it&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 13:53:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise/automating-a-phpipam-deployment-with-a-catalog-item/m-p/7248576#M1750</guid>
      <dc:creator />
      <dc:date>2023-08-28T13:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Automating a phpIPAM deployment with a catalog item</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/automating-a-phpipam-deployment-with-a-catalog-item/m-p/7248577#M1751</link>
      <description>&lt;P&gt;Badass!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 13:27:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise/automating-a-phpipam-deployment-with-a-catalog-item/m-p/7248577#M1751</guid>
      <dc:creator>cbunge</dc:creator>
      <dc:date>2023-08-28T13:27:40Z</dc:date>
    </item>
  </channel>
</rss>

