Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ansible/ansible-examples.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lamp_simple/roles/web/tasks/install_httpd.yml')
-rw-r--r--lamp_simple/roles/web/tasks/install_httpd.yml23
1 files changed, 18 insertions, 5 deletions
diff --git a/lamp_simple/roles/web/tasks/install_httpd.yml b/lamp_simple/roles/web/tasks/install_httpd.yml
index ac29195..4de593d 100644
--- a/lamp_simple/roles/web/tasks/install_httpd.yml
+++ b/lamp_simple/roles/web/tasks/install_httpd.yml
@@ -2,7 +2,9 @@
# These tasks install http and the php modules.
- name: Install http and php etc
- yum: name={{ item }} state=present
+ yum:
+ name: "{{ item }}"
+ state: present
with_items:
- httpd
- php
@@ -12,13 +14,24 @@
- 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"
+ 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
+ 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
+ seboolean:
+ name: httpd_can_network_connect_db
+ state: true
+ persistent: yes
when: sestatus.rc != 0