2016-03-05 21:46:54 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: APT_REPOSITORY | Install backports
|
2017-10-03 22:57:35 +07:00
|
|
|
apt_repository:
|
|
|
|
repo: 'deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main'
|
|
|
|
state: present
|
2017-10-26 15:59:24 +07:00
|
|
|
when: nginx_backports
|
2016-03-05 21:46:54 +07:00
|
|
|
|
|
|
|
- name: APT | Install needed packages
|
2017-10-03 22:57:35 +07:00
|
|
|
apt:
|
2019-01-24 17:05:46 +07:00
|
|
|
pkg: "{{ packages }}"
|
2021-09-01 16:21:12 +07:00
|
|
|
update_cache: true
|
2017-10-03 22:57:35 +07:00
|
|
|
cache_valid_time: 3600
|
|
|
|
state: present
|
2019-01-24 17:05:46 +07:00
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- cron
|
|
|
|
- curl
|
2019-02-20 21:06:59 +07:00
|
|
|
- daemonize
|
2019-01-24 17:05:46 +07:00
|
|
|
- jq
|
|
|
|
- nghttp2
|
|
|
|
- strace
|
|
|
|
- vim
|
|
|
|
- unzip
|
2017-12-03 04:22:28 +07:00
|
|
|
|
2017-10-26 15:59:24 +07:00
|
|
|
- name: APT | Install PHP
|
2017-10-03 22:57:35 +07:00
|
|
|
apt:
|
2019-12-29 22:29:18 +07:00
|
|
|
pkg: "{{ pkgs }}"
|
2021-09-01 16:21:12 +07:00
|
|
|
update_cache: true
|
2017-10-03 22:57:35 +07:00
|
|
|
cache_valid_time: 3600
|
|
|
|
state: present
|
2019-12-29 22:29:18 +07:00
|
|
|
vars:
|
|
|
|
pkgs:
|
|
|
|
- php-cli
|
|
|
|
- php-fpm
|
|
|
|
|
|
|
|
- name: SHELL | Get current PHP version
|
|
|
|
shell: php --version | awk '/^PHP/ { print $2 }' | grep -o -E '^.{3}'
|
|
|
|
changed_when: false
|
|
|
|
register: cur_php_version
|
2016-10-13 15:19:24 +07:00
|
|
|
|
2019-01-24 17:05:46 +07:00
|
|
|
# Bypasses Ansible+Docker issue. With service module... php is not really started!
|
2017-12-07 18:40:16 +07:00
|
|
|
- name: COMMAND | Force start PHP
|
2019-12-29 22:29:18 +07:00
|
|
|
command: "service php{{ cur_php_version.stdout }}-fpm start"
|
2019-01-24 17:05:46 +07:00
|
|
|
args:
|
2019-12-29 22:29:18 +07:00
|
|
|
creates: "/run/php/php{{ cur_php_version.stdout }}-fpm.pid"
|
2019-01-24 17:05:46 +07:00
|
|
|
warn: false
|
2017-12-03 04:22:28 +07:00
|
|
|
|
|
|
|
- name: GET_URL | Download ngrok
|
|
|
|
get_url:
|
|
|
|
url: "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip"
|
|
|
|
dest: "/tmp/ngrok.zip"
|
|
|
|
|
|
|
|
- name: UNARCHIVE | Uncompress ngrok
|
|
|
|
unarchive:
|
|
|
|
src: "/tmp/ngrok.zip"
|
|
|
|
dest: "/tmp"
|
2021-09-01 16:21:12 +07:00
|
|
|
remote_src: true
|
2017-12-03 04:22:28 +07:00
|
|
|
|
2018-03-17 03:56:15 +07:00
|
|
|
- name: SET_FACT | ngrok_path
|
|
|
|
set_fact:
|
|
|
|
ngrok_path: '/tmp/ngrok'
|
2019-12-26 23:16:13 +07:00
|
|
|
|
|
|
|
- name: USER | Create PHP User foo
|
|
|
|
user:
|
|
|
|
name: foo
|
2021-09-01 16:21:12 +07:00
|
|
|
system: true
|
2019-12-26 23:16:13 +07:00
|
|
|
|
2022-11-25 15:52:40 +07:00
|
|
|
- name: INCLUDE_ROLE | hanxhx.php
|
2019-12-26 23:16:13 +07:00
|
|
|
include_role:
|
2022-11-25 15:52:40 +07:00
|
|
|
name: "{{ playbook_dir }}/hanxhx.php"
|
2019-12-26 23:16:13 +07:00
|
|
|
vars:
|
2019-12-29 22:29:18 +07:00
|
|
|
php_version: "{{ cur_php_version.stdout }}"
|
2019-12-26 23:16:13 +07:00
|
|
|
php_autoremove_default_pool: false
|
|
|
|
php_fpm_poold:
|
|
|
|
- name: 'hx_unix'
|
|
|
|
user: 'foo'
|
|
|
|
php_value:
|
|
|
|
display_errors: 'Off'
|
|
|
|
php_admin_value:
|
|
|
|
memory_limit: '98M'
|
|
|
|
- name: 'hx_ip'
|
|
|
|
listen: '127.0.0.1:9636'
|