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

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.

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

Note: Edited by mod team to remove private details.

1 Like

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
2 Likes

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.

- 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.

@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) 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.

Added questions there.
Any lead will be neadful
Thank you

1 Like