AWX configuration from version control?

90 views
Skip to first unread message

john....@intelerad.com

unread,
Oct 15, 2020, 3:07:21 PM10/15/20
to AWX Project
Hi, 

We would like a way to have all of AWX's configuration (e.g. projects, job templates, inventory scripts, users, teams, and so on) be sourced from a Git repo, so that we can spin up AWX clusters that obtain all of the same configuration, and also to take advantage of version control on those objects.

Is something like this possible out of the box?  I see that there is some support to source some things other than the actual Ansible code from Git in recent versions, but that doesn't appear to be the case for all objects within AWX.

Today if we need to copy configuration from one AWX instance to another, it generally means exporting/importing using the command-line awx or tower-cli in the past.

I've been thinking about perhaps starting a repo containing all of the configuration we are interested in, which we could use Jenkins to push changes out to one or more AWX instances.   If something like this exists already I'd rather just use that however.

Thanks in advance,

Cesar Sanchez

unread,
Oct 16, 2020, 12:19:59 AM10/16/20
to AWX Project
Hi John, long time no see... :-) 

I think you'll need to provision your AWX instances and deploy your configuration using ansible, I think that's the easiest way of doing it. You can use the ansible tower modules or the awx collection to interact with AWX, that way you write your playbooks to provision your AWX instances and config.

-Cesar

John Mason

unread,
Oct 16, 2020, 9:06:18 AM10/16/20
to AWX Project
Hi Cesar, indeed, long time no see, hope all is well. 

Yeah, we are trying to come up with a better way than to store everything in playbooks..  maintaining the code this way is kind of painful.  What I am considering doing is exporting these using the CLI from a staging AWX instance into a repo where we could open PRs to merge into say the master branch.  We would then push from master out to the production instances.   



The information contained in this email, including any attachments, is intended solely for use by the individual or entity named above and may be confidential. If you have received this email in error please delete it and notify the sender immediately; you should not retain the message or disclose its contents to anyone. Behavox is a trademark of Behavox Limited, a company registered in England under number 09066452 whose registered office is at 68 South Lambeth Road, London, England, SW8 1RL.  ©2019 Behavox Ltd. All rights reserved.

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/86c1377d-4758-4f75-9df5-296f7d04e1b8n%40googlegroups.com.


--
John Mason
Software Developer -  Technical Services

Intelerad Medical Systems Incorporated
800 Boul de Maisonneuve E, 12th floor
Montreal, QC H2L 4L8


This email or any attachments may contain confidential or legally privileged information intended for the sole use of the addressees. Any use, redistribution, disclosure, or reproduction of this information, except as intended, is prohibited. If you received this email in error, please notify the sender and remove all copies of the message, including any attachments.

John Westcott

unread,
Oct 16, 2020, 9:22:23 AM10/16/20
to John Mason, AWX Project
There are import/export modules in the collection which sit on top of awxkit if you want to leverage them. Not to state the obvious but I’d recommend awxkit instead of tower-cli for this work.

-John 

Sent from my iPhone

Wei-Yen Tan

unread,
Oct 16, 2020, 10:53:23 AM10/16/20
to John Westcott, John Mason, AWX Project
I actually do what you are doing using the set of collection from here :


And I have my tower configuration as code as vars in the form of a yaml data structure. I use git lab so I have a pipeline that runs awx-cli that connects to my awx instance to make changes every time my configuration changes. This includes credentials which are vaulted.

I also include my inventory details in here as well and depending on what it is I use tags to run certain parts of a playbook to implement.

End result? I control my tower configuration. If it is a change in my inventory (depending on whether it will cause an outage). after I push to master, through my pipeline I also make the change to infrastructure at the same time after the tower configuration is made using the corresponding playbook


From: awx-p...@googlegroups.com <awx-p...@googlegroups.com> on behalf of John Westcott <jowe...@redhat.com>
Sent: Saturday, October 17, 2020 2:22:10 AM
To: John Mason <john....@intelerad.com>
Cc: AWX Project <awx-p...@googlegroups.com>
Subject: Re: [awx-project] Re: AWX configuration from version control?
 
Reply all
Reply to author
Forward
0 new messages