Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

Apache service not running on vagrant up with CentOS 6 #352

Open
christopher-hopper opened this issue Apr 12, 2016 · 2 comments
Open

Apache service not running on vagrant up with CentOS 6 #352

christopher-hopper opened this issue Apr 12, 2016 · 2 comments

Comments

@christopher-hopper
Copy link
Contributor

Problem

The Apache daemon (httpd) does not start on boot using vagrant up with a CentOS 6 Vlad box.

Steps to Reproduce

  1. Boot into an Ubuntu 14.04 LTS host

  2. Download and Install Vlad and VirtualBox 4.3.36

  3. Follow the Getting Started instructions with VirtualBox as your virtual machine provider

  4. Set the vlad_os to centos67 in the Vlad settings file vlad_guts/vlad_settings.yml

    vlad_os: "centos67"
  5. Run vagrant up

  6. Once vagrant has finished successfully run vagrant ssh

  7. At the command line check the status of the Apache daemon

    sudo service httpd status

Expected Result

The Apache daemon is running.

Actual Result

The Apache daemon is not running. This is what I see:

# sudo service httpd status
httpd is stopped

I also get this output from vagrant, which indicates the vlad local_up_services playbook fails.

==> vlad: Running triggers after up...
==> vlad: Executing 'up' services trigger
==> vlad: Executing command "ansible-playbook -i 192.168.100.120, /home/chopper/Projects/vlad/vlad_guts/playbooks/local_up_services.yml --private-key=~/.vagrant.d/insecure_private_key --extra-vars local_ip_address=192.168.100.120"...
==> vlad: 
==> vlad: PLAY ***************************************************************************
==> vlad: 
==> vlad: TASK [setup] *******************************************************************
==> vlad: fatal: [192.168.100.120]: UNREACHABLE! => {"changed": false, "msg": "SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh", "unreachable": true}
==> vlad:   to retry, use: --limit @/home/chopper/Projects/vlad/vlad_guts/playbooks/local_up_services.retry
==> vlad: 
==> vlad: PLAY RECAP *********************************************************************
==> vlad: 192.168.100.120            : ok=0    changed=0    unreachable=1    failed=0   

I've tried running this ansible playbook manually, but it doesn't work, even though I can ssh to the server manually. This works:

ssh -i ~/.vagrant.d/insecure_private_key [email protected]
Last login: Tue Apr 12 04:22:04 2016 from 10.0.2.2

This fails:

ansible-playbook -i 192.168.100.120, /home/chopper/Projects/vlad/vlad_guts/playbooks/local_up_services.yml --private-key=~/.vagrant.d/insecure_private_key --extra-vars local_ip_address=192.168.100.120

PLAY ***************************************************************************

TASK [setup] *******************************************************************
fatal: [192.168.100.120]: UNREACHABLE! => {"changed": false, "msg": "SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh", "unreachable": true}
    to retry, use: --limit @/home/chopper/Projects/vlad/vlad_guts/playbooks/local_up_services.retry

PLAY RECAP *********************************************************************
192.168.100.120            : ok=0    changed=0    unreachable=1    failed=0   
@christopher-hopper
Copy link
Contributor Author

I need help with this one. For now, I've been manually starting the Apache daemon when I bring the box up using:

sudo service httpd start

Not sure how to solve this. Help Wanted

@christopher-hopper
Copy link
Contributor Author

Not sure if this is relevant, but I also notice this failure happens earlier when running playbooks/local_up.yml for TASK [local actions | check that ~/.ssh/config exists on host machine]

==> vlad: Executing command "ansible-playbook -i 192.168.100.120, /home/chopper/Projects/vlad/vlad_guts/playbooks/local_up.yml --extra-vars local_ip_address=192.168.100.120 --extra-vars vlad_local_inventory_dir=/home/chopper/Projects/vlad/vlad_guts"...
==> vlad: 
==> vlad: PLAY ***************************************************************************
==> vlad: 
==> vlad: TASK [local actions | check local ip address is defined] ***********************
==> vlad: skipping: [192.168.100.120]
==> vlad: 
==> vlad: TASK [local actions | set local inventory directory] ***************************
==> vlad: ok: [192.168.100.120 -> 127.0.0.1]
==> vlad: 
==> vlad: TASK [local actions | create local host.ini file] ******************************
==> vlad: ok: [192.168.100.120 -> 127.0.0.1]
==> vlad: 
==> vlad: TASK [local actions | establish current username on host machine] **************
==> vlad: ok: [192.168.100.120 -> 127.0.0.1]
==> vlad: 
==> vlad: TASK [local actions | check that ~/.ssh/config exists on host machine] *********
==> vlad: fatal: [192.168.100.120 -> 127.0.0.1]: FAILED! => {"changed": false, "failed": true, "failed_when_result": true, "stat": {"exists": false}}
==> vlad: 
==> vlad: NO MORE HOSTS LEFT *************************************************************
==> vlad:   to retry, use: --limit @/home/chopper/Projects/vlad/vlad_guts/playbooks/local_up.retry
==> vlad: 
==> vlad: PLAY RECAP *********************************************************************
==> vlad: 192.168.100.120            : ok=3    changed=0    unreachable=0    failed=1   

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant