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

Option to install nginx from nginx.org repository (Debian and Ubuntu) #35

Merged
merged 3 commits into from
Feb 9, 2015

Conversation

ismaGNU
Copy link
Contributor

@ismaGNU ismaGNU commented Feb 5, 2015

Hi,
I have added new installation option to add nginx.org repository in order to use newer nginx versions.

To use you just have to specify installation type to -> nginx_installation_type: packages_from_nginx
I have tested on Debian wheezy but I think It works well on Ubuntu and different Debian releases.
It is limited to nginx.org repository releases:

Debian squeeze and wheezy
Ubuntu lucid, precise, trusty and utopic

If you don´t like naming or you think it´s not suitable for your project, just tell me and I would change them.

For any improvements or changes, just let me know.

@jdauphant
Copy link
Owner

Hi @ismaGNU ,
Thanks for the pull request.

It's really good, I just have few remarks :

  • It's better to use "Ensure" formulation than "Add" and "Install"
  • Tags are missing for the tasks "Add APT nginx key" and "Add APT nginx original repository"
  • If you add the repository before the tasks in "installation.packages.yml" part, you don't need the instruction "Install the nginx packages" and you don't need to use "nginx_installation_type=packages_from_nginx" variable but something like "nginx_official_repo=true"
  • "update_cache=yes" is already done on "apt_repository" instruction, you don't need to readd it on "apt" (it's also a mistake in the role, I just corrected it)

Best regards,
Julien

@ismaGNU
Copy link
Contributor Author

ismaGNU commented Feb 6, 2015

Hi @jdauphant,
thanks to you for your advices.

You are right, I am terrible naming things! XD
I have changed all you said, It´s better to move apt before installation package. Sorry for not notice before.

As you mentioned, nginx_official_repo=true its way better than my naming 👍
I have remove update_cache, as ansible documentation said is done by default.

Please tell me anything you don´t like.
Best regards,
Ismael

PD: For now It only for debian and ubuntu, but I have plans to add centos and redhat :)

- Remove duplicate code and move task to the top before any installation
@jdauphant
Copy link
Owner

Thanks, it's nearly perfect.

We can put nginx_official_repo: false in the defaults/main.yml (people can lookup here to find available option without read all the )

Also, for me the tag "packages" is more appropriate than "repositories" :

  • It reduce the number of tags
  • It's link to packages
  • The check operations are very fast if the key and repository already exist
    What do you think ?

@ismaGNU
Copy link
Contributor Author

ismaGNU commented Feb 6, 2015

haha, I knew it.

I was thinking between packages and repository, finally I wrote down repository.
Same happened as putting default variable instead of "is defined".

Thanks for your improvements, you are right about checking speed Its way better.

- Changed nginx official repo tags
jdauphant added a commit that referenced this pull request Feb 9, 2015
Option to install nginx from nginx.org repository (Debian and Ubuntu)
@jdauphant jdauphant merged commit 23e2324 into jdauphant:master Feb 9, 2015
@jdauphant
Copy link
Owner

Perfect, it's merge.
Thanks @ismaGNU , great job !

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