Skip to content

Instantly share code, notes, and snippets.

@sebastianwebber
Created October 4, 2016 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastianwebber/36dd536a406db87c76041b9e2d7e0d26 to your computer and use it in GitHub Desktop.
Save sebastianwebber/36dd536a406db87c76041b9e2d7e0d26 to your computer and use it in GitHub Desktop.
- set_fact:
events_session: |+
events {
worker_connections {{ total_fpm_pools * max_phpfpm_server_per_pool }};
use epoll;
multi_accept on;
}
- name: updating nginx config
lineinfile:
dest: /etc/nginx/nginx.conf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
# backrefs: yes
backup: yes
state: present
with_items:
- { regexp: 'worker_rlimit_nofile[ ]{1,}[0-9]{1,}', line: 'worker_rlimit_nofile 100000;' }
- { regexp: 'worker_processes[ ]{1,}[0-9a-z]{1,}', line: 'worker_processes auto;' }
- { regexp: 'events\s{([^}]*)}', line: "{{ events_session }}" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment