Switch bifrost to openstack.cloud collections

The following changes were made:
- `os_client_config` is `openstack.cloud.config`
- `os_ironic` is `openstack.cloud.baremetal_node`
- `os_ironic_inspect` is `openstack.cloud.baremetal_inspect`
- `os_ironic_node` is `openstack.cloud.baremetal_node_action`
- `os_keystone_role` is `openstack.cloud.identity_role`
- `os_keystone_service` is `openstack.cloud.catalog_service`
- `os_user` is `openstack.cloud.identity_user`
- `os_user_role` is `openstack.cloud.role_assignment`

Change-Id: Id8e2f9c735c6c9d4b7ab2a7e902cd8f9d389d568
This commit is contained in:
Iury Gregory Melo Ferreira 2020-07-24 21:34:22 +02:00
parent df304c2f15
commit 90ec3890fe
11 changed files with 57 additions and 44 deletions

View File

@ -72,4 +72,3 @@
until: node_info.node.provision_state == "active"
retries: "{{ active_state_wait_retries | default(30) }}"
delay: "{{ provision_state_retry_interval | default(20) }}"

View File

@ -18,15 +18,15 @@
auth: {}
when: noauth_mode is defined and noauth_mode | bool == true
- name: "Execute os_client_config to collect facts"
os_client_config:
- name: "Execute openstack.cloud.config to collect facts"
openstack.cloud.config:
no_log: yes
when: noauth_mode is defined and noauth_mode | bool == false
# NOTE(TheJulia): The first record returned by os_client_config
# NOTE(TheJulia): The first record returned by openstack.cloud.config
# is utilized as the default. A user can still define the parameters
# if so desired.
- name: "Set os_client_config's auth parameters if not already set."
- name: "Set openstack.cloud.config auth parameters if not already set."
set_fact:
auth: "{{ openstack.clouds[0].auth }}"
auth_type: "{{ openstack.clouds[0].auth_type }}"

View File

@ -23,7 +23,7 @@ ironic_url: This is the URL to the ironic server. By default, this is set to
network_interface: This is the network interface that the nodes receive
DHCP/PXE/iPXE. This is utilized to generate the url that
Ironic is configured with for image retrieval. This
Ironic is configured with for image retrieval. This
variable does not have a default in this role and expects to
receive this information from the calling playbook.

View File

@ -27,15 +27,15 @@
auth: {}
when: noauth_mode is defined and noauth_mode | bool == true
- name: "Execute os_client_config to collect facts"
os_client_config:
- name: "Execute openstack.cloud.config to collect facts"
openstack.cloud.config:
no_log: yes
when: noauth_mode is defined and noauth_mode | bool == false
# NOTE(TheJulia): The first record returned by os_client_config
# NOTE(TheJulia): The first record returned by openstack.cloud.config
# is utilized as the default. A user can still define the parameters
# if so desired.
- name: "Set os_client_config's auth parameters if not already set."
- name: "Set openstack.cloud.config auth parameters if not already set."
set_fact:
auth: "{{ openstack.clouds[0].auth }}"
auth_type: "{{ openstack.clouds[0].auth_type }}"
@ -70,7 +70,7 @@
when: (inventory_dhcp | bool == true) or (inventory_dns | bool == true)
- name: "Deploy to hardware - Using custom instance_info."
os_ironic_node:
openstack.cloud.baremetal_node_action:
auth_type: "{{ auth_type | default(omit) }}"
auth: "{{ auth | default(omit) }}"
ironic_url: "{{ ironic_url }}"
@ -96,7 +96,7 @@
when: instance_info is not defined and test_deploy_image.stat.exists | bool == false
- name: "Deploy to hardware - bifrost default"
os_ironic_node:
openstack.cloud.baremetal_node_action:
cloud: "{{ cloud_name | default(omit) }}"
auth_type: "{{ auth_type | default(omit) }}"
auth: "{{ auth | default(omit) }}"

View File

