Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add output_logs to docker_compose #678

Open
JohannesFleischer opened this issue Aug 8, 2023 · 0 comments
Open

Add output_logs to docker_compose #678

JohannesFleischer opened this issue Aug 8, 2023 · 0 comments
Labels
docker-compose-v1 Docker Compose v1 enhancement New feature or request

Comments

@JohannesFleischer
Copy link

SUMMARY

When starting a container with docker-compose it would be handy to have the option to output the docker-compose logs generated. That is for example useful for services, that generate and log information needed to continue (like hashicorp boundary)

If the logs could be directly written into a variable, that would be pretty handy, but I guess the easiest way is to just write the logs to the output so that can be registered and searched afterward.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

This feature also does already exist for docker_container, so the same name could be taken for this option: output_logs: true|false

ADDITIONAL INFORMATION
    - name: Create and start service
      community.docker.docker_compose:
        project_src: boundary
        output_logs: true
      register: output

  - name: Print Boundary credentials
    ansible.builtin.debug: 
      msg: "{{ output | regex_search('.*\bLogin Name\b.*\n.*\bPassword\b.*') }}"
@felixfontein felixfontein added enhancement New feature or request docker-compose-v1 Docker Compose v1 labels Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker-compose-v1 Docker Compose v1 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants