Saturday, March 26, 2022

InsufficientServicePermissions - Permissions granted to the object storage service principal to this bucket are insufficient

 In OCI, Object Storage, I am getting the below error when trying to create "Lifecycle Management Policy" using REST API.

{

    "code": "InsufficientServicePermissions",

    "message": "Permissions granted to the object storage service principal \"objectstorage-eu-frankfurt-1\" to this bucket are insufficient."

}

Fix the problem:

Create a policy and add the following

Allow group Administrators to read buckets in tenancy

Allow group Administrators to manage objects in tenancy where any {request.permission='OBJECT_CREATE', request.permission='OBJECT_INSPECT'}

Allow service objectstorage-ap-mumbai-1 to manage object-family in tenancy

 

Saturday, March 19, 2022

How to install and setup your Ansible

 We all know that, Ansible is a configuration management tool. Ansible is a simple IT automation tool.

Here in this blog post, I will teach you the very very basic of Ansible.

First of you, I prefer you to install ansible master/control node in your laptop or your workstation.

The installation is very straight forward.

yum install ansible or apt-get install ansible

Verify the version by ansible --version

Configuration file of ansible will be /etc/ansible/ansible.cfg

Let's add one server to your ansible.

Open the file /etc/ansible/hosts

Add the FQDN or IP of the server which you need to install some package to test and save the file.

Ansible works on SSH. Make sure that from your control node/master node you should able to ssh to the other server. If no, please use sshkey password less login.

ansible all -m ping
If you see a response similar to this, then all set you go to your first ansible playbook

aserver.example.org | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}



Thursday, February 10, 2022

Terraform Error: Failed to query available provider packages

Terraform error when executing terraform init command

 Terraform Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider hashicorp/oci: no available releases match the given constraints >= 4.41.0, ~> 4.59.0


Background:

I got a working terraform project from a friend, when I tried to run in my environment, I am getting this error.


My development environment is oracle developer instance, which is already packed with terraform.


After copying the terraform project, I am trying to do a terraform init


[root@shivin-dev-sg terraform]# terraform init

Initializing modules...

Downloading registry.terraform.io/oracle-terraform-modules/vcn/oci 3.2.0 for vcn...

- vcn in .terraform/modules/vcn

- vcn.drg_from_vcn_module in .terraform/modules/vcn/modules/drg


Initializing the backend...


Initializing provider plugins...

- Finding hashicorp/kubernetes versions matching "~> 2.4.1"...

- Finding latest version of hashicorp/local...

- Finding hashicorp/oci versions matching ">= 4.41.0, ~> 4.59.0"...

- Installing hashicorp/kubernetes v2.4.1...

- Installed hashicorp/kubernetes v2.4.1 (signed by HashiCorp)

- Installing hashicorp/local v2.1.0...

- Installed hashicorp/local v2.1.0 (signed by HashiCorp)

Error: Failed to query available provider packages

 

Could not retrieve the list of available versions for provider hashicorp/oci: no available releases match the given constraints >= 4.41.0, ~> 4.59.0


[root@shivin-dev-sg terraform]#


What is the issue and how to fix it?


As you can see from the initalizing provider plugins part, the oci plugin version is 4.41.0 but in our provider.tf the version is 4.59.0. This means somewhere in my machine there is a plugin cache. I need to find delete it for fixing this issue.


Steps to solve the issue:


cd /usr/share/terraform/

rm -rf plugins


cd /root

rm -rf .terraform


cd /path-to-your-terraform

rm -rf .terraform.d


Now, do a terraform init, it will works!!

Thursday, January 27, 2022

How to backup and restore Oracle Integration Cloud (OIC)

How to backup and restore Oracle Integration Cloud (OIC)

 Current Environment : 

  • Oracle Integration Instance
  • Standard Edition
  • 5K messages per hour

How to backup OIC Integration.

  1. Login to your OCI cloud account.
  2. Select "Developer Service" --> "Application Integration" --> "Integration"

    3.    Select your existing OIC instance and click on "Service Console"
    4.    Select "Integrations"
    5.    You could able to see your Integrations endpoints and its configurations.


    6.  Here, in this example, I am taking the backup of "demo" endpoint.
    7.  Mouse over to the "demo" endpoint right side and choose "Actions" --> "Export". 
         It will download the backup in your machine as "DEMO_01.00.00000.iar" file.



How to backup OIC Integration.

  1. Login to your OCI cloud account.
  2. Select "Developer Service" --> "Application Integration" --> "Integration"
  3. Create your new OIC instance.
  4. Select "Integrations"
    
        5. Click on "Import" and upload your previous backup file "DEMO_01.00.00000.iar"
        6. This will restore OIC integration from our older instance to the new instance.

These steps will help to backup and restore Oracle Integration Cloud (OIC).