# Deploy apache in private ec2 instances using jumbox, where AWX having my playbook for installetion

**URL:** <https://forum.ansible.com/t/deploy-apache-in-private-ec2-instances-using-jumbox-where-awx-having-my-playbook-for-installetion/318>\
**Category:** Get Help\
**Tags:** jumphost, awx\
**Created:** [September 8, 2023, 9:41am UTC](https://forum.ansible.com/t/deploy-apache-in-private-ec2-instances-using-jumbox-where-awx-having-my-playbook-for-installetion/318 "2023-09-08T09:41:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anup.sah](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@anup.sah](https://forum.ansible.com/u/anup.sah)\
**Post date:** [September 8, 2023, 9:41am UTC](https://forum.ansible.com/t/deploy-apache-in-private-ec2-instances-using-jumbox-where-awx-having-my-playbook-for-installetion/318/1 "2023-09-08T09:41:28Z")

</div>

HI everyone,

I want to run ansible playbook on AWX and install apache in my private ec2 instances using jump host. I setup the jumbox between private ec2 instance and AWX but still my play book is not working.

```auto
- name: Setting up apache2
    hosts: w.x.y.z.compute-1.amazonaws.com
    become_user: root
    roles:
      - role: role-install/apt-java

```

 ![image](https://us1.discourse-cdn.com/ansible/original/1X/4b32b3412db46e489482564777a4078eda3a1d08.png)

_Note: Edited by mod team to remove private details._

---

<div class="post-metadata">

**Author:** ![Leo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leo/32/23_2.png) [@Leo](https://forum.ansible.com/u/Leo)\
**Post date:** [September 8, 2023, 3:56pm UTC](https://forum.ansible.com/t/deploy-apache-in-private-ec2-instances-using-jumbox-where-awx-having-my-playbook-for-installetion/318/2 "2023-09-08T15:56:38Z")

</div>

Hi @anup.sah,

Can you share the error or problem you are having? The output of the task should help.

Also, I would advise you to remove (or alter) sensitive data like IP addresses when posting. I’m editing the `hosts` line, but I can’t modify the image you embedded, so I would recommend you delete it and paste the content of the variables (mentioning it’s an inventory).

If you don’t replace the image in a while, I will go ahead and remove later today for your security!

Edit notes:

1. Replaced IP address in text
2. Added a code block tag to the play

---

<div class="post-metadata">

**Author:** ![anup.sah](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@anup.sah](https://forum.ansible.com/u/anup.sah)\
**Post date:** [September 12, 2023, 10:18am UTC](https://forum.ansible.com/t/deploy-apache-in-private-ec2-instances-using-jumbox-where-awx-having-my-playbook-for-installetion/318/3 "2023-09-12T10:18:24Z")

</div>

fatal: [ip-19x-xxx-x5-xxx.ec2.internal]: UNREACHABLE! =\> {“changed”: false, “msg”: “Failed to connect to the host via ssh: ssh: connect to host ip-192-168-95-212.ec2.internal port 22: Connection timed out”, “unreachable”: true}

This is the issue which i am facing while running the playbook.

```auto
- name: Install nginx and start service
hosts: [ec2-19x-xxx-x5-xxx0.compute-1.amazonaws.com](http://ec2-19x-xxx-x5-xxx0.compute-1.amazonaws.com)
remote_user: root
become: yes
tasks:
- name: install nginx
apt:
name: nginx
state: latest

- name: install nginx
service:
name: nginx
state: started

```

this one is the playbook i have written for nginx install.

---

<div class="post-metadata">

**Author:** ![gwmngilfen](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gwmngilfen/32/6_2.png) [@gwmngilfen](https://forum.ansible.com/u/gwmngilfen)\
**Post date:** [September 12, 2023, 12:47pm UTC](https://forum.ansible.com/t/deploy-apache-in-private-ec2-instances-using-jumbox-where-awx-having-my-playbook-for-installetion/318/5 "2023-09-12T12:47:57Z")

</div>

@Nikhil I think this is the same as the topic you’re already opened ([I want to run playbook in a private ec2 instance through a jumpbox server and i am running my playbook through AWX and AWX is installed in a another ec2 instance](http://forum.ansible.com/t/i-want-to-run-playbook-in-a-private-ec2-instance-through-a-jumpbox-server-and-i-am-running-my-playbook-through-awx-and-awx-is-installed-in-a-another-ec2-instance/255)) right? You’ve already had a reply there - if that didn’t solve your problem it’s best to say why rather than jumping on another topic and asking the question again.

---

<div class="post-metadata">

**Author:** ![Nikhil](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@Nikhil](https://forum.ansible.com/u/Nikhil)\
**Post date:** [September 12, 2023, 1:13pm UTC](https://forum.ansible.com/t/deploy-apache-in-private-ec2-instances-using-jumbox-where-awx-having-my-playbook-for-installetion/318/6 "2023-09-12T13:13:25Z")

</div>

Added questions there.  
Any lead will be neadful  
Thank you

---

<div class="post-metadata">

**Author:** ![gwmngilfen](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gwmngilfen/32/6_2.png) [@gwmngilfen](https://forum.ansible.com/u/gwmngilfen)\
**Post date:** [October 6, 2023, 9:21am UTC](https://forum.ansible.com/t/deploy-apache-in-private-ec2-instances-using-jumbox-where-awx-having-my-playbook-for-installetion/318/7 "2023-10-06T09:21:24Z")

</div>


