{"id":29291648,"url":"https://github.com/ashmit-kumar/basic_ansible","last_synced_at":"2026-02-04T05:34:18.316Z","repository":{"id":280110498,"uuid":"941006307","full_name":"Ashmit-Kumar/basic_ansible","owner":"Ashmit-Kumar","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-25T08:36:25.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T09:33:28.238Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ashmit-Kumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-01T08:55:04.000Z","updated_at":"2025-03-25T08:36:29.000Z","dependencies_parsed_at":"2025-03-01T10:24:28.459Z","dependency_job_id":"b8442fe1-5534-4b4c-b51e-ae1e0ee89109","html_url":"https://github.com/Ashmit-Kumar/basic_ansible","commit_stats":null,"previous_names":["ashmit-kumar/basic_ansible"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ashmit-Kumar/basic_ansible","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashmit-Kumar%2Fbasic_ansible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashmit-Kumar%2Fbasic_ansible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashmit-Kumar%2Fbasic_ansible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashmit-Kumar%2Fbasic_ansible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ashmit-Kumar","download_url":"https://codeload.github.com/Ashmit-Kumar/basic_ansible/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashmit-Kumar%2Fbasic_ansible/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263868246,"owners_count":23522320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-06T08:09:05.545Z","updated_at":"2026-02-04T05:34:18.264Z","avatar_url":"https://github.com/Ashmit-Kumar.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Setup on WSL for Managing EC2 Ubuntu Servers\nThis guide walks you through the steps to set up Ansible on your WSL (Ubuntu) machine and use it to manage EC2 Ubuntu servers. You'll be able to configure, manage, and automate tasks on your EC2 instances via Ansible.\n\n## prerequisites\n- Before you begin, make sure you have the following:\n- WSL (Ubuntu) installed on your Windows machine.\n- Two EC2 Ubuntu servers with public IP addresses.\n- SSH access configured to the EC2 Ubuntu servers (via key pairs or username/password).\n- Ensure Python is installed on your EC2 servers as Ansible requires Python to be present on the managed hosts.\n\n## Steps\n### Step 1: Install Ansible on WSL (Ubuntu)\nIf using any other Linux Distribution get the appropriate installaion command from google\nOpen your WSL terminal (Ubuntu) and update the package list:\n```bash\nsudo apt update```\nInstall Ansible:\n\nbash\nCopy\nsudo apt install ansible -y\nVerify the installation:\n\nbash\nCopy\nansible --version\nThis should return the installed version of Ansible.\n```\n### Step 2: Configure SSH Access to EC2 Servers\nEnsure you can SSH into your EC2 instances using key-based authentication:\n```bash\nssh -i /path/to/your/key.pem ubuntu@your-ec2-ip\n```\n\n### Step 3: Set Up Ansible Inventory\nCreate an inventory file to define the EC2 hosts:\n\n```bash\necho \"[ec2_servers]\nserver1 ansible_host=your-ec2-ip-1 ansible_user=ubuntu ansible_ssh_private_key_file=/path/to/your/key.pem\nserver2 ansible_host=your-ec2-ip-2 ansible_user=ubuntu ansible_ssh_private_key_file=/path/to/your/key.pem\" \u003e inventory.ini\n```\n\n### Step 4: Test Connectivity\nRun the following command to test connectivity:\n\n```bash\nansible -i inventory.ini ec2_servers -m ping\n```\n\nIf successful, you should see a \"pong\" response from each server.\n\n### Step 5: Run an Ansible Playbook\nCreate a simple playbook to install Nginx on the EC2 servers:\n\n```bash\n- name: Install Nginx on EC2 servers\n  hosts: ec2_servers\n  become: yes\n  tasks:\n    - name: Install Nginx\n      apt:\n        name: nginx\n        state: present\n```\nSave this file as install_nginx.yml and execute it:\n\nansible-playbook -i inventory.ini install_nginx.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashmit-kumar%2Fbasic_ansible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashmit-kumar%2Fbasic_ansible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashmit-kumar%2Fbasic_ansible/lists"}