nginxinc / ansible-collection-nginx

Ansible collection for NGINX
Apache License 2.0
67 stars 23 forks source link

Fails on amazon linux 2 #1

Closed hryamzik closed 3 years ago

hryamzik commented 3 years ago

I get the following errors:

Your OS, Amazon is not supported by NGINX Open Source

fatal: [nginx]: FAILED! => {"changed": false, "msg": "Failure talking to yum: failure: repodata/repomd.xml from nginx: [Errno 256] No more mirrors to try.\nhttps://nginx.org/packages/mainline/rhel/2/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found"}

When installing on amazon linux.

Ami is ami-0528a5175983e7f28 (amzn2-ami-hvm-2.0*).

alessfg commented 3 years ago

That's to be expected. NGINX Open Source is not supported/available on Amazon Linux 2. You might be able to install some version of NGINX by setting nginx_install_from: os_repository if Amazon Linux 2 has an NGINX package available in its packages repository.

hryamzik commented 3 years ago

Two workarounds here:

- command: amazon-linux-extras install nginx1 -y
  args:
    creates: /sbin/nginx

Or use epel for more recent version, not in ansible format as first way worked fine for me:

yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum-config-manager --enable epel
yum install -y nginx