-
-
Save brunovu20/502997fdd066a43e5d1f3e0cce8242c0 to your computer and use it in GitHub Desktop.
Sample ansible playbook to install nginx with sample page on CentOS7
This file contains hidden or 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
## Credits to John Lieske - https://www.ansible.com/blog/getting-started-writing-your-first-playbook | |
--- | |
- name: Install nginx | |
hosts: host.name.ip | |
become: true | |
tasks: | |
- name: Add epel-release repo | |
yum: | |
name: epel-release | |
state: present | |
- name: Install nginx | |
yum: | |
name: nginx | |
state: present | |
- name: Insert Index Page | |
template: | |
src: index.html | |
dest: /usr/share/nginx/html/index.html | |
- name: Start NGiNX | |
service: | |
name: nginx | |
state: started |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment