Add SSH Key to AWS EC2 Instance using Ansible Playbook
- hosts: ec2
gather_facts: false
tasks:
-name: Add SSH key to EC2 instance
ec2_key:
name: my_key
key_material: "{{ lookup('file', '/path/to/my_key.pem') }}"
region: us-east-1
state: present
To use this playbook, rep...
gaurav-choudhary.hashnode.dev1 min read