HostSEO Blog

Stories and News from IT Industry, Reviews & Tips | Technology Blog


Edit .ini file in other servers using Ansible PlayBook

Introduction:-

Recently we have tried to install ansible in a server machine and we controlled the other servers. Ansible Playbook is a organised unit of scripts which is working in the Controller machine (Ansible installed system). Playbook are written in YAML format.

Here letus try to create Ansible Playbook for edit php.ini file in all other node server that are configured in ansible server.

Controller Machine IP:- 10.0.0.209

Node IP :- 10.0.0.206

* more ip can be used.

Setup Ansible playbook and create yml script to edit .ini file :-

Here we are going to create Ansible Playbook script to edit the value of `soap.wsdl_cache` in to 1 in the ini file existed on node server with the path /opt/cpanel/ea-php.

Make a directory Playbooks in side /etc/ansible.

# mkdir /etc/ansible/playbooks

Create ini.yml using vim tool.

# vim /etc/ansible/playbooks/ini.yml
 tasks:
  - name: Edit the value of ‘soap.wsdl_cache’ to 1 under the section “[soap]”.
    ini_file:
      path: /opt/cpanel/ea-php56/root/etc/php.ini
      section: soap 
      option: soap.wsdl_cache_enabled
      value: 1
      mode: 0600
      backup: yes

Now we have created Ansible Playbook with name ini.yml. Execute the following command to run the script using Ansible.

# ansible-playbook /etc/ansible/playbooks/ini.yml

Thank you ?

Subscribe Now

10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!

Archive Calendar

SatSunMonTueWedThuFri
 12345
6789101112
13141516171819
20212223242526
27282930 

Born in 2004 ... Trusted By Clients n' Experts

SEO Stars

They never made me feel silly for asking questions. Help me understand how to attract more people and improve my search engine ranking.

Read More

Emily Schneller Manager at Sabre Inc
SEO Stars

Took advantage of Hostseo's superb tech support and I must say, it is a very perfect one. It is very fast, servers reliability is incredible.

Read More

Leena Mäkinen Creative producer
SEO Stars

We're operating a worldwide network of servers with high quality standards requirements, we’ve choose hostseo to be our perfect partner.

Read More

Ziff Davis CEO at Mashable
SEO Stars

It’s very comfortable to know I can rely about all technical issues on Hostseo and mostly that my website and emails are safe and secured here.

Read More

Isaac H. Entrepreneur
SEO Stars

With hostseo as a hosting partner we are more flexible and save money due to the better packages with great pricing, free SEO n' free SSL too!

Read More

Madeline E. Internet Professional