Undertsanding the problem that httpd is not idempotent in nature and solving this issue using ansible.

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.

Ansible Playbook

Ansible is a tool used for configuration management. In this context, configuration management entails keeping a record of company hardware and software, and making changes to them remotely.

Ansible Playbooks are the files where Ansible code is written. These files are written in the language, YAML, which is a funny acronym for, “YAML Ain’t no Markup Language.”

Play-books contain one or more Plays. Plays map a group of computers to a few well-defined roles known as
Tasks. Tasks can be defined as Ansible scripts.

What is Apache Web Server?

Apache HTTP Server is a free and open-source web server that delivers web content through the internet. It is commonly referred to as Apache and after development, it quickly became the most popular HTTP client on the web. It’s widely thought that Apache gets its name from its development history and process of improvement through applied patches and modules but that was corrected back in 2000. It was revealed that the name originated from the respect of the Native American tribe for its resiliency and durability.

Apache supports a variety of features, many implemented as compiled modules which extend the core functionality. These can range from authentication schemes to supporting server-side programming languages such as Perl, Python, Tcl and PHP. Popular authentication modules include mod_access, mod_auth, mod_digest, and mod_auth_digest, the successor to mod_digest. A sample of other features include Secure Sockets Layer and Transport Layer Security support, a proxy module, a URL rewriting module, custom log files, and filtering support.

Idempotency in Ansible

Idempotence is “the property of certain operations in mathematics and computer science that can be applied multiple times without changing the result beyond the initial application”. For Ansible it means after 1 run of a playbook to set things to a desired state, further runs of the same playbook should result in 0 changes. In simplest terms, idempotency means you can be sure of a consistent state in your environment.

you can download and get this complete setup @ my GitHub https://github.com/Abhijeet-274/httpd-idempotent-ansible.git

Configured the inventory of ansible.

Configured the host file of ansible.

Making our workspace and writing their our yaml file.

Writing the handler.conf file.

In this playbook we had installed apache webserver, Copied out html code, Created a template and handler.

Using ansible-playbook command to run the playbook

Thankyou so much for watching please dont forget to like ☺️

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store