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

Unauthenticated Endpoint Support #16

Open
rvalle opened this issue Aug 8, 2020 · 6 comments
Open

Unauthenticated Endpoint Support #16

rvalle opened this issue Aug 8, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@rvalle
Copy link
Collaborator

rvalle commented Aug 8, 2020

Hi

I am trying to get a fully automated ACS deployment.

I use playbooks to install ACS and then I continue with these modules to configure ACS.

There is a missing link in the right in the middle.

I need an automated way to configure the credentials (API Token) for Ansible modules to work.

Is it possible to use username/password authentication in these Ansible Modules? CMK can handle either username/password or TOKEN auth.

That would allow to create the API token and then switch to TOKEN authentication afterwards.

@resmo
Copy link
Member

resmo commented Aug 8, 2020

Hi @rvalle

The api library used (https://github.com/exoscale/cs) in the modules does not allow to auth with username and password (AFAICS). However, the way I we do in the cloustack test container (to test the modules against the simulator api) is to use the internal API which allows unauthenticated api calls on localhost:8096.

To get an idea see https://github.com/ansible/cloudstack-test-container/blob/master/run.sh

@rvalle
Copy link
Collaborator Author

rvalle commented Aug 9, 2020

@resmo my current workaround is to install cloudmonkey and do it with it, but since it is not packaged is a bit messy.

I did not realize that cs has a CLI, that helps.

Perhaps we could allow usage of the modules on the unauthenticated endpoint for edge use cases like this one? what do you think?

if not all([api_config['endpoint'], api_config['key'], api_config['secret']]):

@resmo
Copy link
Member

resmo commented Aug 9, 2020

Yes, perhaps.

I found it good enough for this special case to use dummy values for secret and key since as they are not validated by the internal API.

@resmo resmo added the enhancement New feature or request label Aug 9, 2020
@rvalle
Copy link
Collaborator Author

rvalle commented Aug 10, 2020

OK, I see. I did not think of that. So, this use case was supported, after all.
Would be useful to document it.

Document or we could allow a setting such as:

api_url_auth: false 

which simply disables the check for TOKEN, and defaults to true.
Its more of less the same but would produce self documented playbooks, and it is actually a feature:

something like:

- name: Configure initial Admin password, get keys.
  cs_user:
    api_url: localhost:8080
    api_url_auth: false
    ...
  register: acs_admin_user
  delegate_to: manager

If you want this I can submit a PR...

@rvalle rvalle changed the title Username/Password authentication Unauthenticated Endpoint Support Aug 22, 2020
@rvalle
Copy link
Collaborator Author

rvalle commented Jan 28, 2021

...
However, the way I we do in the cloustack test container (to test the modules against the simulator api) is to use the internal API which allows unauthenticated api calls on localhost:8096.

@resmo any idea how to get that port working on the manager?

I can find a reference in the documentation for manager HA. but in my install the port is not up.

@rvalle
Copy link
Collaborator Author

rvalle commented Jan 28, 2021

I can see here: apache/cloudstack#3504 that the port ships disabled with global configuration:

integration.api.port=0

but I wonder if I can override its value without using the API

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

No branches or pull requests

2 participants