Skip to content
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

oci_identity_smtp_credential - SMTP password not available while creation a new SMTP credentials #29

Closed
smugljanka opened this issue Nov 8, 2020 · 4 comments

Comments

@smugljanka
Copy link

I'm facing issue with creation SMTP credentials with oci_identity_smtp_credential module. According to description at https://github.com/oracle/oci-ansible-collection/blob/master/docs/collections/oracle/oci/oci_identity_smtp_credential_module.rst it should return both username and password, but password field is absent at all

My environment

  • ansible 2.9.7
  • Python 3.6.8
  • OCI SDK - 2.23.4
  • Collection: oracle.oci == 2.10.0

My task:

  • name: "Creating SMTP credentials..."
    oracle.oci.oci_identity_smtp_credential:
    config_file_location: '{{ oci_config_file_location | default("~/.oci/config") }}'
    user_id: '{{ user_ocid |default("") }}'
    description: '{{ description |default("Default SMTP credentials.") }}'
    register: create_smtp_credentials

Actual result:
TASK [oci-identity-smtp-credentials : debug] ****************************************************************************************************************
ok: [localhost] =>
create_smtp_credentials:
changed: true
failed: false
smtp_credential:
description: SMTP credentials for Email Delivery Microservice
id: ocid1.credential.oc1....
inactive_status: null
lifecycle_state: ACTIVE
time_created: '2020-11-08T17:08:30.960000+00:00'
time_expires: null
user_id: ocid1.user.oc1..a...
username: ocid1.user.oc1..a...@ocid1.tenancy.oc1..aaaaaaaag7qdsfdsf.....9d.com

Expected result:
The response should contain SMTP password

@smugljanka smugljanka changed the title oci_identity_smtp_credential - SMTP password not created while creation a new SMTP credentials oci_identity_smtp_credential - SMTP password not available while creation a new SMTP credentials Nov 8, 2020
@manojmeda
Copy link
Member

Thanks @smugljanka for reporting the issue. I am able to reproduce this issue. We will work on a fix and try to get this fixed in the next release.

@manojmeda
Copy link
Member

@smugljanka The password is only available only on the first API call. The ansible module waits for the resource to come to ACTIVE state and then returns the latest state of the resource by making a GET call which is causing the issue since the subsequent GET calls do not have the password. So until the issue is fixed, the work around is to set the module parameter wait: False which avoids the waiting and thus causes the ansible module to return the response from the initial create request which has the password.

@smugljanka
Copy link
Author

Hi @manojmeda.
Thanks for reply. It's working now with wait: no

@AmeyaLokre
Copy link
Member

Hello @smugljanka , this issue has been fixed in the release 2.11.0. You can use the module without the wait: False and obtain the password in the return parameters after the creating a smtp_credential. Thank you for bringing this to our attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants