Created
March 11, 2020 18:10
-
-
Save rifkiaz/cf7838c55b673d3f9da6520e82c442bb to your computer and use it in GitHub Desktop.
instalasi nginx sample ansible
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
--- | |
- name: install and start httpd | |
hosts: web | |
tasks: | |
- name: install epel repo | |
yum: name=epel-release state=latest | |
- name: install python bindings for selinux | |
yum: name={{item}} state=latest | |
with_items: | |
- libselinux-python | |
- libsemanage-python | |
- name: test to see if selinux is running | |
command: getenforce | |
register: sestatus | |
changed_when: false | |
- name: install httpd | |
yum: name=httpd state=latest | |
notify: restart httpd | |
- name: start httpd service | |
service: name=httpd state=started enabled=yes | |
- name: copy index.html | |
template: src=index.html.j2 dest=/var/www/html/index.html | |
- name: install firewalld | |
yum: name=firewalld state=latest | |
- name: start firewalld service | |
service: name=firewalld state=started enabled=yes | |
- name: insert firewalld rule | |
firewalld: service=http permanent=true state=enabled immediate=yes | |
handlers: | |
- name: restart httpd | |
service: name=httpd state=restarted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment