ansible-nginx/tests/includes/pre_Debian.yml

83 lines
2.0 KiB
YAML
Raw Normal View History

---
- name: APT_REPOSITORY | Install backports
2023-05-30 20:28:55 +07:00
ansible.builtin.apt_repository:
2017-10-03 22:57:35 +07:00
repo: 'deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main'
state: present
when: nginx_backports
- name: APT | Install needed packages
2023-05-30 20:28:55 +07:00
ansible.builtin.apt:
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
vars:
packages:
- cron
- curl
2019-02-20 21:06:59 +07:00
- daemonize
- jq
- nghttp2
- strace
- vim
- unzip
2017-12-03 04:22:28 +07:00
- name: APT | Install PHP
2023-05-30 20:28:55 +07:00
ansible.builtin.apt:
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
vars:
pkgs:
- php-cli
- php-fpm
- name: SHELL | Get current PHP version
2023-05-30 20:28:55 +07:00
ansible.builtin.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
# Bypasses Ansible+Docker issue. With service module... php is not really started!
- name: COMMAND | Force start PHP
2023-05-30 20:28:55 +07:00
ansible.builtin.command: "service php{{ cur_php_version.stdout }}-fpm start"
args:
creates: "/run/php/php{{ cur_php_version.stdout }}-fpm.pid"
2017-12-03 04:22:28 +07:00
- name: GET_URL | Download ngrok
2023-05-30 20:28:55 +07:00
ansible.builtin.get_url:
url: "https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz"
2017-12-03 04:22:28 +07:00
dest: "/tmp/ngrok.zip"
- name: UNARCHIVE | Uncompress ngrok
2023-05-30 20:28:55 +07:00
ansible.builtin.unarchive:
2017-12-03 04:22:28 +07:00
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
2023-05-30 20:28:55 +07:00
ansible.builtin.set_fact:
2018-03-17 03:56:15 +07:00
ngrok_path: '/tmp/ngrok'
- name: USER | Create PHP User foo
2023-05-30 20:28:55 +07:00
ansible.builtin.user:
name: foo
2021-09-01 16:21:12 +07:00
system: true
2022-11-25 15:52:40 +07:00
- name: INCLUDE_ROLE | hanxhx.php
2023-05-30 20:28:55 +07:00
ansible.builtin.include_role:
2022-11-25 15:52:40 +07:00
name: "{{ playbook_dir }}/hanxhx.php"
vars:
php_version: "{{ cur_php_version.stdout }}"
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'