debops / ansible-apt

Configure and manage APT Package Manager
GNU General Public License v3.0
10 stars 15 forks source link

Error in generating file for debian (sources.list) #89

Closed le9i0nx closed 9 months ago

le9i0nx commented 7 years ago
root@b1beebdf856d:~# cat /etc/apt/sources.list
# This file is managed by Ansible, all changes will be lost.

# Original APT package sources gathered by Ansible
deb http://deb.debian.org/debian jessie main
deb http://deb.debian.org/debian jessie-updates main
deb http://deb.debian.org/debian jessie-backports main
deb http://security.debian.org jessie main
deb http://security.debian.org jessie-updates main
deb http://security.debian.org jessie-backports main

# Official Debian repositories
# deb http://deb.debian.org/debian jessie main
# deb http://deb.debian.org/debian jessie-updates main
# deb http://deb.debian.org/debian jessie-backports main

# Debian Security repository
deb http://security.debian.org/ jessie/updates main
root@b1beebdf856d:~# cat /etc/apt/sources.list.dpkg-divert 
deb http://deb.debian.org/debian jessie main
deb http://deb.debian.org/debian jessie-updates main
deb http://security.debian.org jessie/updates main
root@b1beebdf856d:~# 
...
TASK [debops.apt : Remove old unattended-upgrades configuration] ***************
ok: [test2] => (item=25auto-upgrades.conf)
ok: [test1] => (item=25auto-upgrades.conf)
ok: [test2] => (item=55unattended-upgrades.conf)
ok: [test1] => (item=55unattended-upgrades.conf)

TASK [debops.apt : Update APT cache] *******************************************
fatal: [test1]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to update apt cache
fatal: [test2]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to update apt cache."}
        to retry, use: --limit @/tmp/syncthing.retry

PLAY RECAP *********************************************************************
test1                      : ok=11   changed=2    unreachable=0    failed=1   
test2                      : ok=11   changed=2    unreachable=0    failed=1   
root@b1beebdf856d:~# apt update
Ign http://security.debian.org jessie InRelease
Hit http://apt.syncthing.net syncthing InRelease
Ign http://security.debian.org jessie-updates InRelease
Ign http://security.debian.org jessie-backports InRelease
Hit http://security.debian.org jessie/updates InRelease                 
Ign http://security.debian.org jessie Release.gpg                                              
Get:1 http://apt.syncthing.net syncthing/release amd64 Packages [1137 B]                       
Ign http://security.debian.org jessie-updates Release.gpg                                      
Ign http://deb.debian.org jessie InRelease                                         
Ign http://security.debian.org jessie-backports Release.gpg
Hit http://deb.debian.org jessie-updates InRelease
Get:2 http://security.debian.org jessie/updates/main amd64 Packages [464 kB]                 
Hit http://deb.debian.org jessie-backports InRelease                         
Hit http://deb.debian.org jessie Release.gpg                                 
Hit http://deb.debian.org jessie Release                                         
Get:3 http://deb.debian.org jessie-updates/main amd64 Packages [17.6 kB]                       
Get:4 http://deb.debian.org jessie-backports/main amd64 Packages [1137 kB]                     
Ign http://security.debian.org jessie Release                                
Ign http://security.debian.org jessie-updates Release                        
Ign http://security.debian.org jessie-backports Release  
Get:5 http://deb.debian.org jessie/main amd64 Packages [9049 kB]
Err http://security.debian.org jessie/main amd64 Packages                 
  404  Not Found [IP: 212.211.132.32 80]
Err http://security.debian.org jessie-updates/main amd64 Packages
  404  Not Found [IP: 212.211.132.32 80]
Err http://security.debian.org jessie-backports/main amd64 Packages
  404  Not Found [IP: 212.211.132.32 80]
Fetched 10.7 MB in 20s (524 kB/s)                                                              
W: Failed to fetch http://security.debian.org/dists/jessie/main/binary-amd64/Packages  404  Not Found [IP: 212.211.132.32 80]

W: Failed to fetch http://security.debian.org/dists/jessie-updates/main/binary-amd64/Packages  404  Not Found [IP: 212.211.132.32 80]

W: Failed to fetch http://security.debian.org/dists/jessie-backports/main/binary-amd64/Packages  404  Not Found [IP: 212.211.132.32 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.
root@b1beebdf856d:~# 
le9i0nx commented 7 years ago

Many lines are created, but one must be created

deb http://security.debian.org jessie main
deb http://security.debian.org jessie-updates main
deb http://security.debian.org jessie-backports main
deb http://security.debian.org jessie/updates main
drybjed commented 7 years ago

It seems that the debops.apt role does not currently play well with repository URLs that end with / character. Since you have a Security repository which ends with / in the original config file, the role didn't recognize it as a Security repository, but as a normal APT repository and misconfigured it. I'll look into it after getting back from holidays, in about a week.