diff --git a/ansible/baremetal-compute-serial-console-post-config.yml b/ansible/baremetal-compute-serial-console-post-config.yml new file mode 100644 index 000000000..0e2538cd7 --- /dev/null +++ b/ansible/baremetal-compute-serial-console-post-config.yml @@ -0,0 +1,6 @@ +--- +# This is a wrapper around baremetal-compute-serial-console which only runs the playbook when +# ironic_serial_console_autoenable is set to true. + +- import_playbook: baremetal-compute-serial-console.yml + when: ironic_serial_console_autoenable | bool \ No newline at end of file diff --git a/ansible/group_vars/all/ironic b/ansible/group_vars/all/ironic index f70d24ccd..beb99a43a 100644 --- a/ansible/group_vars/all/ironic +++ b/ansible/group_vars/all/ironic @@ -131,6 +131,9 @@ kolla_ironic_pxe_append_params: > ############################################################################### # Ironic Node Configuration +# Whether or not to enable the serial consoles on post configure +ironic_serial_console_autoenable: false + # This defines the start of the range of TCP ports to used for the IPMI socat # serial consoles ironic_serial_console_tcp_pool_start: 30000 diff --git a/ansible/kolla-ansible.yml b/ansible/kolla-ansible.yml index 4be1751b6..e470a6c4e 100644 --- a/ansible/kolla-ansible.yml +++ b/ansible/kolla-ansible.yml @@ -171,6 +171,24 @@ set_fact: kolla_api_interface: "{{ kolla_bifrost_network_interface }}" +- name: Validate configuration options for kolla-ansible + hosts: localhost + tags: + - kolla-ansible + - config-validation + tasks: + - name: Validate serial console configuration + block: + - name: Check ipmitool-socat is in enabled in kolla_ironic_enabled_console_interfaces + fail: + msg: > + kolla_ironic_enabled_console_interfaces must contain ipmitool-socat if you set + ironic_serial_console_autoenable to true + when: + - kolla_ironic_enabled_console_interfaces is defined + - "'ipmitool-socat' not in kolla_ironic_enabled_console_interfaces" + when: ironic_serial_console_autoenable | bool + - name: Ensure Kolla Ansible is configured hosts: localhost tags: diff --git a/doc/source/administration/bare-metal.rst b/doc/source/administration/bare-metal.rst index 6bdd79fa4..2d8069458 100644 --- a/doc/source/administration/bare-metal.rst +++ b/doc/source/administration/bare-metal.rst @@ -131,3 +131,11 @@ You can optionally limit the nodes targeted by setting which should take the form of an `ansible host pattern `_. + +Serial console auto-enable +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To enable the serial consoles automatically on ``kayobe overcloud post configure``, you can set +``ironic_serial_console_autoenable`` in ``etc/kayobe/ironic.yml``:: + + ironic_serial_console_autoenable: true diff --git a/etc/kayobe/ironic.yml b/etc/kayobe/ironic.yml index 4c0a0e429..4bfdbe1a6 100644 --- a/etc/kayobe/ironic.yml +++ b/etc/kayobe/ironic.yml @@ -106,6 +106,9 @@ ############################################################################### # Ironic Node Configuration +# Whether or not to enable the serial consoles on post configure +#ironic_serial_console_autoenable: + # This defines the start of the range of TCP ports to used for the IPMI socat # serial consoles #ironic_serial_console_tcp_pool_start: diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index 935be47d6..ea4cf5d19 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -1340,6 +1340,7 @@ class OvercloudPostConfigure(KayobeAnsibleMixin, VaultMixin, Command): inspector service. * Register a provisioning network with glance. * Configure Grafana for control plane. + * Configure serial consoles for the ironic nodes """ def take_action(self, parsed_args): @@ -1347,7 +1348,8 @@ class OvercloudPostConfigure(KayobeAnsibleMixin, VaultMixin, Command): playbooks = _build_playbook_list( "overcloud-ipa-images", "overcloud-introspection-rules", "overcloud-introspection-rules-dell-lldp-workaround", - "provision-net", "overcloud-grafana-configure") + "provision-net", "overcloud-grafana-configure", + "baremetal-compute-serial-console-post-config") self.run_kayobe_playbooks(parsed_args, playbooks) diff --git a/kayobe/tests/unit/cli/test_commands.py b/kayobe/tests/unit/cli/test_commands.py index c97b33650..e4e23fef9 100644 --- a/kayobe/tests/unit/cli/test_commands.py +++ b/kayobe/tests/unit/cli/test_commands.py @@ -1417,7 +1417,9 @@ class TestCase(unittest.TestCase): utils.get_data_files_path("ansible", "overcloud-introspection-rules-dell-lldp-workaround.yml"), # noqa utils.get_data_files_path("ansible", "provision-net.yml"), utils.get_data_files_path( - "ansible", "overcloud-grafana-configure.yml") + "ansible", "overcloud-grafana-configure.yml"), + utils.get_data_files_path( + "ansible", "baremetal-compute-serial-console-post-config.yml"), # noqa ], ), ] diff --git a/releasenotes/notes/add-serial-console-enable-to-post-configure-c61704185c57783d.yaml b/releasenotes/notes/add-serial-console-enable-to-post-configure-c61704185c57783d.yaml new file mode 100644 index 000000000..df0d8e9f7 --- /dev/null +++ b/releasenotes/notes/add-serial-console-enable-to-post-configure-c61704185c57783d.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Added the ability to configure baremetal serial consoles during the + post configure step. This is controlled via ``ironic_serial_console_autoenable`` + in ``etc/kayobe/ironic.yml``.