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 0000000000000000000000000000000000000000..0e2538cd75b6c5c94c531724e3e9c6746d0687d9 --- /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 f70d24ccd66769a25c22a7ae4294ffb54917fe90..beb99a43ae8c3500dad683d40a3096a705b403c1 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 4be1751b6719f5f59786a5dac86cce1031702130..e470a6c4e108eca1ac00c27e577b9953070e7013 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 6bdd79fa427cfac28756294efac290121fa54551..2d80694580e356c7b88723932c10d6af636696a8 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 <https://docs.ansible.com/ansible/latest/user_guide/intro_patterns.html>`_. + +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 4c0a0e42987a4456e7451d45b517a7279f3233b7..4bfdbe1a6bc3ee56172ed75b5e85928deab0bd89 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 4596af695255441f83339173a4270afbc3e4e7a1..0aac9834677708055118b18c7aa28a9694597762 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -1257,6 +1257,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): @@ -1264,7 +1265,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 c3d45635c45f3e818619d8a52401f20b84eccbb6..a7454538c6bcebaa5a4de46c16badf6349b666d5 100644 --- a/kayobe/tests/unit/cli/test_commands.py +++ b/kayobe/tests/unit/cli/test_commands.py @@ -1283,7 +1283,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 0000000000000000000000000000000000000000..df0d8e9f7b21bb0987e1ff965dd76981a97e7605 --- /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``.