@ -52,7 +52,7 @@
no_log: true
- name: "Create service user for ironic"
os_user:
openstack.cloud.identity_user:
name: "{{ ironic.service_catalog.username }}"
password: "{{ ironic.service_catalog.password }}"
state: present
@ -70,7 +70,7 @@
no_log: true
- name: "Associate ironic user to admin role"
os_user_role:
openstack.cloud.role_assignment:
user: "{{ ironic.service_catalog.username }}"
role: "admin"
project: "{{ ironic.service_catalog.project_name }}"
@ -86,7 +86,7 @@
no_log: true
- name: "Create keystone service record for ironic"
os_keystone_service:
openstack.cloud.catalog_service:
state: present
name: "ironic"
service_type: "baremetal"
@ -200,7 +200,7 @@
when: test_ironic_internal_endpoint.rc != 0 or test_ironic_internal_endpoint.stdout == '[]'
- name: "Create baremetal_admin role"
os_keystone_role:
openstack.cloud.identity_role:
name: "baremetal_admin"
state: present
auth:
@ -214,7 +214,7 @@
no_log: true
- name: "Create baremetal_observer role"
os_keystone_role:
openstack.cloud.identity_role:
name: "baremetal_observer"
state: present
auth:
@ -245,7 +245,7 @@
no_log: true
- name: "Create bifrost user"
os_user:
openstack.cloud.identity_user:
name: "{{ ironic.keystone.default_username }}"
password: "{{ ironic.keystone.default_password }}"
default_project: "baremetal"
@ -262,7 +262,7 @@
no_log: true
- name: "Associate bifrost user with baremetal_admin"
os_user_role:
openstack.cloud.role_assignment:
user: "{{ ironic.keystone.default_username }}"
role: "baremetal_admin"
project: "baremetal"

View File

@ -34,7 +34,7 @@
ironic_inspector.keystone.default_password is undefined
- name: "Create service user for ironic-inspector"
os_user:
openstack.cloud.identity_user:
name: "{{ ironic_inspector.service_catalog.username }}"
password: "{{ ironic_inspector.service_catalog.password }}"
state: present
@ -52,7 +52,7 @@
no_log: true
- name: "Associate ironic_inspector user to admin role"
os_user_role:
openstack.cloud.role_assignment:
user: "{{ ironic_inspector.service_catalog.username }}"
role: admin
project: "{{ ironic_inspector.service_catalog.project_name | default('service') }}"
@ -68,7 +68,7 @@
no_log: true
- name: "Create keystone service record for ironic-inspector"
os_keystone_service:
openstack.cloud.catalog_service:
state: present
name: ironic-inspector
service_type: baremetal-introspection
@ -182,7 +182,7 @@
when: test_ironic_inspector_internal_endpoint.rc != 0 or test_ironic_inspector_internal_endpoint.stdout == '[]'
- name: "Create inspector_user user"
os_user:
openstack.cloud.identity_user:
name: "{{ ironic_inspector.keystone.default_username }}"
password: "{{ ironic_inspector.keystone.default_password }}"
default_project: "baremetal"
@ -199,7 +199,7 @@
no_log: true
- name: "Associate inspector_user with baremetal_admin"
os_user_role:
openstack.cloud.role_assignment:
user: "{{ ironic_inspector.keystone.default_username }}"
role: "baremetal_admin"
project: baremetal

View File

@ -18,14 +18,14 @@
auth: {}
when: noauth_mode is defined and noauth_mode | bool == true
- name: "Execute os_client_config to collect facts"
os_client_config:
- name: "Execute openstack.cloud.config to collect facts"
openstack.cloud.config:
no_log: yes
# NOTE(TheJulia): The first record returned by os_client_config
# NOTE(TheJulia): The first record returned by openstack.cloud.config
# is utilized as the default. A user can still define the parameters
# if so desired.
- name: "Set os_client_config's auth parameters if not already set."
- name: "Set openstack.cloud.config auth parameters if not already set."
set_fact:
auth: "{{ openstack.clouds[0].auth }}"
auth_type: "{{ openstack.clouds[0].auth_type }}"
@ -34,7 +34,7 @@
when: noauth_mode is defined and noauth_mode | bool == false
- name: "Unprovision node"
os_ironic_node:
openstack.cloud.baremetal_node_action:
cloud: "{{ cloud_name | default(omit) }}"
auth_type: "{{ auth_type | default(omit) }}"
auth: "{{ auth | default(omit) }}"

