jdauphant / ansible-role-nginx

Ansible role to install and manage nginx configuration
655 stars 302 forks source link

Download mime.types file if it's missing #241

Closed tcrowe closed 5 years ago

tcrowe commented 5 years ago

What does it do?

After I ran this role on debian buster I noticed /etc/nginx/mime.types was missing. I'm unsure why. This PR downloads it from nginx's github if it is missing. I did not see that anyone else has run into the problem but we can keep this here as an idea or possible solution if we discover many others have the problem.

Thanks for having a look.

How to test

ansible-galaxy remove jdauphant.nginx
ansible-galaxy install 'git+https://github.com/youreadforme/ansible-role-nginx.git,missing-mime-types'

./nginx-test.yml

- name: nginx test
  hosts: all
  become: true
  roles:
    - role: ansible-role-nginx

./Vagrant file

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
  config.vm.hostname = "nginx-test"
  config.vm.box = "debian/buster64"
  config.vm.box_check_update = false
  config.vm.provider "virtualbox" do |vb|
    vb.name = "nginx-test"
    vb.gui = false
    vb.cpus = 1
    vb.memory = 512
  end
  config.vm.provision "ansible" do |ansible|
    ansible.playbook = "./nginx-test.yml"
    ansible.verbose = "vvvv"
  end
end
vagrant ssh -c 'cat /etc/nginx/mime.types'

If you have a better way I should test these I'm open to tips. Usually I'm just running the roles over and over on a VM like this.

tcrowe commented 5 years ago

Related issue https://github.com/jdauphant/ansible-role-nginx/issues/240

tcrowe commented 5 years ago

It appears we're not conforming well to ansible-lint 😳

jdauphant commented 5 years ago

Thanks @tcrowe

ansible-lint rules have evolved since the role was written. I don't use the role anymore. I only do review, so if someone want to fix that, It will be good ;)

tcrowe commented 5 years ago

Thank you @jdauphant 👍 We get good use from this role.

jdauphant commented 5 years ago

You're welcome ;)

I have made the release just after the merge : https://github.com/jdauphant/ansible-role-nginx/releases/tag/v2.22