openwisp / ansible-openwisp2

Ansible role that installs and upgrades OpenWISP.
https://openwisp.io/docs/dev/ansible/
BSD 3-Clause "New" or "Revised" License
475 stars 137 forks source link

[change] Disabled nginx server_tokens #353 #354

Closed Aryamanz29 closed 2 years ago

Aryamanz29 commented 2 years ago

Added task in nginx.yml, which sets the server_tokens to off Closes #353

Successfully build : https://github.com/Aryamanz29/ansible-openwisp2/actions/runs/1935569843

Aryamanz29 commented 2 years ago

Can we do something like this? :point_down: @pandafy (requires Ansible >= 2.4)
https://docs.ansible.com/ansible/2.9/modules/replace_module.html#parameter-replace

- name: disable nginx server tokens
  replace:
    path: /etc/nginx/nginx.conf
    regexp: '#(\s+)server_tokens off'
    replace: 'server_tokens off'
    backup: yes