diff --git a/defaults/main.yml b/defaults/main.yml index 062ada40..c29af9be 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -45,24 +45,6 @@ ironic_service_names: # Is this Ironic installation working standalone? ironic_standalone: True -# Integrated Openstack configuration -ironic_openstack_driver_list: agent_ipmitool -ironic_openstack_auth_strategy: keystone -ironic_openstack_api_url: '' # Not required when we have keystone -ironic_openstack_dhcp_provider: neutron -ironic_openstack_sync_power_state_interval: 60 - -# Standalone Ironic configuration -ironic_standalone_driver_list: pxe_amt # for testing with a NUC -ironic_standalone_auth_strategy: noauth -# TODO(mrda): We need to know what the public endpoint for ironic is -ironic_standalone_api_url: "api_url=http://{{ ansible_default_ipv4['address'] }}:6385/" -ironic_standalone_dhcp_provider: none -ironic_standalone_sync_power_state_interval: -1 - -# Common configuration -ironic_node_name: ironic - # Database ironic_database_user: ironic ironic_database_database: ironic @@ -73,6 +55,25 @@ ironic_database_password: gu1d0 database_root_user: root database_root_password: sp4m3ggs +# Integrated Openstack configuration +ironic_openstack_driver_list: agent_ipmitool +ironic_openstack_auth_strategy: keystone +ironic_openstack_api_url: '' # Not required when we have keystone +ironic_openstack_dhcp_provider: neutron +ironic_openstack_sync_power_state_interval: 60 +ironic_openstack_db_connection_string: "mysql://{{ ironic_database_user }}:{{ ironic_database_password }}@localhost/ironic" + +# Standalone Ironic configuration +ironic_standalone_driver_list: pxe_amt # for testing with a NUC +ironic_standalone_auth_strategy: noauth +ironic_standalone_api_url: "api_url=http://{{ ansible_default_ipv4['address'] }}:6385/" +ironic_standalone_dhcp_provider: none +ironic_standalone_sync_power_state_interval: -1 +ironic_standalone_db_connection_string: "mysql://{{ ironic_database_user }}:{{ ironic_database_password }}@localhost/ironic" + +# Common configuration +ironic_node_name: ironic + # If you want to regenerate the ironic users SSH keys, on each run, set this # var to True. Otherwise keys will be generated on the first run and not # regenerated each run. diff --git a/tasks/ironic_db_setup.yml b/tasks/ironic_db_setup.yml index b49b6af0..0d045b95 100644 --- a/tasks/ironic_db_setup.yml +++ b/tasks/ironic_db_setup.yml @@ -39,8 +39,8 @@ tags: - ironic-db-setup -- name: Synchronize database schema - command: "{{ ironic_bin }}/ironic-dbsync upgrade" +- name: Create database schema + command: "{{ ironic_bin }}/ironic-dbsync --config-file /etc/ironic/ironic.conf create_schema" sudo: yes sudo_user: "{{ ironic_system_user_name }}" notify: diff --git a/tasks/ironic_post_install.yml b/tasks/ironic_post_install.yml index 4e55485e..0f4cdad4 100644 --- a/tasks/ironic_post_install.yml +++ b/tasks/ironic_post_install.yml @@ -20,6 +20,7 @@ ironic_api_url: "{{ ironic_standalone_api_url }}" ironic_dhcp_provider: "{{ ironic_standalone_dhcp_provider }}" ironic_sync_power_state_interval: "{{ ironic_standalone_sync_power_state_interval }}" + ironic_db_connection_string: "{{ ironic_standalone_db_connection_string }}" when: ironic_standalone - name: Setup ironic for integrated Openstack usage @@ -29,6 +30,7 @@ ironic_api_url: "{{ ironic_openstack_api_url }}" ironic_dhcp_provider: "{{ ironic_openstack_dhcp_provider }}" ironic_sync_power_state_interval: "{{ ironic_openstack_sync_power_state_interval }}" + ironic_db_connection_string: "{{ ironic_openstack_db_connection_string }}" when: not ironic_standalone - name: Build the ironic.conf configuration file diff --git a/templates/ironic.conf.j2 b/templates/ironic.conf.j2 index 51b22112..3233f668 100644 --- a/templates/ironic.conf.j2 +++ b/templates/ironic.conf.j2 @@ -751,7 +751,7 @@ sync_power_state_interval={{ ironic_sync_power_state_interval }} # Deprecated group/name - [DEFAULT]/sql_connection # Deprecated group/name - [DATABASE]/sql_connection # Deprecated group/name - [sql]/connection -#connection= +connection={{ ironic_db_connection_string }} # The SQLAlchemy connection string to use to connect to the # slave database. (string value)