--- - name: Install and enable the nginx virtualhost files on RH based systems when: ansible_distribution_file_variety == "RedHat" tags: [nginx, virtualhost] block: - name: Create stream.d directory ansible.builtin.file: path: /etc/nginx/stream.d state: directory owner: root group: root # mode: "0755" - name: Install the nginx stream files ansible.builtin.template: src: nginx-stream.j2 dest: /etc/nginx/stream.d/{{ item.stream }}.conf owner: root group: root # mode: "0444" loop: "{{ nginx_streams }}" notify: Reload nginx