MAS DevOps Ansible Collection Ansible CLI
Home Ansible Automation Platform OCP Install Cloud Pak For Data Install Core Add AIBroker Add IoT Add Manage Add Monitor Add Optimizer Add Predict Add Visual Inspection Update Upgrade Uninstall Core Backup & Restore ocp_cluster_monitoring ocp_config ocp_deprovision ocp_efs ocp_github_oauth ocp_login ocp_node_config ocp_provision ocp_roks_upgrade_registry_storage ocp_upgrade ocp_verify appconnect aws_bucket_access_point aws_documentdb_user aws_policy aws_route53 aws_user_creation aws_vpc cert_manager cis common-services configure_manage_eventstreams cos cos_bucket cp4d_admin_pwd_update cp4d cp4d_service db2 dro eck grafana ibm_catalogs kafka nvidia_gpu mongodb ocs sls turbonomic uds mirror_case_prepare mirror_extras_prepare mirror_images mirror_ocp ocp_contentsourcepolicy ocp_simulate_disconnected_network registry suite_app_config suite_app_install suite_app_uninstall suite_app_upgrade suite_app_rollback suite_app_backup_restore suite_certs suite_config suite_db2_setup_for_manage suite_dns suite_install suite_manage_attachments_config suite_manage_birt_report_config suite_manage_bim_config suite_manage_customer_files_config suite_manage_imagestitching_config suite_manage_import_certs_config suite_manage_load_dbc_scripts suite_manage_logging_config suite_manage_pvc_config suite_uninstall suite_upgrade suite_rollback suite_verify suite_backup_restore ansible_version_check entitlement_key_rotation gencfg_jdbc gencfg_watsonstudio gencfg_workspace gencfg_mongo

cos_bucket¤

This role extends support to create or deprovision Cloud Object Storage buckets.

Role Variables¤

cos_type¤

Required. Which COS provider to use; can be set to either ibm for IBM Cloud Object Storage or aws for S3 bucket types (aws support under development).

cos_bucket_action¤

Required. Which action you want to run for the COS bucket. You can either create or delete a COS bucket.

Role Variables - IBM Cloud Object Storage buckets¤

cos_bucket_name¤

Optional name for your IBM Cloud Object Storage bucket.

cos_bucket_storage_class¤

Optional. IBM Cloud Object Storage bucket storage class. Supported options are smart, vault, cold and flex. For more details, see IBM Cloud Object Storage documentation

cos_instance_name¤

Provide the Object Storage instance name, will be used to find the targeted COS instance to create/deprovision the buckets. This is only used when cos_type is set to ibm for IBM Cloud Object Storage.

cos_location_info¤

Required. The location where the COS instance is available

cos_bucket_region_location_type¤

Required. This defines the resiliency of your COS bucket. Supported options are cross_region_location (Highest availability) or region_location (Best performance). For more details, see IBM Cloud Object Storage documentation

cos_bucket_region_location: "{{ lookup('env', 'COS_BUCKET_REGION_LOCATION') | default(bucket_cross_reg_loc, true) }}"

cos_bucket_region_location¤

Required. This defines the specific region of your COS bucket.

For cross_region_location type, the supported regions are us, ap and eu. For region_location type, the supported regions are au-syd, eu-de, eu-gb, jp-tok, us-east, us-south, ca-tor, jp-osa and br-sao.

For more details, see IBM Cloud Object Storage documentation

ibmcloud_region¤

Optional. For cross region location type buckets, the IBM Cloud region can be used as alternative to determine which cross region location to be used while creating the buckets. - Environment Variable: IBMCLOUD_REGION - Default Value: us-east

cos_url¤

Required (For bucket creation). The COS region location url endpoint. Needed to specify the COS bucket region location. - Environment Variable: COS_REGION_LOCATION_URL - Default Value: https://s3.us.cloud-object-storage.appdomain.cloud

cos_plan_type¤

Required (For Provisioning). The plan type of the service - Environment Variable: COS_PLAN - Default Value: standard

resource_key_iam_role¤

Provide an optional role when cos service credential is getting created during COS bucket creation. - Environment Variable: RESOURCE_KEY_IAM_ROLE - Default Value: Manager

ibmcloud_apikey¤

Required if cos_type is set to ibm. Provide your IBM Cloud API Key.

ibmcloud_resourcegroup¤

Only used when cos_type is set to ibm. Provide the name of the resource group which will own the COS instance for the targeted buckets.

Role Variables - AWS S3 Buckets¤

To run this role successfully for AWS s3 buckets, you must have already installed the AWS CLI. Also, you need to have AWS user credentials configured via aws configure command or simply export AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables with your corresponding AWS username credentials prior running this role.

aws_bucket_name¤

Optional name for your AWS/S3 bucket.

aws_region¤

The region where the bucket is located.

aws_bucket_versioning_flag¤

Flag to define if versioning should be enabled for the bucket

aws_bucket_encryption¤

JSON formatted string to define default encryption configuration for AWS S3 bucket.

aws_bucket_force_deletion_flag¤

Deletes S3 AWS bucket objects prior deleting the S3 bucket. This option only works if versioning is not enabled in the bucket. Note: To delete AWS bucket, cos_bucket_action must be set to delete.

Example Playbook¤

Create the IBM Cloud Object storage bucket.

- hosts: localhost
  any_errors_fatal: true
  vars:
    cos_type: ibm
    cos_bucket_action: create
    cos_bucket_name: my-ibm-bucket
    cos_instance_name: my-ibmcos-instance-name
    ibmcloud_apikey: my-ibm-cloud-apikey
  roles:
    - ibm.mas_devops.cos_bucket

Create the AWS S3 storage bucket.

- hosts: localhost
  any_errors_fatal: true
  vars:
    cos_type: aws
    cos_bucket_action: create
    aws_bucket_name: my-aws-bucket
    aws_region: us-east-2
    aws_bucket_versioning_flag: True
    aws_bucket_encryption: '{"Rules": [{"ApplyServerSideEncryptionByDefault": {"SSEAlgorithm": "AES256"}}]}'
  roles:
    - ibm.mas_devops.cos_bucket

License¤

EPL-2.0