Migrate AWX and AAP to Ascender
Moving an automation controller by hand means re-creating every inventory, project, credential and job template. This demo shows a pair of Ansible playbooks, built on the awx.awx collection and community of practice roles, that export the configuration of an AWX, Ansible Automation Platform or Ascender server to YAML files and import it into another. Greg Sowell runs the export from an AAP server against itself, then imports into an Ascender test box that starts with six job templates and ends with thirty-six, plus eighteen hosts and ten inventories.
The export playbook has a list of object types that are uncommented to include; the import playbook uses the same list, imports inventories with hosts and groups by default, and can filter out users, such as the admin account performing the import, and system schedules. Every import step sits in a block and rescue so that API connection failures on lightly resourced servers get a second attempt. Ordering matters for piecemeal imports, since a job template referencing an unknown execution environment will fail.
The video is honest about version 1.0 caveats: credential and user passwords are not exported, role assignments are not imported by the collection, LDAP users should log in before migration, and server settings are not yet handled. Anyone consolidating controllers or cloning environments gets a working starting point and a preview of a Git-backed 2.0.
Key takeaways
- The export and import playbooks use the awx.awx collection and can move configuration between any mix of AWX, AAP and Ascender servers.
- Object types to export or import are controlled by commenting or uncommenting entries in a single export objects list.
- Inventories import with their hosts and groups by default, which dynamic inventories do not need but static lab inventories do.
- Filter out the admin user before importing, because imported users have no password and the import would lose its connection midway.
- Each import task runs in a block and rescue so API connection failures get an automatic retry; the demo finished with zero rescues.
- Credential passwords, role assignments and server settings are not migrated in this first version and are targets for later releases.
Questions this video answers
How do you migrate from AWX or Ansible Automation Platform to Ascender?
Run the export playbook against the source server with the export host passed as an extra var; it writes each object type to a YAML file. Then run the import playbook pointed at the new Ascender server. The demo brought over hosts, inventories, projects, credentials and thirty job templates in one run.
What does the AWX to Ascender migration not carry over?
Credential and user passwords are not exported, so credentials must be re-entered unless a secrets engine is used. Role assignments are exported but not imported by the collection, though team-based roles largely come across. Server settings such as logging are not exported yet, and LDAP users should log in to the new server first.
Why does the import playbook use block and rescue?
Importing large batches can hammer the API, and on lower-resource servers that produced connection refused or failed errors in testing. Each import runs inside a block, and if it fails the rescue section runs the same role again. Occasionally a second full playbook run is needed, but in testing that always succeeded.
This video is part of the Ascender Pro playlist. Browse every CIQ video by product and topic.
Transcript
hey everybody I'm Greg Sowell and welcome to another ciq demo today I am super excited to show you this because frankly I'm sick of looking at it no actually I've uh I've just been putting a lot of time into this and so I'm really pleased for it to see the light of day but in this one I'm going to be showing you how to use automation to export all of your information from one awx based system and push it into another and so specifically in this demo I'm going to be showing you how to pull all of your information out of the anible automation
platform by red hat and pushing into a clean Ascender install so let's get started right here I've got my AAP server configured you can see I've got hosts inventories projects I got a little bit of everything in here and I'm going to go to the template section because I've already created um the templates inside of here so I'm actually using AAP itself to do the migration now this could be the uh Source system that I'm going do the export from and then push over to the uh to the remote I could be running it from there I could be running it on the remote side
it really doesn't matter in my case in all of my testing I actually did it from a uh a third Ascender uh server right just kind of sitting off to the side so it really doesn't matter what's doing the pull and the push it should work kind of the same all the way through so in here I've got two playbooks I've got the export one and the import one the export one I'm going to hit the little edit button on it really quick just so you can see I have uh the uh inventory configured project The Playbook and there's a blog post associated with all
this so uh fret not trying to take screenshots it'll all be available and easily explained to you I'm using uh also a couple of credentials one to log into a remote server so I'm using kind of a thirdparty server uh to store all the exported configurations right so it's just going to push to this little server now later down the road I'm going to be doing a a 2.0 version of this showing you some really cool stuff I'm going to be uh implementing with it and that one's going to be actually pushing to your G repository that's a couple of extra steps and so I
View full transcriptHide full transcript
just wanted to keep this as simple as possible for everybody so for now it's just kind of saving those files to a just a a random server that happens to exist somewhere uh here I'm using my cloud credential I created a custom credential to actually log into the um the exported Source in this case it's actually going to be exporting from itself uh right here in the variable section so export host is an important option and so I'm passing this in as hey who's the host that I want to actually export this information from you could edit the Playbook if you wanted to but I
prefer to just pass it in as extra bars anyway that's it on the configuration side and now all I'd have to do is hit launch um through the uh magic of uh cooking show editing I've already exported all this information so um let me take a look at the export Playbook really quick just to tell you the pieces you really need to know about it just kind of get all that out of the way so export Playbook is pretty simple you see there's not very many steps it's really just going to connect in and Export all the things that you are specifying for it to
do so and so really it's in this export object section so anything that is uncommented here is something that's going to get export and it's going to create kind of an individualized file for that thing right so application credentials credential type all that stuff I've got it set to export off now if there was something in here I didn't want to export comment it out and guess what it doesn't export it when you run it so again uh down here you could see um the environment variables that I'm setting up so this is I'm using the uh awx abox collection to actually Connect into the
export as well as the import piece and uh right here in the environment section is where it kind of sets up all those little variables now you could hard code username and password if you wanted to I'm using uh again a custom credential so it's stored in um my either sender or AAP right it's kind of securely stored in there and it's pulled out at execution time and utilize in my playl looks that way I can keep all this stuff in a public G repository and I don't have to worry about you know leaking secret information also you can see the export host variable in
there remember that's the extra bar I'm passing over hey telling it you know what server am I connecting to to actually export this stuff out now once it does export out I am taking all those files and I'm just sticking them in a folder right here called configs you can see here they are nothing too crazy in there uh so say for example uh applications right it's just spitting all this stuff out in kind of yaml format nothing uh nothing too nutty there so it's easy to look at it's easy to configure if I want to so that's all the exported information now let's do
the import right that's got to be more complicated right um and in fact it is not more complicated in here I'm going to take a look at the import Playbook I'm going to hit the edit button it's very much the same all the same configurations except uh instead of the export Playbook it's the import Playbook same credentials because I'm using the same authentication on both sides and then I've got imported host so remember before we had exported host now we have imported host and it's going into my Ascender test 9 server and let me hit cancel there and just before I actually run this uh
here is the Ascender test 9 you can see the number of hosts inventories projects right all that's lower right I think we oh let's just take a look here look at the dashboard we went from 189 And1 uh down to basically 01 and4 right so Ascender has some projects and it actually has some job templates in there I believe it's got got six job templates if I check the other one I believe has 30 job templates let me take a look really quick so by the end of this there should be 36 job templates in the Ascender test 9 server right the one that it's
kind of being imported into so I'm going to go ahead and launch the import Playbook and while I do that I'm just going to talk briefly about the um import Playbook I just want to walk you through some of those pieces so right here in the import Playbook some of the stuff to uh to keep in mind is it's the exact same uh variable so it says export objects and anything that's in here is actually going to get imported into my my new import server right whichever one I'm pointing to all these values are going to get imported in there so if there's anything that
I don't want technically I can uncomment or rather I can comment that out and it won't attempt to do the import now keep in mind that some things do require various objects uh right and there's so if you're going to import the entire thing so I'm doing a full export and a full import you have to actually do some of those things in order right so say for example I'm uh trying to bring in a job template that has a specific execution environment well if I didn't import in that execution environment and the system doesn't know about it when I try and add in that
job template that's calling an unknown execution environment it's going to fail right so you have to kind of keep in mind order of operation all this taken care of for you in here if you're a full export full import but if you're just trying to peace meal it keep in mind your mileage may vary on some of that stuff now something else that happens is by default when you import an inventory it doesn't bring in hosts or groups so if you look right here I've got addore host addore groups they're both True by default and so if you are importing inventories it will bring in
your hosting groups as well so if you're doing Dynamic inventories no problem you don't have to worry about any of that stuff because it's all going to get brought in and uh populated On Demand right like as you refresh that project or or synchronize that um or rather that inventory as you synchronize that inventory it'll bring all that information in but for me a lot of my environments are static because I just do a lot of testing a lot of demoing so I did want to bring all those stuff rather all that stuff in and I had to kind of build out all of those
pieces to make all that happen now this Playbook also has the option to filter users that are imported so if I am reporting users I can filter out which ones and so you can see I have the admin user is filtered out because that's what I'm actually using to do the import stuff and whenever you bring users in by default there is no password so if you import the admin user halfway through your uh automation it's going to break because you can't connect anymore so keep in mind if you want to filter anything out you can do that right here I also have the ability
to filter out schedule jobs if you want to so I pull out all the system ones cuz they're already going to be there and then we hit hit kind of the task section now I just want you to keep them just keep kind of a mental Tally from here the top all the way until we actually start doing processing I have to do a lot of configuration manipulation on the variables on the data type the way it looks like I have to do some formatting I have to build some stuff in the case of um hosts and groups and so there's a lot of stuff
you have to fix uh some of it is just the way the collection works and expect it in a specific format some is the um The Coop roles that I'm using so the community of practice built some awesome roles for pulling this stuff in and I'm um super glad they did because it makes processing much faster on some of this stuff the importing and exporting can be a little bit slow in the way they've written them it makes the importing really fast but you can take a look at this all of this is me just formatting variables manipulating things making it all work and so
there was a ton I had to actually put into this thing all right now we actually get to the processing section so here I wanted to kind of explain what I'm doing a little bit on some of this now if you take a look at it you can see I have a block and rescue on every one of these things that I'm importing I found that sometimes especially for larger chunks of information you'll actually uh error out uh if it's trying to import a lot of stuff and I found if you're really hammering the API especially on machines that are kind of lower resources which
mine are in my lab environment I don't I don't give them a ton of of resources right just because they're they're little test boxes and so I can overrun the API and I'll start getting like um connection refusal or connection fail errors and so a block and rescue allows you to the block portion we'll try and complete if anything fails inside of there it'll kick over to the rescue portion um and in the rescue portion I'm running the exact same rule I'm calling the exact same thing so I'm basically giving it a second try and I found in my testing most of the time this
works just fine occasionally occasionally um it will fail and I'll need to just run the Playbook one more time and everything works fine I've not had it uh had of an opportunity where running it right because each time I run this it's going to technically try uh each task twice I've had uh no opportunity or rather no instance where running it the four times didn't actually uh get it all working but it should go through and do all the export so now that I have talked and talked I'm going to pop back over to the running automation you can see it's processing and through the
magic of editing uh you won't have to watch all this I'll pause and come back when it's ready now that everything has completed it completed successfully I'm going to scroll down to the bottom and let's see if we hit any rescues so if you do in your blocks you actually hit that rescue section it would show up down here so I'm showing uh rescue zero that means it actually processed all the way through correctly the first time which I mean good for us so we had uh uh very few objects in side of the previous Ascender let's go back to the dashboard all right there's
our 18 hosts our 10 inventories all of our projects if I go to templates we did have six we should have 36 yeah there they are so everything was able to import in correctly so uh question is this perfect no this is not right it's not going to do absolutely everything so there are some caveats I kind of got my my little list over here I'm taking a look at it so as I mentioned earlier when you're you bring in um uh credentials I think I mentioned on credentials or at least users uh there are no passwords right so that's something that you don't necessarily
want to export out in plain text all of your credential passwords you probably don't want that showing up and so the export process doesn't actually pull that stuff out now in the case of credentials if you are using uh say for example a Secrets engine which is just a server that sits off to the side and the automation will query that at runtime for those actual secrets right whether it be um a password usernames sometimes tokens Keys all that stuff um if you're using a Secrets engine no big deal right it's just going to be referencing uh that Secrets engine and everything will work just
fine now on the case of users it's kind of a little tricky um so user accounts if you're using some external audification system like L app probably what you want to do is have all of your users log in to the new server you're going to be migrating to do first right get all those accounts created via L app and then you can do the migration process the problem there is if you have a um a user account that's kind of a physical local account it won't attempt to do the L app lookup first right it'll just like accept that so one workaround could be
yeah have everybody log in first or potentially just don't export and import users right something else that's a big one that uh I would say look for in version 2.x on on this or 1.x you know cuzz this is our very first iteration of this um is rolls and so while it is exporting Ro information The awx awx Collection is an importing Ro information right so if you are very specifically setting up roles that's not going to be there now in most environments um you'll have teams right which are just groups and you're going to put those roles on said teams and so they'll uh
import that information so you don't usually have that many um that many teams right to adjust the roles and so if you did have to kind of do that one time doesn't seem like it would be that big a deal especially when you kind of factor in how much time you're going to be saving doing most of the automation or most of the migration uh automatically so again that's just something to keep track of and that's something we want to definitely address in the future so keep that in mind so something else is that that the export module isn't doing server settings so say for
example like your logging settings and things like that it's not the export um module in the um awx ax collection isn't isn't pulling that information out now it is available in the API and so we can pull that out and we can push it and so again that's going to be something we're working on adding into the next iteration so keep your eyes open for that now I hope you saw how quickly and easily you can pull almost all of your automation information and push it into a nice fresh clean server and again this will move information from um Ascender awx AAP and push
it into any one of those other ones right so I could pull from one Ascender box and push into another so this could be something I use for um I've got my test environment and I'm pulling and then pushing into a Dev environment and then pulling and pushing into into a prod maybe uh something like that uh it could be really good for just kind of cloning a system when you want to do a little tweaking testing over here of try some various things uh maybe it's kind of a backup method and it also kind of gives you an idea of how you can store
your information kind of config as code so if you do an export it could give you a good template to sort of build future things on so I do have a new version of this right kind of a new use case where you have a primary server that uh you do all your configuration on and and the ultimate goal is uh it will back up its configuration so it'll export it to a uh get repository and then from there it will uh allow all of the other remotes kind of all over the globe to connect in and pull those configs into their systems right so
that'll be a pretty cool use case I think um I would say look out for that now we've reached the portion of the video where I say if you have any questions or comments I would love to hear them um if you would like some help migrating from another system over to Ascender uh we would be delighted to help you with that we do support for all this stuff and um we do it fairly affordably so thank you for watching happy uh automating Happy migrating happiest ending and we'll see you next time bye
Built for scale. Chosen by the world’s best.
2.75M+
Rocky Linux instances
Being used world wide
90%
Of fortune 100 companies
Use CIQ supported technologies
250k
Avg. monthly downloads
Rocky Linux
9
Enterprise products
Spanning the kernel to the orchestrator
Have questions about your infrastructure?
Talk to a CIQ engineer about Rocky Linux, HPC, and AI infrastructure.
