main.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. nginx_redhat_pkg:
  3. - nginx
  4. nginx_ubuntu_pkg:
  5. - python-selinux
  6. - nginx
  7. nginx_freebsd_pkg:
  8. - nginx
  9. nginx_suse_pkg:
  10. - nginx
  11. yum_epel_repo: epel
  12. yum_base_repo: base
  13. nginx_official_repo: False
  14. keep_only_specified: False
  15. nginx_installation_type: "packages"
  16. nginx_binary_name: "nginx"
  17. nginx_service_name: "{{nginx_binary_name}}"
  18. nginx_conf_dir: "{% if ansible_os_family == 'FreeBSD' %}/usr/local/etc/nginx{% else %}/etc/nginx{% endif %}"
  19. nginx_user: "{% if ansible_os_family == 'RedHat' or ansible_os_family == 'Suse' %}nginx{% elif ansible_os_family == 'Debian' %}www-data{% elif ansible_os_family == 'FreeBSD' %}www{% endif %}"
  20. nginx_group: "{{nginx_user}}"
  21. nginx_pid_file: '/var/run/{{nginx_service_name}}.pid'
  22. nginx_worker_processes: "{{ ansible_processor_vcpus }}"
  23. nginx_worker_rlimit_nofile: 1024
  24. nginx_log_dir: "/var/log/nginx"
  25. nginx_events_params:
  26. - worker_connections {% if nginx_max_clients is defined %}{{nginx_max_clients}}{% else %}512{% endif %}
  27. nginx_http_params:
  28. - sendfile "on"
  29. - tcp_nopush "on"
  30. - tcp_nodelay "on"
  31. - keepalive_timeout "65"
  32. - access_log "{{nginx_log_dir}}/access.log"
  33. - error_log "{{nginx_log_dir}}/error.log"
  34. - server_tokens off
  35. - types_hash_max_size 2048
  36. nginx_sites:
  37. default:
  38. - listen 80 default_server
  39. - server_name _
  40. - root "{% if ansible_os_family == 'FreeBSD' %}/usr/local/www/nginx-dist{% else %}/usr/share/nginx/html{% endif %}"
  41. - index index.html
  42. nginx_remove_sites: []
  43. nginx_configs: {}
  44. nginx_remove_configs: []
  45. nginx_auth_basic_files: {}
  46. nginx_remove_auth_basic_files: []
  47. nginx_daemon_mode: "on"