-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add possibility of collecting accessKey from root user and not just current user #13
Comments
@devasmith can you clarify some details about this request... When you say "impersonating an account" in the GUI, this still logging into a particular tenancy with specific credentials right? In the proposed playbook you're looping over the list of tenants and getting a token for each, so this makes sense. But then you want to collect access keys for the root user of each tenancy. These wouldn't exist though if you've only just created the tenancy? Additionally, the API doesn't return s3 key details after they're created so it wouldn't be possible to read the key like this. The other issue I see is in the last task for creating an s3 key for users - the API doesn't allow explicitly setting an access key ID when creating a key. This is system generated instead. |
@joshedmonds thanks for getting back to me. Yes that is correct. I've solved this with the uri module as shown below. - name: Gather access keys information from root user
ansible.builtin.uri:
url: "{{ grid_admin_base_url }}/api/v3/org/users/00000000-0000-0000-0000-000000000000/s3-access-keys"
headers:
Authorization: "Bearer {{ item.0.json.data }}"
accept: application/json
method: get
body_format: json
check_mode: false
register: sg_root_access_keys
loop_control:
label: "{{ item.1.name }}"
loop: "{{ auth.results | zip(sg_tenants) | list }}"
- name: Create s3 keys on root user for our tenant if no keys exists
netapp.storagegrid.na_sg_org_user_s3_key:
api_url: "{{ grid_admin_base_url }}"
auth_token: "{{ item.0.json.data }}"
state: present
unique_user_name: "{{ sg_unique_user_name }}"
register: sg_s3keys
loop: "{{ auth.results | zip(sg_root_access_keys.results, sg_tenants) | list }}"
loop_control:
label: "{{ item.2.name }}"
when: not item.1.json.data | length > 0 The issue that I wanted to get away from was to not generate a new access key if one already exists. |
Understood, thanks! Will create an internal ticket to look at uplifting the na_sg_org_info module to provide this capability. |
SUMMARY
Is it possible to add a feature for getting information about s3 access keys that is associated with the
root
account and possible other accounts?You can get there in the GUI by impersonating an account -> Users -> root -> Access keys.
We are using federated accounts that has root access to acquire the necessary tokens.
ISSUE TYPE
COMPONENT NAME
netapp.storagegrid.na_sg_org_info
ADDITIONAL INFORMATION
At the moment we store access keys within the
root
user. We would like to gitops the procedure of creating buckets and s3 keys. Example play below.The text was updated successfully, but these errors were encountered: