Skip to content

Commit

Permalink
removed the duplicate content
Browse files Browse the repository at this point in the history
Signed-off-by: dishanktiwari2501 <dtiwari@progress.com>
  • Loading branch information
dishanktiwari2501 committed Jul 11, 2023
1 parent 9a157ee commit d6efef3
Showing 1 changed file with 26 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,108 +11,42 @@ gh_repo = "automate"
weight = 75
+++

This page will discuss the integration of Supermarket with Automate HA setup. The page will guide you to register an existing private Supermarket with [on-premises deployment](/automate/ha_onprim_deployment_procedure/) of Automate HA. Refer to the [Supermarket Integration](/automate/supermarket_integration_with_automate/) page to configure and integrate an existing private Supermarket with an Airgapped installation of Chef Automate.
This page will discuss the integration of Supermarket with Automate HA setup. The page will guide you to register an existing private Supermarket with [on-premises deployment](/automate/ha_onprim_deployment_procedure/) of Automate HA. Refer to the configure and integrate an existing private Supermarket with an Airgapped installation of Chef Automate.

## Register Supermarket with Automate HA

The steps to register a supermarket with Automate HA is as follows:

1. SSH into the Bastion node of Automate HA On-Premises setup. Then switch to root user using below command:

```bash
sudo su
```

1. Create a file named `ocid-apps.toml`, and mention the **name** and the **redirect_uri** for the application, e.g., *Supermarket*. The content of the created file should be in the following format:

```toml
[ocid.v1.sys.ocid.oauth_application_config]
[[ocid.v1.sys.ocid.oauth_application_config.oauth_applications]]
name = ""
redirect_uri = ""
```

Update the URL of the supermarket website in the `redirect_uri` as per the actual supermarket URL. Refer to the code below:

```toml
[ocid.v1.sys.ocid.oauth_application_config]
[[ocid.v1.sys.ocid.oauth_application_config.oauth_applications]]
name = "supermarket"
redirect_uri = "https://example-supermarket.com/auth/chef_oauth2/callback"
```

1. run the command: `config patch` with the `.toml` file you created in the previous step on all the automate and chef-server nodes from the bastion node. The commands to patch are as follows:

```bash
# Run patch on Automate nodes
chef-automate config patch ocid-apps.toml -a
```

```bash
# Run patch on Chef Server nodes
chef-automate config patch ocid-apps.toml -c
```

Once the patch is completed, the new app should be registered with OC-ID as part of Automate embedded chef-server.
Before starting this page, refer to the [Supermarket Integration](/automate/supermarket_integration_with_automate/) page with Automate for basic understanding.

1. Get the details of the registered applications from the bastion node, and run the following command:

```bash
# Get details from Automate Nodes
chef-automate config oc-id-show-app -a
```

The above command will fetch the details of all the registered OC-ID applications from all the Automate nodes. To know about the different flags to be used with this command, run the following command(help command):

```bash
# Get Help Page
chef-automate config oc-id-show-app -h
```

The output of the above command looks like as shown below:

{{< figure src="/images/automate/ha_output_ocid_app.png" alt="OC-ID Application Output">}}

## Configuration of Supermarket

1. Now, SSH into the supermarket instance and run the following commands in sequence:

```bash
sudo su
cd /etc/supermarket
```

1. Once you are in the path `/etc/supermarket`, edit the file `supermarket.rb` to update the details of the **UID**, **secret**, **chef-server-endpoint**, and **ssl-verify-mode** as per the details of the registered OC-ID apps found in the steps above where you have registered the supermarket application. Refer to the snippet below:

```bash
default['supermarket']['chef_oauth2_app_id'] = "<UID>"
default['supermarket']['chef_oauth2_secret'] = "<Secret>"
default['supermarket']['chef_oauth2_url'] = "<Automate HA load balancer FQDN>"
default['supermarket']['chef_oauth2_verify_ssl'] = false
```

The datatype of the attribute: `chef_oauth2_verify_ssl` is a boolean. The value will depend on whether your automate runs with a valid SSL certificate. If Automate runs with a valid SSL certificate, it should be set as `true`; otherwise, specify it as `false`.
## Register Supermarket with Automate HA

1. Now run the `reconfigure` command to reflect the above changes in the running supermarket application configuration:
The steps to register a supermarket with Automate HA is same as that of [Standalone](/automate/supermarket_integration_with_automate/#register-supermarket-with-automate-embedded-chef-identity). The patching of the `.toml` file is different for Automate HA.

```bash
supermarket-ctl reconfigure
```
Here you have to run the `config patch` command with the `.toml` file you created in the previous step on all the automate and chef-server nodes from the bastion node. The commands to patch in Automate HA are as follows:

1. Once the reconfiguration is completed, visit the supermarket website on the browser. Refer to the image below:
```bash
# Run patch on Automate nodes
chef-automate config patch ocid-apps.toml -a
```

{{< figure src="/images/automate/ha_supemarket_landing_page.png" alt="Supermarket Landing Page">}}
```bash
# Run patch on Chef Server nodes
chef-automate config patch ocid-apps.toml -c
```

1. Select Sign In. You should see the OC-ID login page from the Automate HA website if the configuration is done properly. Refer to the image below:
Once the patch is completed, the new app should be registered with OC-ID as part of Automate embedded chef-server.

{{< figure src="/images/automate/ha_supermaket_sign-in.png" alt="Supermarket Sign In Page">}}
You can get the details of the registered applications from the bastion node, and run the following command:

1. Put the correct credentials of `chef-server` running as part of Automate HA and select Sign In. A screen will appear to authorize the supermarket application. Select **Yes**.
```bash
# Get details from Automate Nodes
chef-automate config oc-id-show-app -a
```

{{< figure src="/images/automate/ha_supermaket_authorization.png" alt="Supermarket Credentials">}}
The above command will fetch the details of all the registered OC-ID applications from all the Automate nodes. To know about the different flags to be used with this command, run the following command(help command):

1. Once the supermarket application is successfully authorized, the screen looks like as shown in the image below:
```bash
# Get Help Page
chef-automate config oc-id-show-app -h
```

{{< figure src="/images/automate/ha_supermarket_app_board.png" alt="Supermarket Board">}}
The output of the above command looks like as shown below:

You have now successfully logged in to the supermarket using the credentials of `chef-server` through the **OC-ID** service running as part of Automate HA.
{{< figure src="/images/automate/ha_output_ocid_app.png" alt="OC-ID Application Output">}}

0 comments on commit d6efef3

Please sign in to comment.