main.yml 1.3 KB

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