redhat-openstack / ansible-role-tripleo-collect-logs

A role designed to collect the critical logs, configuration and artifacts from a tripleo deployment
Apache License 2.0
7 stars 1 forks source link

Add ability to collect logs from multiple hosts - including the virthost #4

Open rlandy opened 8 years ago

rlandy commented 8 years ago

For documentation generation, files are collected from the undercloud. However, there are files on the virthost (for example: used to prepare the virthost for PXE forwarding, in the case of a virt undercloud and baremetal overcoud) that are not captured by collect logs now.

In order to include those files in the documentation, we have to manually copy over the files to the undercloud prior to running the generation.

HarryRybacki-zz commented 8 years ago

One thing to keep in mind is that collect-logs basically breaks down into three distinct segments, only the first of which will be run all of the time.

  1. collect-logs -- pulls artifacts off of hosts after deployment has completed
  2. create-docs -- uses artifacts from step 1 in addition to static documentation to generate html docs via Sphinx
  3. publish -- publishes collected log files and docs (if created) to some remote server

A requirement for an artifact to be consumable by create-docs is that it is pulled onto the slave/box running the role during collect-logs. So, let's assume the artifacts we need are being pulled off already.

As it stands, the role is capable of pulling things that lived the undercloud, specifically in /home/stack/*. Which files are pulled are determined in the artcl_create_docs_payload.included_deployment_scripts e.g.:

artcl_create_docs_payload:
  included_deployment_scripts:
    - undercloud-install
    - undercloud-post-install
    - overcloud-deploy
    - overcloud-deploy-post
    - overcloud-validate

We could make this host specific w/ full paths e.g.:

artcl_create_docs_payload:
  included_deployment_scripts:
    undercloud:
      - /home/stack/undercloud-install
      - /home/stack/undercloud-post-install
      - /home/stack/overcloud-deploy
      - /home/stack/overcloud-deploy-post
      - /home/stack/overcloud-validate

This would allow us to add other hosts as well e.g.:

artcl_create_docs_payload:
  included_deployment_scripts:
    undercloud:
      - /home/stack/undercloud-install
      - /home/stack/undercloud-post-install
      - /home/stack/overcloud-deploy
      - /home/stack/overcloud-deploy-post
      - /home/stack/overcloud-validate
    overcloud-controller-0:
      - /path/to/file-I-want

@rlandy one issue I forsee is that the virthost is pulled into a directory aligned with it's IP. Maybe we could have these always pulled into a 'virthost' directory instead? Thoughts?