Dynamically choosing an SCM revision on job execution with Ansible Tower

I’m evaluating Ansible Tower as a way to manage configuration and deployment of applications.

I’ve built a small application with an interface to the REST API to manage some of the more complicated steps in the deployment process (for example, logging a ‘build’ in the system upon a successful Jenkins job, and tracking its deployment to various environments), and there is one piece of the puzzle I can’t figure out.

We’re using playbooks and templates to manage config files on servers in what seems to be a pretty standard way, with a ‘project’ set up for a branch of our playbooks git repository, but it doesn’t look like there is a way of picking a particular git revision when executing a job. It would be really nice to, when triggering a job template, tell it which git commit (or tag) we want it to use, since config changes associated with a particular build can best be tracked by git commit, and not simply whatever’s been pushed to a particular branch. One reason for this is, lets say we have changes to group_vars/prod that need to go out on the next push. If those changes were simply pushed to the prod branch of our repository in anticipation of the push, any new production servers brought up before the actual deployment process happened (that is, servers that would have the playbook executed on them between the commit and the actual deployment) would be erroneously getting the new settings. And I’m hoping to avoid complicating the otherwise push-button deployment process with a merge-to-a-git-branch step.

Has anyone here dealt with this sort of use case? Is there a way around it?

tl;dr: Can I choose a specific scm tag or revision a job will run its playbooks from in Ansible Tower?

Hi Paul,

Please ask tower questions to support@ansible.com and we’d be glad to help out.

This list is for the core open source project.

Thanks!

–Michael

did you find this ? or how you are managing it, i am interested too.

Hi all I am facing error in aws please help.

[root@server2 ~]# ssh -i bhadra.pem ec2-user@ec2-50-112-6-190.us-west-2.compute. amazonaws.com
The authenticity of host ‘ec2-50-112-6-190.us-west-2.compute.amazonaws.com (50.1 12.6.190)’ can’t be established.
ECDSA key fingerprint is 1f:1b:6b:13:d2:7a:b5:a4:4b:78:84:b7:98:05:ab:39.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘ec2-50-112-6-190.us-west-2.compute.amazonaws.com,50. 112.6.190’ (ECDSA) to the list of known hosts.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for ‘bhadra.pem’ are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: bhadra.pem
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

You should limit the access to 600, try to run chmod 600 and try again

Try chmod 400 instead of 600 and check if it gives same error