Merge ~pjdc/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:check-mirror-new-roles into ubuntu-mirror-charm:master

Proposed by Paul Collins
Status: Merged
Approved by: Paul Collins
Approved revision: ea7de6606b09519a6e22b4721fd718471bbae865
Merged at revision: 9bdf2c31429a8922da3d00e5fbcafc2cd052b86d
Proposed branch: ~pjdc/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:check-mirror-new-roles
Merge into: ubuntu-mirror-charm:master
Diff against target: 63 lines (+16/-3)
2 files modified
files/check-mirror.sh (+15/-3)
hooks/hooks.py (+1/-0)
Reviewer Review Type Date Requested Status
David Lawson (community) Approve
Canonical IS Reviewers Pending
Review via email: mp+391951@code.launchpad.net

Commit message

check-mirror.sh: add maas-images and ubuntu-cloud-archive support

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
David Lawson (deej) wrote :

LGTM

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 9bdf2c31429a8922da3d00e5fbcafc2cd052b86d

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/files/check-mirror.sh b/files/check-mirror.sh
index dde03f6..a04d177 100755
--- a/files/check-mirror.sh
+++ b/files/check-mirror.sh
@@ -43,6 +43,10 @@ case ${role} in
43 unsigned=ubuntu/dists/xenial/Release43 unsigned=ubuntu/dists/xenial/Release
44 signed=${unsigned}.gpg44 signed=${unsigned}.gpg
45 ;;45 ;;
46 ubuntu-cloud-archive)
47 unsigned=ubuntu/dists/focal-updates/victoria/Release
48 signed=${unsigned}.gpg
49 ;;
46 releases)50 releases)
47 unsigned=xenial/SHA256SUMS51 unsigned=xenial/SHA256SUMS
48 signed=${unsigned}.gpg52 signed=${unsigned}.gpg
@@ -64,9 +68,15 @@ case ${role} in
64 signed=${unsigned}.gpg68 signed=${unsigned}.gpg
65 ;;69 ;;
66 simple-streams)70 simple-streams)
71 # TODO(pjdc): key is not packaged; fetch from install hook?
67 unsigned=juju/images/releases/streams/v1/index.json72 unsigned=juju/images/releases/streams/v1/index.json
68 signed=${unsigned}.gpg73 signed=${unsigned}.gpg # not used
69 ;;74 ;;
75 maas-images)
76 # NOTE(pjdc): ephemeral-v3 is the current stuff and seems to have no fixed paths to signed files we could check
77 unsigned=ephemeral-v3/daily/focal/amd64/
78 signed=${unsigned}.gpg # not used
79 ;;
70 *)80 *)
71 echo "Unknown mirror role, ${role}"81 echo "Unknown mirror role, ${role}"
72 exit 282 exit 2
@@ -76,8 +86,7 @@ tmpsigned=${tmpdir}/$(basename ${signed})
76tmpunsigned=${tmpdir}/$(basename ${unsigned})86tmpunsigned=${tmpdir}/$(basename ${unsigned})
7787
78case ${role} in88case ${role} in
79 # TODO(pjdc): Key is not packaged; fetch from install hook?89 maas-images|simple-streams)
80 simple-streams)
81 for ipaddr in $@; do90 for ipaddr in $@; do
82 if ! curl -s -o"${tmpunsigned}" --resolve ${urlhost}:${port}:${ipaddr} "${scheme}://${urlhost}/${unsigned}"; then91 if ! curl -s -o"${tmpunsigned}" --resolve ${urlhost}:${port}:${ipaddr} "${scheme}://${urlhost}/${unsigned}"; then
83 echo "Mirror CRITICAL [${unsigned} failed to fetch from ${ipaddr} for ${scheme}://${urlhost}/]"92 echo "Mirror CRITICAL [${unsigned} failed to fetch from ${ipaddr} for ${scheme}://${urlhost}/]"
@@ -93,6 +102,9 @@ case ${role} in
93 old-releases)102 old-releases)
94 keyring_file=/usr/share/keyrings/ubuntu-archive-removed-keys.gpg103 keyring_file=/usr/share/keyrings/ubuntu-archive-removed-keys.gpg
95 ;;104 ;;
105 ubuntu-cloud-archive)
106 keyring_file=/usr/share/keyrings/ubuntu-cloud-keyring.gpg
107 ;;
96 *)108 *)
97 keyring_file=/usr/share/keyrings/ubuntu-archive-keyring.gpg109 keyring_file=/usr/share/keyrings/ubuntu-archive-keyring.gpg
98 ;;110 ;;
diff --git a/hooks/hooks.py b/hooks/hooks.py
index 824fc28..5bf370c 100755
--- a/hooks/hooks.py
+++ b/hooks/hooks.py
@@ -67,6 +67,7 @@ required_pkgs = [
67 'procmail', # provides lockfile67 'procmail', # provides lockfile
68 'rsync',68 'rsync',
69 'vsftpd',69 'vsftpd',
70 'ubuntu-cloud-keyring', # for check-mirror.sh
70 'xinetd',71 'xinetd',
71]72]
7273

Subscribers

People subscribed via source and target branches