--- - name: install nginx apt: name: "{{ nginx_pkg_variant | default((ansible_distribution == 'Ubuntu') | ternary('nginx-core', 'nginx-light')) }}" state: present - name: remove nginx default config file: name: /etc/nginx/sites-enabled/default state: absent notify: restart nginx - name: install nginx config.d files loop: "{{ nginx_conf_d_files }}" copy: src: "conf.d/{{ item }}.conf" dest: /etc/nginx/conf.d/ notify: restart nginx - name: install nginx config snippets loop: "{{ nginx_snippets }}" copy: src: "snippets/{{ item }}.conf" dest: /etc/nginx/snippets/ notify: restart nginx - name: generate Diffie-Hellman parameters openssl_dhparam: path: /etc/ssl/dhparams.pem size: "{{ nginx_dhparam_size }}" notify: restart nginx - name: install and setup stream module when: nginx_stream_module import_tasks: stream.yml - name: configure server_names_hash_bucket_size when: nginx_server_names_hash_bucket_size is defined lineinfile: regexp: "^(\\s*)#?\\s*server_names_hash_bucket_size\\s" line: "\\1server_names_hash_bucket_size {{ nginx_server_names_hash_bucket_size }};" dest: /etc/nginx/nginx.conf backrefs: yes notify: restart nginx