Created
November 2, 2013 19:46
-
-
Save jcalonso/7282767 to your computer and use it in GitHub Desktop.
Example of ansible playbook
taken from:
https://github.com/ansible/ansible-examples/blob/master/lamp_simple/roles/web/tasks/install_httpd.yml
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
--- | |
# These tasks install http and the php modules. | |
- name: Install http and php etc | |
yum: name={{ item }} state=present | |
with_items: | |
- httpd | |
- php | |
- php-mysql | |
- git | |
- libsemanage-python | |
- libselinux-python | |
- name: insert iptables rule for httpd | |
lineinfile: dest=/etc/sysconfig/iptables create=yes state=present regexp="{{ httpd_port }}" insertafter="^:OUTPUT " | |
line="-A INPUT -p tcp --dport {{ httpd_port }} -j ACCEPT" | |
notify: restart iptables | |
- name: http service state | |
service: name=httpd state=started enabled=yes | |
- name: Configure SELinux to allow httpd to connect to remote database | |
seboolean: name=httpd_can_network_connect_db state=true persistent=yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment