mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-02-24 09:03:29 +07:00
🚨 Fix linter
This commit is contained in:
committed by
Emilien M
parent
257437731a
commit
d262ddd79e
@@ -244,14 +244,12 @@
|
||||
ansible.builtin.shell: set -o pipefail && curl -I --haproxy-protocol http://test-ssl-proxy-protocol.local:20080 | grep -qi 'X-Proxy-Protocol'
|
||||
args:
|
||||
executable: /bin/bash
|
||||
warn: false
|
||||
changed_when: false
|
||||
|
||||
- name: SHELL | Check HTTPS proxy protocol
|
||||
ansible.builtin.shell: set -o pipefail && curl -I --haproxy-protocol -k https://test-ssl-proxy-protocol.local:20443 | grep -qi 'X-Proxy-Protocol'
|
||||
args:
|
||||
executable: /bin/bash
|
||||
warn: false
|
||||
changed_when: false
|
||||
|
||||
# --------------------------------
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
|
||||
- name: APT_REPOSITORY | Install backports
|
||||
apt_repository:
|
||||
ansible.builtin.apt_repository:
|
||||
repo: 'deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main'
|
||||
state: present
|
||||
when: nginx_backports
|
||||
|
||||
- name: APT | Install needed packages
|
||||
apt:
|
||||
ansible.builtin.apt:
|
||||
pkg: "{{ packages }}"
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
@@ -24,7 +24,7 @@
|
||||
- unzip
|
||||
|
||||
- name: APT | Install PHP
|
||||
apt:
|
||||
ansible.builtin.apt:
|
||||
pkg: "{{ pkgs }}"
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
@@ -35,39 +35,38 @@
|
||||
- php-fpm
|
||||
|
||||
- name: SHELL | Get current PHP version
|
||||
shell: php --version | awk '/^PHP/ { print $2 }' | grep -o -E '^.{3}'
|
||||
ansible.builtin.shell: php --version | awk '/^PHP/ { print $2 }' | grep -o -E '^.{3}'
|
||||
changed_when: false
|
||||
register: cur_php_version
|
||||
|
||||
# Bypasses Ansible+Docker issue. With service module... php is not really started!
|
||||
- name: COMMAND | Force start PHP
|
||||
command: "service php{{ cur_php_version.stdout }}-fpm start"
|
||||
ansible.builtin.command: "service php{{ cur_php_version.stdout }}-fpm start"
|
||||
args:
|
||||
creates: "/run/php/php{{ cur_php_version.stdout }}-fpm.pid"
|
||||
warn: false
|
||||
|
||||
- name: GET_URL | Download ngrok
|
||||
get_url:
|
||||
url: "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip"
|
||||
ansible.builtin.get_url:
|
||||
url: "https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz"
|
||||
dest: "/tmp/ngrok.zip"
|
||||
|
||||
- name: UNARCHIVE | Uncompress ngrok
|
||||
unarchive:
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/ngrok.zip"
|
||||
dest: "/tmp"
|
||||
remote_src: true
|
||||
|
||||
- name: SET_FACT | ngrok_path
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
ngrok_path: '/tmp/ngrok'
|
||||
|
||||
- name: USER | Create PHP User foo
|
||||
user:
|
||||
ansible.builtin.user:
|
||||
name: foo
|
||||
system: true
|
||||
|
||||
- name: INCLUDE_ROLE | hanxhx.php
|
||||
include_role:
|
||||
ansible.builtin.include_role:
|
||||
name: "{{ playbook_dir }}/hanxhx.php"
|
||||
vars:
|
||||
php_version: "{{ cur_php_version.stdout }}"
|
||||
|
||||
@@ -1,27 +1,26 @@
|
||||
---
|
||||
|
||||
- name: SHELL | Start ngrok
|
||||
shell: daemonize -l /tmp/ngrok.lock {{ ngrok_path }} http 80 -bind-tls=false
|
||||
ansible.builtin.shell: daemonize -l /tmp/ngrok.lock {{ ngrok_path }} http 80 --scheme http
|
||||
failed_when: false
|
||||
changed_when: ngrok.stderr.find("Can't lock the lock file") == -1
|
||||
register: ngrok
|
||||
|
||||
- name: WAIT_FOR | ngrok started
|
||||
wait_for:
|
||||
ansible.builtin.wait_for:
|
||||
delay: 2
|
||||
port: 4040
|
||||
when: ngrok.changed
|
||||
|
||||
- name: SHELL | Get ngrok public address
|
||||
shell: set -o pipefail && curl 'http://127.0.0.1:4040/api/tunnels/command_line' 2> /dev/null | jq -r '.public_url' | cut -d '/' -f 3
|
||||
ansible.builtin.shell: set -o pipefail && curl 'http://127.0.0.1:4040/api/tunnels/command_line' 2> /dev/null | jq -r '.public_url' | cut -d '/' -f 3
|
||||
args:
|
||||
executable: /bin/bash
|
||||
warn: false
|
||||
register: ngrok
|
||||
changed_when: false
|
||||
|
||||
- name: LINEINFILE | Tune vimrc
|
||||
lineinfile:
|
||||
ansible.builtin.lineinfile:
|
||||
line: "set mouse="
|
||||
dest: "{{ item }}/.vimrc"
|
||||
create: true
|
||||
|
||||
Reference in New Issue
Block a user