Icinga / ansible-playbooks

Ansible Playbook for Icinga 2
GNU General Public License v2.0
225 stars 122 forks source link

apt sources point to insecure server #88

Closed dmke closed 6 years ago

dmke commented 6 years ago

Executing the icinga2-ansible-no-ui task fails with:

TASK [icinga2-ansible-no-ui : Get Icinga2 Apt Repos for Debian OS family] *****************************
failed: [$host] (item={u'repo': u'deb https://packages.icinga.org/ubuntu icinga-xenial main'}) => changed=false 
  item:
    repo: deb https://packages.icinga.org/ubuntu icinga-xenial main
  module_stderr: |-
    Shared connection to $host closed.
  module_stdout: |-
    Traceback (most recent call last):
      File "/tmp/ansible_xNVZfR/ansible_module_apt_repository.py", line 550, in <module>
        main()
      File "/tmp/ansible_xNVZfR/ansible_module_apt_repository.py", line 542, in main
        cache.update()
      File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 454, in update
        raise FetchFailedException(e)
    apt.cache.FetchFailedException: W:The repository 'https://packages.icinga.org/ubuntu icinga-xenial Release' does not have a Release file., W:Data from such a repository can't be authenticated and is therefore potentially dangerous to use., W:See apt-secure(8) manpage for repository creation and user configuration details., E:Failed to fetch https://packages.icinga.org/ubuntu/dists/icinga-xenial/main/source/Sources  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none, E:Some index files failed to download. They have been ignored, or old ones used instead.
  msg: MODULE FAILURE
  rc: 1
failed: [$host] (item={u'repo': u'deb-src https://packages.icinga.org/ubuntu icinga-xenial main'}) => changed=false 
  item:
    repo: deb-src https://packages.icinga.org/ubuntu icinga-xenial main
  module_stderr: |-
    Shared connection to $host closed.
  module_stdout: |-
    Traceback (most recent call last):
      File "/tmp/ansible_AfqkSq/ansible_module_apt_repository.py", line 550, in <module>
        main()
      File "/tmp/ansible_AfqkSq/ansible_module_apt_repository.py", line 542, in main
        cache.update()
      File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 454, in update
        raise FetchFailedException(e)
    apt.cache.FetchFailedException: W:The repository 'https://packages.icinga.org/ubuntu icinga-xenial Release' does not have a Release file., W:Data from such a repository can't be authenticated and is therefore potentially dangerous to use., W:See apt-secure(8) manpage for repository creation and user configuration details., E:Failed to fetch https://packages.icinga.org/ubuntu/dists/icinga-xenial/main/source/Sources  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none, E:Some index files failed to download. They have been ignored, or old ones used instead.
  msg: MODULE FAILURE
  rc: 1

This is because the TLS certificate for packages.icinga.org is expired:

$ curl -I https://packages.icinga.org/ubuntu/dists/icinga-xenial/main/source/Sources
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

Also, the server redirects to packages.icinga.com:

$ curl -kI https://packages.icinga.org/ubuntu/dists/icinga-xenial/main/source/Sources                                                                                                     :(
HTTP/1.1 301 Moved Permanently
Date: Tue, 17 Jul 2018 08:32:05 GMT
Server: Apache
Location: https://packages.icinga.com/ubuntu/dists/icinga-xenial/main/source/Sources
Content-Type: text/html; charset=iso-8859-1

A PR fixing this in the works.