Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/prolinuxhub/public_html/wp-includes/script-loader.php on line 757

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/prolinuxhub/public_html/wp-includes/script-loader.php on line 757

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/prolinuxhub/public_html/wp-includes/script-loader.php on line 758

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/prolinuxhub/public_html/wp-includes/script-loader.php on line 758

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/load.php on line 926

Notice: Trying to access array offset on value of type bool in /home/prolinuxhub/public_html/wp-includes/theme.php on line 2360

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 693

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 693

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 693

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 693

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 693

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 693

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 693

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 774

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 774

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 774

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 774

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 774

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 937

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 937

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 937

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 937

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 937

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 937

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 937

Deprecated: Function create_function() is deprecated in /home/prolinuxhub/public_html/wp-content/plugins/synved-shortcodes/synved-shortcode/synved-shortcode.php on line 937

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798
Using Vagrant, VirtualBox and Ansible with CentOS 7 – PROLINUXHUB
Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Notice: Trying to access array offset on value of type null in /home/prolinuxhub/public_html/wp-content/plugins/cta/classes/class.cta.render.php on line 492

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Using Vagrant, VirtualBox and Ansible with CentOS 7

This would be the case when you need to test playbooks locally before using Ansible to deploy them. We assume you already have installed Vagrant, Ansible and VirtualBox. Ansible is one of many provisioners integrated with Vagrant. Lets see how it works

Create Vagrant box with CentOS 7

mkdir centtest
cd centtest
sudo vagrant init

Use Publicly available boxes to add CentsOS 7 box
Add directives to Vagrantfile file

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
end

Next start up and ssh

vagrant up
vagrant ssh

Some useful Vagrant commands
To gracefully shutdown

vagrant halt "ID"

To stop it

vagrant destroy

To remove box

vagrant box remove

To view boxes

sudo vagrant global-status

Use Ansible to provision our vm

Make sure Ansible is installed on Vagrant host
Add lines below to Vigrantfile before the ‘end’

# Provisioning configuration for Ansible.
   config.vm.provision "ansible" do |ansible|
    ansible.playbook = "playbook.yml"
     ansible.sudo = true
   end	
# Run commands as root.
end

Create playbook

In the same directory as Vigrantfile create playbook.yml file with the following content. This test playbook will test weather ntp service is installed and running

---
- hosts: all
  tasks:
  - name: Ensure NTP (for time synchronization) is installed.
    yum: name=ntp state=installed
  - name: Ensure NTP is running.
    service: name=ntpd state=started enabled=yes

Run playbook from current directory

vagrant provision

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/prolinuxhub/public_html/wp-includes/formatting.php on line 4798