Posts

Showing posts with the label Ansible

How Ansible Works?

How Ansible works?  Ansible is a software tool that provides simple but powerful automation for cross-platform computer support. It is primarily intended for IT professionals, who use it for application deployment, updates on workstations and servers, cloud provisioning, configuration management, intra-service orchestration, and nearly anything a systems administrator does on a weekly or daily basis.  Ansible doesn't depend on agent software and has no additional security infrastructure, so it's easy to deploy. In Ansible, there are two categories of computers: the control node and managed nodes. The control node is a computer that runs Ansible. There must be at least one control node, although a backup control node may also exist. A managed node is any device being managed by the control node. Ansible works by connecting to nodes (clients, servers, or whatever you're configuring) on a network, and then sending a small program called an Ansible module to that node. Ansible ...

Sample Ansible Playbook creation

Playbooks are written in yaml format, and you can actually choose where to store your playbooks. In my case I’ll create a folder called playbooks for storing my playbooks, and I’ll create this in the root user’s home directory: [root@controller ~]# pwd /root [root@controller ~]# mkdir playbooks [root@controller ~]# cd playbooks [root@controller playbooks]# pwd /root/playbooks In this directory, I’ll then create a yaml file called HelloWorld.yml ---  - hosts: all    tasks:    - name: Create a file called '/tmp/testfile.txt' with the content 'Hellow World-BRR'      win_copy:        content: hellow world-BRR        dest: c:\temp\testfile.txt This playbook is designed to create the file /tmp/testfile.txt on the client ansibleclient01.local using ansible’s  copy module . You can think of this playbook as a script that you can execute. You can execute this playbook using the ansible-playbook command: PLAY [al...

Ansible Installation

Image
Once you have compared and weighed your options and decided to go for Ansible, the next step is to have it installed on your system. We will go through the steps of installation in different   Linux   distributions, the most popular ones, in the next small tutorial. Install Ansible on Centos/RedHat systems Step 1)  Install EPEL repo [root@ansible-server ~]# sudo yum install epel-release Step 2)  Install ansible package [root@ansible-server ~]# sudo yum install -y ansible Install ansible on Ubuntu/Debian systems Step 1)  Perform an update to the packages $ sudo apt update Step 2)  Install the software-properties-common package $ sudo apt install software-properties-common Step 3)  Install ansible personal package archive $ sudo apt-add-repository ppa:ansible/ansible Step 4)  Install ansible $ sudo apt update $ sudo apt install ansible

Introduction of Ansible

  Ansible   is an open source automation and orchestration tool for software provisioning, configuration management, and software deployment. Ansible can easily run and configure Unix-like systems as well as Windows systems to provide infrastructure as code. It contains its own declarative programming language for system configuration and management. Ansible is popular for its simplicity of installation, ease of use in what concerns the connectivity to clients, its lack of agent for Ansible clients and the multitude of skills. It functions by connecting via  SSH  to the clients, so it doesn’t need a special agent on the client-side, and by pushing modules to the clients, the modules are then executed locally on the client-side and the output is pushed back to the Ansible server. Since it uses SSH, it can very easily connect to clients using SSH-Keys, simplifying though the whole process. Client details, like hostnames or IP addresses and SSH ports, are stored in file...