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

Properly monitor the embedded ansible service #13978

Merged
merged 2 commits into from
Feb 21, 2017

Commits on Feb 17, 2017

  1. Configure the secret key when starting the embedded ansible service

    Before this change if someone called start before calling configure,
    they would get into a bad state because we would not have the secret
    key saved.
    
    This would lead tower to use the one on the filesystem which was
    generated at RPM install time which means that every build would
    have access to that key.
    
    This change makes sure that start also does the work of configure
    if configure had not been called yet.
    carbonin committed Feb 17, 2017
    Configuration menu
    Copy the full SHA
    3d7229f View commit details
    Browse the repository at this point in the history
  2. Implement a better worker lifecycle for the embedded_ansible_worker

    Only heartbeat when the locally running ansible service is alive.
    
    Also, start the service if it isn't alive and all the processes are
    not running (EmbeddedAnsible.running?).
    
    We are aware that this opens the potential for a race condition when
    the worker is killed and the server starts a replacement before the
    original worker is completely down.
    
    The combination of implementing EmbeddedAnsibleWorker#kill as #stop
    and starting the service every time we can't heartbeat should allow
    the new worker to recover even if the stop is run after the new worker
    runs EmbeddedAnsible.start
    
    If this does become a problem we will need to implement some new
    mechanisms for dealing with such "singleton" workers.
    carbonin committed Feb 17, 2017
    Configuration menu
    Copy the full SHA
    678c4e7 View commit details
    Browse the repository at this point in the history