diff --git a/doc/source/contributor/testenv.rst b/doc/source/contributor/testenv.rst index cd9d5d16e..39c6043f1 100644 --- a/doc/source/contributor/testenv.rst +++ b/doc/source/contributor/testenv.rst @@ -22,7 +22,7 @@ Additionally, the following parameters can be useful: .. note:: You still need to restart services to apply any changes, e.g.:: - sudo systemctl restart ironic-conductor + sudo systemctl restart ironic ``--driver=[ipmi|redfish]`` Choose the default driver for the generated nodes inventory. diff --git a/doc/source/user/troubleshooting.rst b/doc/source/user/troubleshooting.rst index fa2396bad..b58448701 100644 --- a/doc/source/user/troubleshooting.rst +++ b/doc/source/user/troubleshooting.rst @@ -89,8 +89,8 @@ Obtaining IPA logs via the console the video mode, defines the console as ttyS0 or the first serial port, and instructs systemd to direct logs to the console. -2) Once set, restart the ironic-conductor service, e.g. - ``service ironic-conductor restart`` and attempt to redeploy the node. +2) Once set, restart the ironic service, e.g. + ``systemctl restart ironic`` and attempt to redeploy the node. You will want to view the system console occurring. If possible, you may wish to use ``ipmitool`` and write the output to a log file. diff --git a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml index 6ea954010..bfe7fa9fa 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml @@ -248,26 +248,29 @@ include: inspector_bootstrap.yml when: enable_inspector | bool -- name: "Get ironic-api & ironic-conductor install location" - shell: echo $(dirname $(which ironic-api)) +- name: "Get ironic install location" + shell: echo $(dirname $(which ironic)) register: ironic_install_prefix environment: "{{ bifrost_venv_env }}" -- name: "Place ironic services" +- name: "Place ironic service" template: src: systemd_template.j2 - dest: "{{ init_dest_dir }}{{ item.service_name }}.service" + dest: "{{ init_dest_dir }}ironic.service" owner: "root" group: "root" + vars: + service_path: "{{ ironic_install_prefix.stdout | default('') }}" + service_name: 'ironic' + config_file: '/etc/ironic/ironic.conf' + +- name: "Remove old ironic services" + file: + path: "{{ init_dest_dir }}{{ item }}.service" + state: absent loop: - - service_path: "{{ ironic_install_prefix.stdout | default('') }}" - service_name: 'ironic-api' - username: 'ironic' - args: '--config-file /etc/ironic/ironic.conf' - - service_path: "{{ ironic_install_prefix.stdout | default('') }}" - service_name: 'ironic-conductor' - username: 'ironic' - args: '--config-file /etc/ironic/ironic.conf' + - ironic-api + - ironic-conductor - name: "Create and populate /tftpboot" import_tasks: create_tftpboot.yml diff --git a/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml index aea937617..effa425d0 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml @@ -140,15 +140,13 @@ - name: "Inspector - Place service" template: src: systemd_template.j2 - dest: "{{ init_dest_dir }}{{ item.service_name }}.service" + dest: "{{ init_dest_dir }}ironic-inspector.service" owner: root group: root - # FIXME(dtantsur): this is an awkward way to use loop... - loop: - - service_path: "{{ ironic_install_prefix.stdout | default('') }}" - service_name: 'ironic-inspector' - username: 'ironic' - args: '--config-file /etc/ironic-inspector/inspector.conf' + vars: + service_path: "{{ ironic_install_prefix.stdout | default('') }}" + service_name: 'ironic-inspector' + config_file: '/etc/ironic-inspector/inspector.conf' - name: "Inspector - Explicitly permit TCP/5050 for ironic-inspector callback" iptables: chain: INPUT diff --git a/playbooks/roles/bifrost-ironic-install/tasks/start.yml b/playbooks/roles/bifrost-ironic-install/tasks/start.yml index ca2e4bf14..da388d054 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/start.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/start.yml @@ -26,15 +26,25 @@ - name: "Start database service" service: name={{ mysql_service_name }} state=started enabled=yes -- name: "start ironic-inspector" +- name: "Start ironic-inspector" include: inspector_start.yml when: enable_inspector | bool -- name: "Start ironic-conductor" - service: name=ironic-conductor state=restarted enabled=yes +- name: "Stop old ironic services" + service: + name: "{{ item }}" + state: stopped + enabled: no + ignore_errors: true + loop: + - ironic-api + - ironic-conductor -- name: "Start ironic-api" - service: name=ironic-api state=restarted enabled=yes +- name: "Start ironic" + service: + name: ironic + state: restarted + enabled: yes - name: "Start ironic-prometheus-exporter" include: prometheus_exporter_start.yml diff --git a/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 b/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 index e9120ce44..0aa9ab1fd 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 @@ -1,10 +1,10 @@ [Unit] -Description={{ item.service_name }} service +Description={{ service_name }} service [Service] -ExecStart={{ item.service_path }}/{{ item.service_name }} {{ item.args }} -User={{ item.username }} +ExecStart={{ service_path }}/{{ service_name }} --config-file {{ config_file }} +User=ironic [Install] WantedBy=multi-user.target -Alias={{ item.service_name }}.service +Alias={{ service_name }}.service diff --git a/releasenotes/notes/allinone-5fc5355f46192351.yaml b/releasenotes/notes/allinone-5fc5355f46192351.yaml new file mode 100644 index 000000000..f742f3649 --- /dev/null +++ b/releasenotes/notes/allinone-5fc5355f46192351.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Bifrost now starts a single Ironic process rather than separate API + and conductor. +upgrade: + - | + On upgrade, the existing API and conductor services will be disabled and + a single combined ``ironic`` process will be started instead. diff --git a/scripts/collect-test-info.sh b/scripts/collect-test-info.sh index cd0c6c1f1..c601ec0e4 100755 --- a/scripts/collect-test-info.sh +++ b/scripts/collect-test-info.sh @@ -71,9 +71,9 @@ mkdir -p ${LOG_LOCATION}/all sudo cp -a /var/log/* ${LOG_LOCATION}/all/. sudo chown -R $USER ${LOG_LOCATION}/all +sudo systemctl > ${LOG_LOCATION}/all-services.txt sudo journalctl -u libvirtd &> ${LOG_LOCATION}/libvirtd.log -sudo journalctl -u ironic-api &> ${LOG_LOCATION}/ironic-api.log -sudo journalctl -u ironic-conductor &> ${LOG_LOCATION}/ironic-conductor.log +sudo journalctl -u ironic &> ${LOG_LOCATION}/ironic.log sudo journalctl -u ironic-inspector &> ${LOG_LOCATION}/ironic-inspector.log sudo journalctl -u dnsmasq &> ${LOG_LOCATION}/dnsmasq.log sudo journalctl -u vbmcd &> ${LOG_LOCATION}/vbmcd.log