diff --git a/playbooks/install.yaml b/playbooks/install.yaml index 80b4a0cd9..60fc9d547 100644 --- a/playbooks/install.yaml +++ b/playbooks/install.yaml @@ -22,7 +22,6 @@ config_project_name: "{{ keystone.bootstrap.project_name }}" config_region_name: "{{ keystone.bootstrap.region_name }}" config_auth_url: "{{ keystone.bootstrap.public_url }}" - when: enable_keystone is defined and enable_keystone | bool == true - { role: bifrost-create-dib-image, dib_imagename: "{{ http_boot_folder }}/ipa", build_ramdisk: false, dib_os_element: "{{ ipa_dib_os_element|default('debian') }}", dib_elements: "ironic-agent {{ ipa_extra_dib_elements | default('') }}", when: create_ipa_image | bool == true } - { role: bifrost-create-dib-image, dib_imagename: "{{ deploy_image }}", dib_imagetype: "qcow2", dib_elements: "vm enable-serial-console {{ dib_init_element|default('simple-init') }} {{ extra_dib_elements|default('') }}", when: create_image_via_dib | bool == true and transform_boot_image | bool == false } environment: diff --git a/playbooks/roles/bifrost-keystone-client-config/defaults/main.yml b/playbooks/roles/bifrost-keystone-client-config/defaults/main.yml index 04fd4c03d..dddd85cf6 100644 --- a/playbooks/roles/bifrost-keystone-client-config/defaults/main.yml +++ b/playbooks/roles/bifrost-keystone-client-config/defaults/main.yml @@ -1,2 +1,2 @@ --- -# This file is intentionally empty +ironic_api_url: "http://localhost:6385" diff --git a/playbooks/roles/bifrost-keystone-client-config/tasks/main.yml b/playbooks/roles/bifrost-keystone-client-config/tasks/main.yml index fc6795586..a00be2fc3 100644 --- a/playbooks/roles/bifrost-keystone-client-config/tasks/main.yml +++ b/playbooks/roles/bifrost-keystone-client-config/tasks/main.yml @@ -23,6 +23,7 @@ config_project_domain_id: "{{ config_project_domain_id|default('default') }}" config_user_domain_id: "{{ config_user_domain_id|default('default') }}" when: + - "{{ enable_keystone | default(false) | bool }}" - "{{ clouds is undefined }}" - "{{ config_username is defined }}" - "{{ config_password is defined }}" diff --git a/playbooks/roles/bifrost-keystone-client-config/templates/clouds.yaml.j2 b/playbooks/roles/bifrost-keystone-client-config/templates/clouds.yaml.j2 index 8593c46a4..8dd137c11 100644 --- a/playbooks/roles/bifrost-keystone-client-config/templates/clouds.yaml.j2 +++ b/playbooks/roles/bifrost-keystone-client-config/templates/clouds.yaml.j2 @@ -1,5 +1,6 @@ # WARNING: This file is managed by bifrost. clouds: +{% if (enable_keystone | default(false) | bool) %} {% for cloud in clouds | default({}) | dictsort %} {{ cloud.0 }}: region_name: {{ cloud.1.config_region_name }} @@ -12,3 +13,9 @@ clouds: user_domain_id: "{{ cloud.1.config_user_domain_id | default('default') }}" identity_api_version: "3" {% endfor %} +{% else %} + bifrost: + auth_type: None + auth: {} + url: {{ ironic_api_url }} +{% endif %} diff --git a/playbooks/test-bifrost.yaml b/playbooks/test-bifrost.yaml index c7803a28d..da6ede154 100644 --- a/playbooks/test-bifrost.yaml +++ b/playbooks/test-bifrost.yaml @@ -87,7 +87,6 @@ config_project_name: "baremetal" config_region_name: "{{ keystone.bootstrap.region_name }}" config_auth_url: "{{ keystone.bootstrap.public_url }}" - when: "{{ enable_keystone is defined and enable_keystone | bool == true }}" environment: http_proxy: "{{ lookup('env','http_proxy') }}" https_proxy: "{{ lookup('env','https_proxy') }}" diff --git a/releasenotes/notes/always-create-clouds-file-d0b72808155a9344.yaml b/releasenotes/notes/always-create-clouds-file-d0b72808155a9344.yaml new file mode 100644 index 000000000..ab105eb4a --- /dev/null +++ b/releasenotes/notes/always-create-clouds-file-d0b72808155a9344.yaml @@ -0,0 +1,12 @@ +--- +features: + - | + bifrost now always writes ``clouds.yaml`` configuration file + for os-client-config independently of whether keystone is installed + or not. + + This allows unified usage of ironic-related openstackclient commands + both in presence and absence of installed keystone by using the + ``openstack`` command in the following form for both situations:: + + openstack --os-cloud bifrost baremetal ...