bifrost/playbooks/install.yaml
Pavlo Shchelokovskyy e09bec2c83 Allow to create cloud.yaml with many clouds
This patch makes the bifrost-keystone-client-config role a bit more
generic to allow creating more that a single cloud configuration
setting.

The role is changed to accept a dict with possibly many clouds configurations,
and the template for clouds.yaml is changed accordingly.

This new functionality is used right away to add the keystone admin user
to the created clouds.yaml file to make the installed keystone usable
for admin-level operations (listing and editig users, projects, roles
and role assignments) - the name of the 'cloud' created is
'bifrost-admin'.

Change-Id: Icb274de989966645cd0f3874f8dff9d9f37d871b
2017-02-01 21:55:54 +02:00

31 lines
1.8 KiB
YAML

---
- hosts: target
name: "Install Ironic on the target host."
become: yes
gather_facts: yes
roles:
- { role: bifrost-prep-for-install, when: skip_install is not defined }
- bifrost-keystone-install
- bifrost-ironic-install
- role: bifrost-keystone-client-config
user: "{{ ansible_env.SUDO_USER }}"
clouds:
bifrost:
config_username: "{{ ironic.keystone.default_username }}"
config_password: "{{ ironic.keystone.default_password }}"
config_project_name: "baremetal"
config_region_name: "{{ keystone.bootstrap.region_name }}"
config_auth_url: "{{ keystone.bootstrap.public_url }}"
bifrost-admin:
config_username: "{{ keystone.bootstrap.username }}"
config_password: "{{ ironic.bootstrap.password }}"
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 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:
http_proxy: "{{ lookup('env','http_proxy') }}"
https_proxy: "{{ lookup('env','https_proxy') }}"