 team as software engineer it's going to be about Ansible Automation to custom your own industry that is to build your own atomic host but this talk is not going to be about introduction on an atomic host because Dusty already covered that thing so composing of poetry so it's blind server architecture so you have a set of RPMs in the server based on the architecture the requirements would be I need a machine that would act as a server that is going to host the web server to host my oyster repository and the atomic host line that is going to compose the oyster and just configure it through our workstation as a server that that is going to host the oyster oyster package oyster packages and so you will need all the chemo for Fedora atomic they have a script on pack your .io so that is used to build atomic host for that as well in order to add your packages since atomic host is immutable you need to if you want to add your own packages you just added the manifest file there there is a file named Fedora atomic Docker which is a JSON file it has all the list of packages that atomic host is going to have so suppose you need to want to add VM team or server whatever just go on adding the packages there to start the web server that is going to make the oyster available for the consumption of atomic host you can't imagine that so I'm going to create VM or VM from it that is going to act as client and you just rebase it and so that atomic host can use that composed oyster so these are the steps when you want to have your own customer is your own atomic host so I just so I just explained all the steps the first step was my server machine and the requirements so the here is the atomic build script that Fedora atomic has so you will need to clone this repo that has the metadata and script to build the atomic host and this is the file inside that repo where that whichever you have to edit to in order to add packages for the web server I have used simple HTTP server I'm going to make it available on port 35,000 and there we compose the oyster using that manifest file find VM I'll create just rebase the oyster and make the atomic host using the new custom oyster so these are lots of manual steps that you have to do when in order if you want to I mean build your own atomic host or create custom oyster so so I thought to just simplify more in my work that is why I choose Ansible for that so why Ansible because Ansible is agentless so it says client server architecture based you do not need and also you do not need to install any third party packages on server or client in order to use Ansible you just need to install Ansible and Python 2.7 right now we are going to have Python 3.5 support as well later on few releases and it's simple it just uses YAML that is yet another markup language which is totally like English so you do not need to spend time learning a new programming language and it's powerful even it is simple it's powerful because if you know Fedora infrastructure applications they use Ansible to maintain their applications and deploy their applications so even though it's very simple but it's very much powerful and it's secured it uses SSH to establish connection use Ansible for this composing oyster I'm going to show you the steps to website and just make sure that you have Ansible installed on your host and after you've blown the repository and install Ansible you just need to run this playbook setup.yaml on your system so what it is going to does it is going to install the requirements on your system that I was talking about like RPM oyster packages and packages required to create VM from the computer images everything it is also going to start the web server that you will require to solve the oyster and some basic initializing oyster and few steps so after it is done you will need to find the IP address of the HTTP server you just solved so you can use IPADDR command for that and after you have it just put the IP address in the variable file atomic.yaml so there is another variable file where you can add the packages you want to have that is so I wanted to have VM enhanced and get so I added those packages in buildrepo.yaml and there are a few other informations you need to add that is to create VM from QCao image so the client that I'm going to create that you need to provide I mean how many CPUs you want to give it how much of memory and the name of the image that is whatever image you downloaded so after you are done with putting all this data in the variable file just run the main.yaml file which is going to compose the oyster and start the atomic host client and make atomic host consume the new oyster so that's all you are done with having your own custom oyster just reboot the just SSH to the atomic host and if you do our PM query you will have all the new packages added there so I have I have used cloud in it for adding the user ID and password for the VM I have created since right now it is atomic user and password atomic so if you just go on building the repo you will need to use the same username password but you can edit this as well just go to the template file in the repo there is a file where you can edit the user data so on this network it took me a while to compose the oyster that is why I have recorded the demo so I just ran the setup.yaml file now it is running the yaml file which is installing the packages and it started the HTTP server and to make the oyster available then I checked the IP address of the HTTP server and I just put on the IP address in the file that is this one for me and I'm not just going to run the main playbook right now so it is just creating the VM from the kukato image right now you see all the steps here it's build script that is on peggior then it added the packages in the json file that is the manifest file in on the repo and now it is composing the oyster so on this network it took me more than one hour to compose the oyster so I'm going to skip it still composing compose is done and now it is going to retrieve the IP of the VM the atomic VM we have created so this is the current IP now you just SSH to it now it is rebasing the oyster if you if you want to check your atomic host VMs IP you can use the verse command as well now I just SSH to it and checking the RPM oyster status so if you look at the RPM oyster status it's not visible there so there is a bullet sign beside Fedora atomic here which means the atomic host is still using this oyster but we right now have the new oyster composed so in order to make the atomic host use this I'm in custom oyster we need to reboot of reboot so I tried to automate this with Ansible as well but somehow it was successful but it showed me an error message like time out so that's a bad thing in Ansible we are still working on that thing so after reboot just you need to manually SSH again now I'm checking the status again it's not visible on the screen so now right now the bullet sign is on my customer history and I'm checking the packages that I have added in the manifest file and you have all the packages on the atomic host so get the script lines and these are the requirements I have used in the playbook and these were required in order to achieve this this is the setup ml file so here we are installing the requirements and we are doing some basic setup for in order to serve that oyster repository and then this is a file for creating VM so in last defcon Jonathan wrote a script on this it was a shell script so I literally converted that into a playbook so and it became more readable to me so this is the createvm script it is included in the main playbook so you do not have to care about like you have to run that playbook or so these is the main playbook where we have included the createvm and the compose oyster playbook now we are just doing some basic steps for the SSH after the compose and createvm create it's done we are just retrieving the IP of the atomic host vm that we have created and just copying the SSH key so that we can just go ahead and SSH to it and then reducing the oyster and that's it so in just four variables you in order to use this you need to keep in mind that you add these variables that is this is the HTTP server IP address and this is the workspace I have used in this this is the place where you are going to you want to have your atomic build script that is so I have flown the back yours at federal atomic script that this that is this one the repository sorry so it when you add this directory here it is going to clone that repository in this place and then just add it add the packages you want to have in your new atomic host and these are the details for the vm that's it here is the source and slide and blocks blog post if you want to go ahead and read it any questions on this one there was a proposal on it he wanted to do for bare metal provisioning support for this would you like would you can I mean repeat the question I didn't get it we can so in answer I think it would be best to I mean separate keep it abstract abstract via variable not I mean literally everything in playbook so you can use the you do not have to rewrite playbook all the time you have when you have different requirements you just add your variables and just run the playbooks I'm not talking into this issue actually right now but I will maybe some weekend yeah so actually what I did before I wrote an ansible module for the rpm oyster but then we thought that maybe it would be useful to write ansible module for client side use so so actually we need to decide I mean maybe from the atomic community like what kind of client side module you want to add so you mean the atomic host client side or rpm oyster commands like adding packages or checking status this kind of okay okay yeah that would be great so for that maybe we can create an issue create issues on ansible as RFE that would be useful to keep track anything else