Reputation: 21
I have just started learning Ansible configuration management tool and I was going through Linux Academy tutorials to run implement ansible commands, everything was good and easy with the linux-academy servers but when I tried to replicate the same in AWS EC2 instance i was unable to locate the "cd /etc/ansible/hosts". I have installed ansible using pip command i.e., "$sudo pip install ansible". I have been tried to resolve the issue but unable to find any proper documentation. The links I tried to install and configure ansible are as follows:
http://docs.ansible.com/ansible/intro_installation.html
Guide me to configure the ansible hosts path to run the ansible commands and playbooks according to my requirements.
Upvotes: 2
Views: 7655
Reputation: 140
This another way to install ansible.
$ dnf install python-pip
$ pip3 install ansible
Upvotes: 0
Reputation: 1
Steps to install Ansible on EC2 instance [RHEL-8]:
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf config-manager --set-enabled codeready-builder-for-rhel-8-rhui-rpms
dnf install ansible
ansible --version
Use dnf
for faster dependency resolution.
Upvotes: 0
Reputation: 3125
If you are using Ubuntu EC2 instance, follow this: http://docs.ansible.com/ansible/intro_installation.html#latest-releases-via-apt-ubuntu
If you are using Amazon Linux EC2 instance, follow this: http://docs.ansible.com/ansible/intro_installation.html#latest-release-via-yum
Installing via these package managers will create the /etc/ansible/hosts file for you.
Upvotes: 1