ansible-role-apache/tasks/setup-RedHat.yml
2014-05-10 13:33:06 -05:00

24 lines
574 B
YAML

---
- name: Ensure Apache is installed (RedHat).
yum: >
name={{ item }}
state=installed
enablerepo={{ apache_enablerepo }}
with_items: apache_packages
- name: Configure Apache (RedHat).
lineinfile: >
dest={{ apache_server_root }}/conf/{{ apache_daemon }}.conf
regexp="{{ item.regexp }}"
line="{{ item.line }}"
state=present
with_items:
- {
regexp: "^Listen ",
line: "Listen {{ apache_listen_port }}"
}
- {
regexp: "^NameVirtualHost ",
line: "NameVirtualHost *:{{ apache_listen_port }}"
}
notify: restart apache