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

fixes #17701 - Ansible Button on Host page emits two ansible tasks #65

Closed
wants to merge 1 commit into from
Closed

fixes #17701 - Ansible Button on Host page emits two ansible tasks #65

wants to merge 1 commit into from

Conversation

chilicat
Copy link
Contributor

Steps to reproduce:

  1. Apply role on a single host "myhost"
  2. got to host page: https://katello/hosts/myhost.mydomain
  3. Click "|> Ansible roles"
  4. Goto Tasks view (https://katello/foreman_tasks/tasks)
  5. Notice that two task are emitted (Name: Play Ansible roles on host /myhost.mydomain)

I used a chrome browser

This issue gave has particular headache since the visible ansible run was failing with all kind of weird issues caused by the second (hidden) ansible run.

@theforeman-bot
Copy link
Member

There were the following issues with the commit message:

  • c684e06 must be in the format fixes #redmine_number - brief description
  • length of the first commit message line for c684e06 exceeds 65 characters
  • commit message for c684e06 is not wrapped at 72nd column
  • cf236ec must be in the format fixes #redmine_number - brief description

If you don't have a ticket number, please create an issue in Redmine.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@theforeman-bot
Copy link
Member

There were the following issues with the commit message:

  • 5525a98 must be in the format fixes #redmine_number - brief description
  • commit message for 5525a98 is not wrapped at 72nd column

If you don't have a ticket number, please create an issue in Redmine.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@theforeman-bot
Copy link
Member

There were the following issues with the commit message:

  • length of the first commit message line for c7d328f exceeds 65 characters
  • commit message for c7d328f is not wrapped at 72nd column

If you don't have a ticket number, please create an issue in Redmine.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@theforeman-bot
Copy link
Member

There were the following issues with the commit message:

  • length of the first commit message line for c7d328f exceeds 65 characters
  • commit message for c7d328f is not wrapped at 72nd column
  • 132006b must be in the format fixes #redmine_number - brief description

If you don't have a ticket number, please create an issue in Redmine.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

Do not use turbolinks for Ansible button, which could prevent requesting the GET request twice.
@theforeman-bot
Copy link
Member

There were the following issues with the commit message:

  • length of the first commit message line for 71d2eef exceeds 65 characters
  • commit message for 71d2eef is not wrapped at 72nd column

If you don't have a ticket number, please create an issue in Redmine.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@dLobatog
Copy link
Member

[test]

@dLobatog
Copy link
Member

@chilicat This is good, but I want to keep a way to run ansible tasks on demand through the API. I'll make a release with your other PRs except this one - I'll add an endpoint for Ansible tasks to the API, merge this and make another release with both patches, just to not break the endpoint /hosts/ansible_roles for current users.

@dLobatog
Copy link
Member

@chilicat Also mind to add a functional test to ensure everything keeps on working correctly?

@chilicat chilicat changed the title Ansible Button on Host page emits two ansible tasks fixes #17701 - Ansible Button on Host page emits two ansible tasks Dec 19, 2016
@chilicat
Copy link
Contributor Author

@dLobatog thanks for looking into my PRs.

How do I run the unit tests locally?

"I'll add an endpoint for Ansible tasks to the API"
Do you mean you add a POST endpoint in addition to the GET to keep the backwards compatibility?

"but I want to keep a way to run ansible tasks on demand through the API"
That should be still possible but via POST, which makes more sense in my opinion since running ansible is applying a change where GET is for readonly resources.

@dLobatog
Copy link
Member

@chilicat

To run the tests locally, from the foreman directory you can run rake test:foreman_ansible. If you look at lib/tasks/foreman_ansible_tasks.rake in this repository, that's where we've put the task.

POST is fine, I tried to express what I think would make the most sense in #67 (review)

@chilicat
Copy link
Contributor Author

Issue is fixed by #67

@chilicat chilicat closed this Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants