link icon replaced

This commit is contained in:
govardhan
2025-06-19 14:09:10 +05:30
parent 60adbde60c
commit 172f8e2b34
158 changed files with 996 additions and 996 deletions

View File

@ -1,4 +1,4 @@
Authenticating with OpenstackSDK using Keycloak Credentials on CloudFerro Cloud[](#authenticating-with-openstacksdk-using-keycloak-credentials-on-brand-name "Permalink to this headline")
Authenticating with OpenstackSDK using Keycloak Credentials on CloudFerro Cloud[🔗](#authenticating-with-openstacksdk-using-keycloak-credentials-on-brand-name "Permalink to this headline")
===========================================================================================================================================================================================
If you are using OpenStackSDK to write your own script for OpenStack, the code in this tutorial will **enable the user to automatically log into your app**. When the user normally tries to log into the CloudFerro Cloud account using <https://portal.cloudferro.com/>, they have to log in manually. A screen like this appears:
@ -7,7 +7,7 @@ If you are using OpenStackSDK to write your own script for OpenStack, the code i
If they already have an account, they will be logged in after clicking on Login button. The code in this article will avoid exposing the user to such a procedure and if they had ever been authenticated to OpenStack, **the user will be able to log in with your code without even seeing the login screen**.
What Are We Going To Do[](#what-are-we-going-to-do "Permalink to this headline")
What Are We Going To Do[🔗](#what-are-we-going-to-do "Permalink to this headline")
---------------------------------------------------------------------------------
> * Set up Python, pip and Venv environments,
@ -15,7 +15,7 @@ What Are We Going To Do[](#what-are-we-going-to-do "Permalink to this headlin
> * Source that file (execute it and supply the password to authenticate yourself to the system),
> * Prepare Python code to authenticate to Keycloak by using the values from RC file.
Prerequisites[](#prerequisites "Permalink to this headline")
Prerequisites[🔗](#prerequisites "Permalink to this headline")
-------------------------------------------------------------
**No. 1 Install Python and its environment**
@ -26,7 +26,7 @@ The following article will help you install Python and **pip**, as well as **Ven
RC file is available from the OpenStack Horizon module and serves as a source of authentication for the user. For technical details how to get it and activate, see [How To Install OpenStack and Magnum Clients for Command Line Interface to CloudFerro Cloud Horizon](../kubernetes/How-To-Install-OpenStack-and-Magnum-Clients-for-Command-Line-Interface-to-CloudFerro-Cloud-Horizon.html.md).
Step 1 Source Your RC File[](#step-1-source-your-rc-file "Permalink to this headline")
Step 1 Source Your RC File[🔗](#step-1-source-your-rc-file "Permalink to this headline")
---------------------------------------------------------------------------------------
Using **Prerequisite No. 2**, download the corresponding RC file. That file can be executed using a **source** command in Linux/UNIX environments. Once executed, it will ask you for the password and will authenticate you with it.
@ -52,7 +52,7 @@ export OS_CLIENT_SECRET=50xx4972-546x-46x9-8x72-x91x401x8x30
```
Step 2 Create Python Code that Will Perform Keycloak Authentication Within Your App[](#step-2-create-python-code-that-will-perform-keycloak-authentication-within-your-app "Permalink to this headline")
Step 2 Create Python Code that Will Perform Keycloak Authentication Within Your App[🔗](#step-2-create-python-code-that-will-perform-keycloak-authentication-within-your-app "Permalink to this headline")
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
In this step you will copy the values from RC file to your Python code. For instance, variable
@ -92,7 +92,7 @@ auth['protocol'] = 'openid'
```
Step 3 Use the Code in Your App[](#step-3-use-the-code-in-your-app "Permalink to this headline")
Step 3 Use the Code in Your App[🔗](#step-3-use-the-code-in-your-app "Permalink to this headline")
-------------------------------------------------------------------------------------------------
Once generated, this code will authenticate user and they will not have to supply their credentials each time they try to use your app.

View File

@ -1,4 +1,4 @@
Generating and authorizing Terraform using Keycloak user on CloudFerro Cloud[](#generating-and-authorizing-terraform-using-keycloak-user-on-brand-name "Permalink to this headline")
Generating and authorizing Terraform using Keycloak user on CloudFerro Cloud[🔗](#generating-and-authorizing-terraform-using-keycloak-user-on-brand-name "Permalink to this headline")
=====================================================================================================================================================================================
Clicking in Horizon and entering CLI commands are two main ways of using an OpenStack system. They are well suited to interactively executing one command at a time but do not scale up easily. A tool such as [Terraform, by HashiCorp corporation,](https://www.terraform.io/) provides an alternative to manual ways of introducing cascading changes. Here is how you could, say, create several instances at once:
@ -14,7 +14,7 @@ The plan is to install Terraform, get OpenStack token, enter it into the configu
and so on.
What We Are Going To Do[](#what-we-are-going-to-do "Permalink to this headline")
What We Are Going To Do[🔗](#what-we-are-going-to-do "Permalink to this headline")
---------------------------------------------------------------------------------
> * Install Terraform as a root user
@ -25,7 +25,7 @@ What We Are Going To Do[](#what-we-are-going-to-do "Permalink to this headlin
> * Explain the meaning of the variables used
> * Execute the Terraform script
Prerequisites[](#prerequisites "Permalink to this headline")
Prerequisites[🔗](#prerequisites "Permalink to this headline")
-------------------------------------------------------------
No. 1 **Account**
@ -52,7 +52,7 @@ Another article, [How to activate OpenStack CLI access to CloudFerro Cloud cloud
You will use both the Python virtual environment and the downloaded RC file **after** Terraform has been installed.
Step 1 Install Terraform as a root user[](#step-1-install-terraform-as-a-root-user "Permalink to this headline")
Step 1 Install Terraform as a root user[🔗](#step-1-install-terraform-as-a-root-user "Permalink to this headline")
-----------------------------------------------------------------------------------------------------------------
Install the required dependencies using the following command:
@ -95,7 +95,7 @@ su eouser # Exit root mode
```
Step 2 Reconnect to the cloud[](#step-2-reconnect-to-the-cloud "Permalink to this headline")
Step 2 Reconnect to the cloud[🔗](#step-2-reconnect-to-the-cloud "Permalink to this headline")
---------------------------------------------------------------------------------------------
Working through Prerequisites Nos. 2 and 3, you ended up being connected up to the cloud. That connection is now lost because you have switched to **root** user and back again, to the normal **eouser** for the CloudFerro Cloud cloud. Refer to **Prerequisite No. 4 Activate the RC file** to reconnect to the cloud again. The following command will act as a test:
@ -111,7 +111,7 @@ and should present a start of a list of flavors available in the system:
**You are now ready to receive token from the cloud you are working with.** The “token” is actually a very long string of characters which serves as kind of password for your code.
Step 3 Download OpenStack token[](#step-3-download-openstack-token "Permalink to this headline")
Step 3 Download OpenStack token[🔗](#step-3-download-openstack-token "Permalink to this headline")
-------------------------------------------------------------------------------------------------
Get token with the following command:
@ -130,7 +130,7 @@ id="gAAAAABj1VTWP_CFhfKv4zWVH7avFUnHYf5J4TvuKG_Md1EdSpBIBZqTVErqVNWCnO-kYq9D7fi3
Value of variable **id** is the token you need. Copy and save it so that you can enter it into the configuration file for Terraform.
Step 4 Set up the configuration file and initialize Terraform[](#step-4-set-up-the-configuration-file-and-initialize-terraform "Permalink to this headline")
Step 4 Set up the configuration file and initialize Terraform[🔗](#step-4-set-up-the-configuration-file-and-initialize-terraform "Permalink to this headline")
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Create new directory where your Terraform files will be stored and switch to it:
@ -192,7 +192,7 @@ Note
In examples that follow, we use two networks, one with name starting with **cloud\_** and the name of the other starting with **eodata\_**. The former network should always be present in the account, but the latter may or may not present. If you do not have network which name starts with **eodata\_**, you may create it or use any other network that you already have and want to use.
Step 5 Create Terraform code[](#step-5-create-terraform-code "Permalink to this headline")
Step 5 Create Terraform code[🔗](#step-5-create-terraform-code "Permalink to this headline")
-------------------------------------------------------------------------------------------
Append code to the contents of the **yourconffile.tf**. It will generate four virtual machines as specified in the value of variable **count**. The entire file **yourconffile.tf** should now look like this:
@ -232,7 +232,7 @@ name = "cloud_00aaa_3"
```
Always use the latest value of image id[](#always-use-the-latest-value-of-image-id "Permalink to this headline")
Always use the latest value of image id[🔗](#always-use-the-latest-value-of-image-id "Permalink to this headline")
-----------------------------------------------------------------------------------------------------------------
From time to time, the default images of operating systems in the CloudFerro Cloud cloud are upgraded to the new versions. As a consequence, their **image id** will change. Lets say that the image id for Ubuntu 20.04 LTS was **574fe1db-8099-4db4-a543-9e89526d20ae** at the time of writing of this article. While working through the article, you would normally take the **current** value of image id, and would use it to replace **574fe1db-8099-4db4-a543-9e89526d20ae** throughout the text.
@ -243,7 +243,7 @@ Warning
Make sure that your automation code is using the **current value** of an OS image id, not the hardcoded one.
The meaning of the variables used[](#the-meaning-of-the-variables-used "Permalink to this headline")
The meaning of the variables used[🔗](#the-meaning-of-the-variables-used "Permalink to this headline")
-----------------------------------------------------------------------------------------------------
The meaning of the variables used is as follows:
@ -278,7 +278,7 @@ The meaning of the variables used is as follows:
**network**
: Name of the network to use. In this case, we include network **eodata\_00aaa\_3** for eodata and **cloud\_00aaa\_3** for general communication within the cloud.
Step 6 Execute the Terraform script[](#step-6-execute-the-terraform-script "Permalink to this headline")
Step 6 Execute the Terraform script[🔗](#step-6-execute-the-terraform-script "Permalink to this headline")
---------------------------------------------------------------------------------------------------------
Here is how Terraform will create four instances of Ubuntu 20.04 LTS. Command **apply** will execute the script; when asked for confirmation to proceed, type **yes** to start the operation:
@ -316,7 +316,7 @@ terraform destroy
Again, type **yes** to start the operations.
What To Do Next[](#what-to-do-next "Permalink to this headline")
What To Do Next[🔗](#what-to-do-next "Permalink to this headline")
-----------------------------------------------------------------
Of particular interest would be the following CLI commands for Terraform:
@ -339,7 +339,7 @@ terraform -help
to learn other commands Terraform can offer.
What To Do Next[](#id1 "Permalink to this headline")
What To Do Next[🔗](#id1 "Permalink to this headline")
-----------------------------------------------------
Article [How to create a set of VMs using OpenStack Heat Orchestration on CloudFerro Cloud](../openstackcli/How-to-create-a-set-of-VMs-using-OpenStack-Heat-Orchestration-on-CloudFerro-Cloud.html.md) uses orchestration capabilities of OpenStack to automate creation of virtual machines. It is a different approach compared to Terraform but both can lead to automation under OpenStack.