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

add OpenStack to compute_resource #1641

Merged
merged 2 commits into from
Jul 10, 2023

Conversation

alesc
Copy link
Contributor

@alesc alesc commented Jul 7, 2023

Resolves #1640

@alesc alesc force-pushed the openstack-compute-resource branch 2 times, most recently from a50a607 to a767474 Compare July 7, 2023 13:57
@evgeni
Copy link
Member

evgeni commented Jul 9, 2023

From a first glance, this looks good (ignore the Python 2.7 error, it's not your code).

I'd be OK with merging this without additional tests added, as long as the old ones pass (they do).

Is there anything more left on your side? (You marked the PR as draft)

@alesc
Copy link
Contributor Author

alesc commented Jul 10, 2023

This PR is still a draft because even if it works at first pass, the 2nd pass fail.

TASK [set compute resource] ****************************************************
fatal: [localhost]: FAILED! => {
  "changed": false,
  "error": {
    "errors": {
      "provider": [
        "cannot be changed",
        "is not included in the list"
      ]
    },
    "full_messages": [
      "Provider cannot be changed",
      "Provider is not included in the list"
    ],
    "id": 34
  },
  "msg": "Error while performing update on compute_resources: 422 Client Error: Unprocessable Entity for url: https://foreman.lab/api/compute_resources/34"
}

Maybe the provider param should not be sent in the api call.
Any idea ?

@evgeni
Copy link
Member

evgeni commented Jul 10, 2023

can you post the output of ansible-playbook --diff --check <the_playbook.yml>? I wonder why it tries to change the provider at all.

@alesc
Copy link
Contributor Author

alesc commented Jul 10, 2023

That's an case issue, OpenStack != Openstack
I will recheck my change.

$ ansible-playbook --diff --check ansible/foreman.yml
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'
PLAY [localhost] ***************************************************************
TASK [Get organization data] ***************************************************
ok: [localhost]
TASK [set foreman location] ****************************************************
ok: [localhost]
TASK [set compute resource] ****************************************************
--- before
+++ after
@@ -10,9 +10,10 @@
             "organization_ids": [
                 4
             ],
+            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
             "project_domain_id": "xxx",
             "project_domain_name": "lab",
-            "provider": "Openstack",
+            "provider": "OpenStack",
             "tenant": "TEST",
             "url": "https://openstack.lab:5000/v3",
             "user": "xxx"
changed: [localhost]

@evgeni
Copy link
Member

evgeni commented Jul 10, 2023

huh, yeah... let's try with Openstack then

@alesc
Copy link
Contributor Author

alesc commented Jul 10, 2023

From foreman api :

      "provider": "Openstack",
      "provider_friendly_name": "OpenStack",

Curently testing with Openstack in compute_resource module ...

@evgeni
Copy link
Member

evgeni commented Jul 10, 2023

provider is what everything machine should be using (and what is stored in the DB), provider_friendly_name is what gets displayed in the UI for users.

Ansible... would use provider

@alesc alesc force-pushed the openstack-compute-resource branch from a767474 to ecda273 Compare July 10, 2023 11:51
@alesc alesc marked this pull request as ready for review July 10, 2023 11:53
@evgeni evgeni merged commit c0e22b0 into theforeman:develop Jul 10, 2023
@evgeni
Copy link
Member

evgeni commented Jul 10, 2023

Thanks a ton!

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

Successfully merging this pull request may close these issues.

Add provider OpenStack to foreman_compute_resource
2 participants