ansible-elk icon indicating copy to clipboard operation
ansible-elk copied to clipboard

Nginx repos fail for utopic

Open brainstorm opened this issue 10 years ago • 4 comments

They are not available yet upstream apparently, I wonder if there's a clean way for ansible to fall back on older distro repos such as trusty automatically, without spilling out and halting with this error.

TASK: [ansible-elk | Add nginx apt repo] ************************************** 
failed: [23.253.172.105] => {"failed": true, "parsed": false}
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1421313402.51-120126372595310/apt_repository", line 2466, in <module>
    main()
  File "/root/.ansible/tmp/ansible-tmp-1421313402.51-120126372595310/apt_repository", line 436, in main
    cache.update()
  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 440, in update
    raise FetchFailedException(e)
apt.cache.FetchFailedException: W:Failed to fetch http://nginx.org/packages/ubuntu/dists/utopic/nginx/binary-amd64/Packages  404  Not Found
, W:Failed to fetch http://nginx.org/packages/ubuntu/dists/utopic/nginx/binary-i386/Packages  404  Not Found
, E:Some index files failed to download. They have been ignored, or old ones used instead.


FATAL: all hosts have already failed -- aborting

@carles

brainstorm avatar Jan 15 '15 09:01 brainstorm

Perhaps using the bundled nginx in each distro would be enough and more future-proof? Doesn't seem like this usecase requires very latest releases of nginx after all, right?

brainstorm avatar Jan 15 '15 09:01 brainstorm

Yep, I was thinking about this too.

bakhti avatar Jan 15 '15 09:01 bakhti

Just switched, there seem to be some side-effects with the builtin package (nginx user):

TASK: [ansible-elk | Kibana archive available] ******************************** 
failed: [23.253.172.105] => {"failed": true, "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/opt/kibana-4.0.0-beta3.tar.gz", "size": 22901370, "state": "file", "uid": 0}
msg: chown failed: failed to look up user nginx

FATAL: all hosts have already failed -- aborting

brainstorm avatar Jan 15 '15 09:01 brainstorm

That's because bundled nginx has different system setting, like different system user name in this case. So, I guess, some more tasks should be changed accordingly. Check what user nginx is running from and change the following in defaults/main.yml:

elk_nginx:
  user: nginx

bakhti avatar Jan 15 '15 09:01 bakhti