Skip to content

Ability to provide access key and secret at S3 user creation #318

@kdautrey

Description

@kdautrey

Summary

Use case : I would like to create an S3 user with a specific Access Key and secret.
Why ? I need to create the users with the same key and secret on multiple systems for a DRP scenario.
CLI command : object-store-server user create -vserver SERVER -user USER -access-key "ACCESS_KEY_ID" -secret-key "SECRET"
Proposal : add optional parameters like "access_key" and "secret_key" which would be used only if the user does not already exist.

Component Name

na_ontap_s3_users

Additional Information

- name: Generate random access_secret with length 40
  ansible.builtin.set_fact:
    access_secret: "{{ lookup('community.general.random_string', min_upper=1, min_special=1, override_special='_', min_numeric=1, length=40) }}"

- name: Generate random access_key with length 20
  ansible.builtin.set_fact:
    access_key: "{{ lookup('community.general.random_string', min_upper=1, min_special=1, override_special='_', min_numeric=1, length=20) }}"

- name: Create user with provided access keys
   netapp.ontap.na_ontap_s3_users:
    state: present
    name: "{{ s3_admin_user }}"
    vserver: "{{ vserver }}"
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"
    https: true
    validate_certs: false
    use_rest: always
    access_key: "{{ access_key }}"
    access_secret: {{ access_secret }}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions