Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

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

Merged
merged 1 commit into from
Nov 4, 2019
Merged

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

merged 1 commit into from
Nov 4, 2019

Conversation

tcrowe
Copy link
Contributor

@tcrowe tcrowe commented Nov 4, 2019

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
Copy link
Contributor Author

tcrowe commented Nov 4, 2019

Related issue #240

@tcrowe
Copy link
Contributor Author

tcrowe commented Nov 4, 2019

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

@jdauphant
Copy link
Owner

jdauphant commented Nov 4, 2019

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 ;)

@jdauphant jdauphant merged commit 08ccfc5 into jdauphant:master Nov 4, 2019
@tcrowe tcrowe deleted the missing-mime-types branch November 7, 2019 03:14
@tcrowe
Copy link
Contributor Author

tcrowe commented Nov 7, 2019

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

@jdauphant
Copy link
Owner

You're welcome ;)

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

mrwacky42 added a commit to HeadspaceMeditation/ansible-role-nginx that referenced this pull request Jan 18, 2020
* Explicitly setting the nginx configuration file in (jdauphant#223)

the "check nginx configuration" handler.

* Fixing Ansible 2.7.0 deprication warnings (jdauphant#225)

* * Fixing Ansible 2.7.0 deprication warnings
  For further details take a look at: https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.7.html#using-a-loop-on-a-package-module-via-squash-actions

* * Remving travis deprecation warning - Moving from "--sudo" to "--become"

* * Ignoring symlinks errors during ansible_check_mode

* Small spelling correction (jdauphant#228)

* Add support to declare nginx modules in config file (jdauphant#227)

* We can declare nginx modules now

* We can declare nginx modules now

* Correct load_module definition in template

* Add task to remove `default.conf` from sites-enabled/ (jdauphant#231)

* Add task to remove `default.conf` from sites-enabled/

* Check if `default` site is not inside user config

* fix modules definition and add README section about this feature (jdauphant#232)

* Fix typo in modules config and restrict to EPEL (jdauphant#232) (jdauphant#235)

* Fix typo in modules config and restrict to EPEL (jdauphant#232)

* Fixes warning from duplicate when's in modules configuration (jdauphant#233)

* Extends support for configuring modules (jdauphant#236) (jdauphant#237)

Module configuration should now work for the following:

 Centos/RHEL with either EPEL or Official Nginx repo
 Debian/Ubuntu with either standard APT repo or Official Nginx repo

Please see issue jdauphant#236 for further details.

* Update README.md

* download mime.types file if it's missing (jdauphant#241)

* configuration: allow templates for conf.d independent files (jdauphant#238)

* Fix for jdauphant#242 Stick to ansible-lint rules. (jdauphant#243)

* trailing whitespace

* [701] Role info should contain description

* [601] Don't compare to literal True/False

* [502] All tasks should be named

* [206] Variables should have spaces before and after: {{ var_name }}

* skip_ansible_lint rule [403] Package installs should not use latest

* [204] Lines should be no longer than 160 chars

Co-authored-by: Timo Runge <[email protected]>
Co-authored-by: TheSycamore <[email protected]>
Co-authored-by: Dmitry Ge <[email protected]>
Co-authored-by: Tommaso <[email protected]>
Co-authored-by: Perry Kollmorgen <[email protected]>
Co-authored-by: Julien DAUPHANT <[email protected]>
Co-authored-by: Tony Crowe <[email protected]>
Co-authored-by: paulrbr-fl <[email protected]>
Co-authored-by: Bas <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants