ManageIQ / manageiq-content

Default ManageIQ content
Apache License 2.0
13 stars 120 forks source link

launch_ansible_job doesn't write to the logfile #730

Open BrGitHub11 opened 1 year ago

BrGitHub11 commented 1 year ago

We're using oparin-1.1.20230105135506_44ec8c4 installed on a VM.

I'm trying to call an ansible job in tower in the post provisioning phase of my vm. The VM is created successfully and the job is started in tower. But there's no limit set. I tried to debug what's happening but it seems like there's no log output. When I look at the launch_ansible_job there are some log messages, like "Processing Job Template". But journalctl doesn't show this even after the job is started in Tower. I could see a line that says "Calling template.run_with_miq_job for template: #<ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript". I tried to overwrite the method by copying it to my own domain but seems like mine is never called.

I'm looking for someone who could help me understand: 1) why there is no limit set in the job call 2) why there's no log output 3) why I can't overwrite this method

Already tried to reach out to the community but seems that no one could help me.

Fryguy commented 1 year ago

Can you give more details of your setup, perhaps a way we can replicate what you're seeing? Tower runs independently, but we do fetch the run over their API. Or were you expecting something else in the MIQ logs?

BrGitHub11 commented 1 year ago

Hi,

thanks for your help! I'm really grateful for any help!

I tried to reproduce all steps. Here's what I've done. Please reach out to me if I should add more details:

1) Installed a new instance of MIQ using docker.

2) Added a VMware provider. Refreshed the provider.

3) Added a new service dialog, which asks for the VMname.

4) Added a new catalog.

5) Added a new catalog item, type VMware. Used the dialog from above.

6) Went to the MIQ UI and ordered one VM using my catalog item. VM was provisioned successfully.

7) Deleted the VM using VSphere.

8) Added a new automation provider and pointed it to our tower instance. Refreshed the provider.

9) Added a new domain to the datastore.

10) Copied ManageIQ-Infrastructure-VM-Provisioning-State Machine-Methods-PostProvision to my domain.

11) Added a new method (towerjob) that call a test job in tower. I've set Hosts to Localhost.

12) Modified the PostProvision Instance and put towerjob as value in common_meth1.

13) Went to the MIQ UI and ordered one VM using my catalog item. VM was provisioned successfully. I could see that my playbook in Tower was called. But of course it failed because no limit was set.

I could see info log level messages in the docker logs output. But nothing related to my deployment. In the other instance I could see more debug output. Don't know why this is not showing up here?

When looking into the ManageIQ-AutomationManagement-Ansible Tower-Operations-StateMachines-Job-launch_ansible_job method I would expect a log output like Processing Job Template towerjob

In the end my question is how to modify the call to Tower so that I could add the ip address to the extra-vars.

Fryguy commented 1 year ago

This is great details. Thanks! We'll have to look into this specific combination, which will take some time, but I'll have to see what's going on. cc @agrare

BrGitHub11 commented 1 year ago

Just one question: why can't I see my deployment in the docker logs? In the standalone version journalctl -f shows a lot more information.

Inside the system logs are not shown at all Screenshot 2023-05-12 at 11 49 48

BrGitHub11 commented 1 year ago

I installed a new version of ManageIQ in docker. I still can't see automation log output in docker logs. But now I could see some output on the Service Requests page.

Fryguy commented 1 year ago

@BrGitHub11 In containerized deployments the logs get written to stdout and are not written to disk (journalctl doesn't exist in containers). That page should be hidden in containerized deployments, so if that's showing that's a bug. You should enable a log aggregator such as an EFK stack if running in a containerized deployment.

BrGitHub11 commented 1 year ago

Hi Jason, I'm looking at the docker logs output which should capture the STDOUT of the container. I could see other outputs of ManageIQ but no automation log output.

BrGitHub11 commented 1 year ago

Hi, do you need some additional information?

BrGitHub11 commented 1 year ago

Hi, is there an estimate when someone could start working on this?

miq-bot commented 1 year ago

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

Fryguy commented 1 year ago

Sorry @BrGitHub11 I just haven't had any cycles to dig into this one :(

miq-bot commented 10 months ago

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot commented 7 months ago

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot commented 4 months ago

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot commented 1 month ago

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.