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

Ansible command output is not logged #68

Open
gkranis opened this issue Feb 23, 2023 · 1 comment
Open

Ansible command output is not logged #68

gkranis opened this issue Feb 23, 2023 · 1 comment

Comments

@gkranis
Copy link

gkranis commented Feb 23, 2023

When running kitchen the output of the ansible command is displayed on stdout.
However its missing from the kitchen logs.

So in our case .kitchen/logs/jenkins-ubuntu-1804.log contains

, [2023-02-23T17:31:12.888231 #430]  INFO -- jenkins-ubuntu-1804: *************** AnsiblePush run ***************
D, [2023-02-23T17:31:12.888364 #430] DEBUG -- jenkins-ubuntu-1804: env= <snipped blablabla> d --inventory-file=`which kitchen-ansible-inventory` --limit=kitchen test/integration/jenkins/ansible/default.yml
D, [2023-02-23T17:32:28.375982 #430] DEBUG -- jenkins-ubuntu-1804: ansible-playbook exit code = 0
I, [2023-02-23T17:32:28.376133 #430]  INFO -- jenkins-ubuntu-1804: *************** AnsiblePush end run *******************

This makes the plugin not an option for us as we rely on the logs (the standard output is unusable with --parallel)

From a quick look the output of the system call needs to be passed to a logging function.
So hopefully an easy fix

@gkranis
Copy link
Author

gkranis commented Feb 24, 2023

can be worked around by logging at the ansible level

environment_vars:
         ANSIBLE_LOG_PATH: "{{CWD}}/.kitchen/logs/ansible-BLABLA.log"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant