Giter Club home page Giter Club logo

ansible-vig's Introduction

Installing Ansible documentation

 https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html#installing-ansible-on-ubuntu

Installing Ansible on Ubuntu

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible -y

copy private key into other server [use scp]

scp -i "sadik.pem" sadik.pem [email protected]:/home/ubuntu/keys

Add server into host_inventory /etc/ansible/hosts

[devservers]
server1 ansible_host=3.82.157.147
server2 ansible_host=3.93.143.85
server3 ansible_host=100.24.22.162

[webservers]
web1 ansible_host=192.168.1.101 ansible_ssh_private_key_file=/path/to/private_key.pem
web2 ansible_host=192.168.1.102 ansible_ssh_private_key_file=/path/to/private_key.pem

ansible should identify the path of private key

adding vars for all servers from all groups

[all:vars]
ansible_python_interpreter=/usr/bin/python3
ansible_user=ubuntu
ansible_ssh_private_key_file=/home/ubuntu/keys/sadik.pem

Run playbook

ansible-playbook --inventory inventory/ansible-import-roles-playbook/hosts ansible-import-roles-playbook.yml

How to find apache is installed or not

type -a apache2 

SSH to EC2 instance

ssh -i /c/Users/VIgnan/Downloads/key-pair.pem
 [email protected]

ansible-vig's People

Watchers

vignan2020 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.