2016-03-05 21:46:54 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: SET_FACT | FreeBSD web user
|
|
|
|
set_fact:
|
2018-03-17 03:56:15 +07:00
|
|
|
nginx_pkgng_package: 'nginx-full'
|
2016-03-05 21:46:54 +07:00
|
|
|
nginx_user: 'www'
|
2017-10-26 15:59:24 +07:00
|
|
|
nginx_php:
|
2018-03-17 03:56:15 +07:00
|
|
|
- version: '7.2'
|
2017-10-26 15:59:24 +07:00
|
|
|
sockets:
|
|
|
|
- host: '127.0.0.1'
|
|
|
|
port: 9000
|
2018-03-17 03:56:15 +07:00
|
|
|
nginx_load_modules:
|
|
|
|
- /usr/local/libexec/nginx/ngx_http_geoip_module.so
|
|
|
|
ngrok_path: '/usr/local/bin/ngrok'
|
2016-03-05 23:26:05 +07:00
|
|
|
|
|
|
|
- name: PKGNG | Install needed packages
|
2017-10-03 22:57:35 +07:00
|
|
|
pkgng:
|
|
|
|
pkg: "{{ item }}"
|
|
|
|
state: present
|
2016-03-05 23:26:05 +07:00
|
|
|
with_items:
|
|
|
|
- curl
|
2018-03-17 03:56:15 +07:00
|
|
|
- daemonize
|
2016-03-05 23:26:05 +07:00
|
|
|
- fcgiwrap
|
2018-03-17 03:56:15 +07:00
|
|
|
- GeoIP
|
|
|
|
- jq
|
2016-03-09 01:37:39 +07:00
|
|
|
- nghttp2
|
2018-03-17 03:56:15 +07:00
|
|
|
- php72
|
|
|
|
- vim
|
|
|
|
|
|
|
|
- name: COMMAND | Get geoip database
|
|
|
|
command: geoipupdate.sh
|
|
|
|
args:
|
|
|
|
creates: /usr/local/share/GeoIP/GeoIP.dat
|
2016-03-05 23:26:05 +07:00
|
|
|
|
|
|
|
- name: SERVICE | Force start services
|
2017-10-03 22:57:35 +07:00
|
|
|
service:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
2016-03-05 23:26:05 +07:00
|
|
|
register: sf
|
|
|
|
with_items:
|
|
|
|
- php-fpm
|
|
|
|
- fcgiwrap
|
2018-03-17 03:56:15 +07:00
|
|
|
|
|
|
|
- name: STAT | Check ports
|
|
|
|
stat:
|
|
|
|
path: /usr/ports
|
|
|
|
register: ports
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
|
|
|
- name: COMMAND | Get ports
|
|
|
|
command: portsnap fetch --interactive
|
|
|
|
|
|
|
|
- name: COMMAND | Extract ports
|
|
|
|
command: portsnap extract
|
|
|
|
no_log: true
|
|
|
|
|
|
|
|
when: not ports.stat.exists
|
|
|
|
|
|
|
|
- name: SHELL | Install ngrok
|
|
|
|
shell: make install clean DISABLE_LICENSES=yes
|
|
|
|
args:
|
|
|
|
chdir: /usr/ports/security/ngrok
|
|
|
|
creates: "{{ ngrok_path }}"
|