View File

@ -18,15 +18,15 @@
auth: {}
when: noauth_mode is defined and noauth_mode | bool == true
- name: "Execute os_client_config to collect facts"
os_client_config:
- name: "Execute openstack.cloud.config to collect facts"
openstack.cloud.config:
no_log: yes
when: noauth_mode is defined and noauth_mode | bool == false
# NOTE(TheJulia): The first record returned by os_client_config
# NOTE(TheJulia): The first record returned by openstack.cloud.config
# is utilized as the default. A user can still define the parameters
# if so desired.
- name: "Set os_client_config's auth parameters if not already set."
- name: "Set openstack.cloud.config auth parameters if not already set."
set_fact:
auth: "{{ openstack.clouds[0].auth }}"
auth_type: "{{ openstack.clouds[0].auth_type }}"
@ -34,7 +34,7 @@
no_log: yes
- name: "Delete hardware"
os_ironic:
openstack.cloud.baremetal_node:
cloud: "{{ cloud_name | default(omit) }}"
auth_type: "{{ auth_type | default(omit) }}"
auth: "{{ auth | default(omit) }}"

View File

@ -22,15 +22,15 @@
auth: {}
when: noauth_mode is defined and noauth_mode | bool == true
- name: "Execute os_client_config to collect facts"
os_client_config:
- name: "Execute openstack.cloud.config to collect facts"
openstack.cloud.config:
no_log: yes
when: noauth_mode is defined and noauth_mode | bool == false
# NOTE(TheJulia): The first record returned by os_client_config
# NOTE(TheJulia): The first record returned by openstack.cloud.config
# is utilized as the default. A user can still define the parameters
# if so desired.
- name: "Set os_client_config's auth parameters if not already set."
- name: "Set openstack.cloud.config auth parameters if not already set."
set_fact:
auth: "{{ openstack.clouds[0].auth }}"
auth_type: "{{ openstack.clouds[0].auth_type }}"

View File

@ -22,15 +22,15 @@
auth: {}
when: noauth_mode is defined and noauth_mode | bool == true
- name: "Execute os_client_config to collect facts"
os_client_config:
- name: "Execute openstack.cloud.config to collect facts"
openstack.cloud.config:
no_log: yes
when: noauth_mode is defined and noauth_mode | bool == false
# NOTE(TheJulia): The first record returned by os_client_config
# NOTE(TheJulia): The first record returned by openstack.cloud.config
# is utilized as the default. A user can still define the parameters
# if so desired.
- name: "Set os_client_config's auth parameters if not already set."
- name: "Set openstack.cloud.config auth parameters if not already set."
set_fact:
auth: "{{ openstack.clouds[0].auth }}"
auth_type: "{{ openstack.clouds[0].auth_type }}"
@ -63,7 +63,7 @@
when: (inventory_dhcp | bool == true) or (inventory_dns | bool == true)
- name: "Execute node introspection - noauth_mode"
os_ironic_inspect:
openstack.cloud.baremetal_inspect:
cloud: "{{ cloud_name | default(omit) }}"
auth_type: "{{ auth_type | default(omit) }}"
auth: "{{ auth | default(omit) }}"
@ -78,7 +78,7 @@
# which raises a bug in the inspection module where auth_type must be
# defined, as it is otherwise always sent as a null value.
- name: "Execute node introspection"
os_ironic_inspect:
openstack.cloud.baremetal_inspect:
cloud: "{{ cloud_name | default(omit) }}"
auth_type: "{{ auth_type | default('password') }}"
auth: "{{ auth | default(omit) }}"

View File

@ -0,0 +1,14 @@
---
other:
- |
Bifrost now uses the equivalent modules from the openstack.cloud collection.
The change on modules is listed below.
* `os_client_config` is `config`
* `os_ironic` is `baremetal_node`
* `os_ironic_inspect` is `baremetal_inspect`
* `os_ironic_node` is `baremetal_node_action`
* `os_keystone_role` is `identity_role`
* `os_keystone_service` is `catalog_service`
* `os_user` is `identity_user`
* `os_user_role` is `role_assignment`