Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Ansible Locally #20

Open
computate opened this issue Sep 8, 2020 · 1 comment
Open

Install Ansible Locally #20

computate opened this issue Sep 8, 2020 · 1 comment

Comments

@computate
Copy link
Member

The installation of the project for both development and production in containers is completely automated with Ansible.
Begin by installing both the ansible and python3 packages.

sudo yum install -y ansible python3 python3-pip
sudo pip3 install psycopg2

If psycopg2 does not install, run:

sudo pip3 install psycopg2-binary

Ansible on older operating systems.

If you have an older operating system that does not yet support python3, you may struggle to deploy the application on OpenShift in the cloud. The OpenShift Ansible modules seem to require python3 as the system library, so I recommend updating your operating system to something more recent, for example CentOS8 or RHEL8.

On older operating systems, to deploy the development applications you might want to configure ansible for python2.

To deploy to OpenShift, you will want to configure ansible to point to python3.

You might update your ansible configuration like this to make it work:

sudo vim /etc/ansible/ansible.cfg
[defaults]
interpreter_python=/usr/bin/python3

Your dependencies might be different on an older operating system.

sudo yum install -y ansible python python-pip
sudo pip install psycopg2

Setup ssh on your computer for ansible to connect

For ansible to run commands, it needs to be able to ssh and run commands as sudo. For that, make sure the sshd service is started and enabled after a reboot. Also test an ssh connection to your hostname to make sure the host is accepted.

systemctl status sshd
sudo systemctl start sshd
sudo systemctl enable sshd
systemctl status sshd
ssh $HOSTNAME
exit

Ansible training.

For training on ansible and automation, I recommend the following Red Hat course.
By completing the course and taking the exam, you can be a Red Hat Certified Specialist in Ansible Automation.

https://www.redhat.com/en/services/training/do407-automation-ansible-i

@charlescampbell599
Copy link

Working on a Mac, used brew to install ansible:
brew install ansible

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

No branches or pull requests

2 participants