package-update-upgrade-install does not update when run with --frequency=always
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Medium
|
Unassigned |
Bug Description
1. The following stanzas in /etc/cloud/
```
cloud_final_
# always update+upgrade on boot
- [package-
packages: # will run apt-update
- git
package_update: true
package_upgrade: true
package_
```
2. Result in the following log entry at boot-time:
```
helpers.py[DEBUG]: update-sources already ran (freq=once-
```
3. Running the module manually with:
```
sudo cloud-init single --name package-
```
... also fails to call `apt-get update`
4. Google gives no results.
- No similar bugs visible here.
- No additional configuration keys shown in <https:/
- No relevant keys given in <https:/
- Nowhere is "update-sources" mentioned.
5. Attempted guess at "update-sources" fails:
```
sudo cloud-init single --name update-sources --frequency always
```
6. Expected behavior is that `apt-get update` is executed before `apt-get install` every time the machine is booted.
On my system the install looks like:
```
['eatmydata', 'apt-get', '--option=
```
7. Alternate behavior would be a way to explicitly request that an update be performed.
This was attempted/
```
cloud_config_
- [apt-configure, always]
```
But did not obtain an update.
There seem to be no other applicable modules listed in <https:/
8. Environment:
- Ubuntu 16.04.5 LTS
- /usr/bin/cloud-init 18.2
9. /etc/cloud/
---
cloud_init_modules:
- seed_random
- bootcmd
- set_hostname
- update_hostname
- update_etc_hosts
- ca-certs
- rsyslog
- users-groups
- ssh
cloud_config_
- emit_upstart
- ssh-import-id
- locale
- set-passwords
- grub-dpkg
- timezone
- [apt-configure, always]
- [runcmd, always] # doesn't actually EXECUTE the modules - that's left for scripts-user :P
cloud_final_
- landscape
- lxd
- ssh-authkey-
- final-message
- power-state-change
- [package-
- [scripts-user, always]
system_info:
distro: ubuntu
paths:
cloud_dir: /var/lib/cloud/
templates_dir: /etc/cloud/
upstart_dir: /etc/init/
ssh_svcname: ssh
disable_root: true
datasource_list: [NoCloud, None]
preserve_hostname: false
hostname: {hostname}
manage_etc_hosts: true
apt:
preserve_
primary:
- arches:
- amd64
- i386
- default
uri: "http://
search:
- "http://
- "http://
search_dns: true
security:
- arches:
- amd64
- i386
- default
uri: "http://
search_dns: true
# (custom PPAs elided)
sources_list: |
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
runcmd:
- [echo, startup run $(date)]
packages: # SHOULD run apt-update; does not
- git
package_update: true
package_upgrade: true
package_
description: | updated |
summary: |
- package-update-upgrade-install does not *actually* update + package-update-upgrade-install does not update when run with frequency + always |
summary: |
- package-update-upgrade-install does not update when run with frequency - always + package-update-upgrade-install does not update when run with + --frequency=always |
Hi,
Thanks for filing the bug.
It appears that the distro. update_ package_ sources( ) runs with hardcoded frequency= PER_INSTANCE.
def update_ package_ sources( self):
self._ runner. run("update- sources" , self.package_ command,
["update" ], freq=PER_INSTANCE)
Cloud-init could supply the package- update- upgrade frequency when calling this distro method if configured.