Skip to content

Instantly share code, notes, and snippets.

@pspravin
Created May 2, 2017 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pspravin/76d0143436176286dc46975505fb39f2 to your computer and use it in GitHub Desktop.
Save pspravin/76d0143436176286dc46975505fb39f2 to your computer and use it in GitHub Desktop.
[opc@vm04 ansible]$ vi webserver.yml
---
- hosts: webserver
become: true
tasks:
- name: install epel
yum: name="https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" state=present
- name: install web components
yum: name={{item}} state=present
with_items:
- httpd
- mod_wsgi
- python-pip
- python-virtualenv
- name: ensure apache started
service: name=httpd state=started enabled=yes
- name: ensure mod_wsgi enabled
modules: state=present name=mod_wsgi
notify: restart httpd
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