Last active
January 5, 2023 04:53
-
-
Save Affan-7/7c213f815b66ef54b6bff4e6f2eb77dc to your computer and use it in GitHub Desktop.
Ansible playbook code to install apache server on amazon linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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 | |
- name: start and enable autostart of apache server | |
systemd: | |
name: httpd | |
state: started | |
enabled: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment