Ansible2018.05.08 18:55

Hello, my blog visitors~!!

In this article, 

I will try to post about my first ansible code. Actually, I drew some architecture for posting an article because I hope that you can understand my ansible code well.

My first ansible project code exist on my github repository like below. 

Github URL:

If you don't know about Cobbler well, you need to study Cobbler and Kickstart before looking this blog. You can study Cobbler following site. (

What is Cobbler?

According to Cobbler, Cobbler is a Linux installation server that allows for rapid setup of network installation environments.

Cobbler with Ansible Architecture

When I developed ansible playbook about cobbler, I didn't know cobbler's process well. so I had found cobbler information on the internet like google. Most blog's posting described only text and codes. so I found cobbler architecture on the internet. but I couldn't understand cobbler architecture and process. I created 3 VMs via KVM and configured test environment like below architecture.

The 3 VM's role are like below.

  • Cobbler Server : This is installation server. It needs dhcp, rsync, tftp, createrepo and apache packages for configuring Cobbler server.

  • Ansible Tower: This is ansible server with web ui. It needs credential for connecting target host via SSH, playbook codes for making Cobbler tasks automatically.

  • Test Server : This is empty bare metal server or VM using Network boot. 

After create 3 VMs, I deployed Cobbler server as refer Cobbler Quickstart Guide. 


and then I deployed Ansible and Ansible Tower as refer Ansible document.


I booted test server using network boot. As soon as start to boot the test server, I could look screen like above blue picture.

Ansible Playbook Architecture

After configure test bed, I started to develop ansible playbook code as refer other people's cobbler playbook. My playbook architecture is like below.

  • add_iso_cobbler.yml : It calls cobbler-addISO's main tasks of roles if this playbook called by ansible tower.

  • remove_iso_cobbler.yml : It calls cobbler-removeISO's main tasks of roles if this playbook called by ansible tower.

  • roles : Roles are ways of automatically loading certain vars_files, tasks, and handlers based on a known file structure. Grouping content by roles also allows easy sharing of roles with other users.

    • cobbler-addISO : It includes tasks and vars for importing ISO image information to cobbler

      • tasks : process for importing ISO image to cobbler.

      • vars : variables about ISO image

    • cobbler-removeISO : It includes tasks and vars for deleting ISO image information from cobbler.

      • tasks : process for deleting ISO image information.

      • vars : variables about ISO image

Ansible Playbook Task Process

My playbook's code of cobbler-addISO task process is like below. If I don't use Ansible and Ansible Tower, I have to execute commands like following tasks everytime maybe. 

Some cobbler playbooks that I found on the ansible galaxy includes from configure cobbler server to import ISO images.

You can look my playbook code in my github repository. If you don't understand after you read this article, I recommend to study about cobbler an kickstart first.

'Ansible' 카테고리의 다른 글

My First Ansible Presentation Story  (1) 2018.07.05
AWS EC2 with Ansible Episode  (0) 2018.06.01
OpenStack Instance auto provisioning with Ansible  (0) 2018.05.16
My First Ansible Project Episode II  (0) 2018.05.08
My First Ansible Project Episode I  (0) 2018.05.04
Posted by 나리 짱!!! naleejang