mirror of
https://github.com/Apress/Beginning-Ansible-Concepts-and-Application.git
synced 2024-11-12 18:27:48 +01:00
29 lines
541 B
YAML
29 lines
541 B
YAML
|
- name: Ensure nginx is installed
|
||
|
apt:
|
||
|
name:
|
||
|
- nginx
|
||
|
- php-fpm
|
||
|
- php-mysql
|
||
|
state: present
|
||
|
|
||
|
- name: Configure nginx
|
||
|
template:
|
||
|
src: nginx-default.j2
|
||
|
dest: /etc/nginx/sites-available/default
|
||
|
mode: u=rw,g=r,o=r
|
||
|
notify: "Reload web services"
|
||
|
|
||
|
- name: Push website content to the web root
|
||
|
template:
|
||
|
src: index.html.j2
|
||
|
dest: /var/www/html/index.html
|
||
|
mode: u=rw,g=r,o=r
|
||
|
|
||
|
- name: Firewall - Allow website connections
|
||
|
ufw:
|
||
|
rule: allow
|
||
|
port: "{{ http_port }}"
|
||
|
tags:
|
||
|
- firewall
|
||
|
|