From da5395b35635520c9997de9c63cb3a095a2e0a92 Mon Sep 17 00:00:00 2001 From: Tee Ngo Date: Tue, 9 Jul 2019 14:23:30 -0400 Subject: [PATCH] Apply custom banner as part of bootstrap if available If custom banner is provided prior to running Ansible bootstrap playbook, it must be applied as part of the bootstrap. Closes-Bug: 1835524 Change-Id: I6f21fadf5c3cf1a49f28371392753aded293ae80 Signed-off-by: Tee Ngo --- .../roles/persist-config/tasks/main.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/playbookconfig/src/playbooks/bootstrap/roles/persist-config/tasks/main.yml b/playbookconfig/src/playbooks/bootstrap/roles/persist-config/tasks/main.yml index 66e859e17..da52a1349 100644 --- a/playbookconfig/src/playbooks/bootstrap/roles/persist-config/tasks/main.yml +++ b/playbookconfig/src/playbooks/bootstrap/roles/persist-config/tasks/main.yml @@ -65,6 +65,26 @@ - include: one_time_config_tasks.yml when: not initial_db_populated +# Banner customization is not part of one_time_config_task.yml as the user may +# choose to change their banner look and feel and replay. +- name: Check if custom banner exists + stat: + path: /opt/banner + register: banner_result + +- block: + - name: Apply custom banner + shell: + /usr/sbin/apply_banner_customization /opt/banner > /tmp/apply_banner_customization.log + failed_when: false + register: banner_apply + + - name: Fail if banner customization failed + fail: + msg: "Failed to apply banner customization. See /tmp/apply_banner_customization.log for details." + when: banner_apply.rc != 0 + when: banner_result.stat.exists and banner_result.stat.isdir + # Shut down services if there are services impacting config changes in # this replay or previous bootstrap did not complete for whatever reason. - name: Shuting down services for reconfiguration as required