Skip to content

Instantly share code, notes, and snippets.

View Affan-7's full-sized avatar
🎯
Focusing

Mohammed Affan Affan-7

🎯
Focusing
View GitHub Profile
@Affan-7
Affan-7 / ansible.cfg to disable host key checking
Created January 2, 2023 09:18
ansible.cfg to disable host key checking
[defaults]
host_key_checking = False
@Affan-7
Affan-7 / hosts - ansible inventory file demo
Last active January 5, 2023 04:44
ansible inventory file demo
[ec2]
<Ip addresses of ec2 instances (use single line for each ip address)>
[ec2:vars]
ansible_user=ec2-user
ansible_ssh_private_key_file=<path to your private ssh key file>
@Affan-7
Affan-7 / apache.yaml for Ansible playbook code to install apache server on amazon linux
Last active January 5, 2023 04:53
Ansible playbook code to install apache server on amazon linux
---
- name: Install apache server # name of the playbook
hosts: ec2 # target group defined in the inventory file
become: yes
tasks:
- name: install apache server # name of the play
yum:
name: httpd
state: latest
update_cache: yes