23
votes
How to disable `apt-daily.service` on Ubuntu cloud VM image?
Note: Unfortunately part of the solution below doesn't work on Ubuntu 16.04 systems (such as that of the questioner) because the suggested systemd-run invocation only works on Ubuntu 18.04 and above (...
11
votes
Azure VM cloud-init overrides /etc/fstab
I realize that this is late, but I hope it helps.
In Azure, the linux agent configuration file (waagent.conf) usually sets the mountpoint and you do i from there for most Linux distros supported. You'...
8
votes
How to disable `apt-daily.service` on Ubuntu cloud VM image?
You can disable this via the "bootcmd" cloud-init module. This runs before network is brought up, which is required before apt update can get a chance to run.
#cloud-config
bootcmd:
- echo 'APT::...
6
votes
Changing default values in /etc/ssh/sshd_config using cloud init config
Expanding on @dandreye, this takes into account that these could be commented out and sets the proper option regardless of their current value.
runcmd:
- sed -i 's/\#\?ClientAliveInterval .\+/...
4
votes
How to disable `apt-daily.service` on Ubuntu cloud VM image?
Based on Anon's solution, I created this script, which after being run and then rebooting, solves the problem for me:
#!/bin/sh
systemctl mask apt-daily.service apt-daily-upgrade.service
systemctl ...
4
votes
When using cloud-init, what order are the users created in?
It turns out there is a uid field as mentioned here, so I can use that to ensure that each user has a specific UID.
However, as mentioned here, there is a bug with how the uid field is parsed. ...
3
votes
Accepted
cloud-init.log shows write_files.0: Additional properties are not allowed ('defer' was unexpected)
You need to update to cloud-init v21.4, which is the version that added the defer property to write_files.
Check the version you are running with
cloud-init -v, and with
head -n 1 /var/log/cloud-init....
3
votes
How can I use cloud-init NoCloud with OPNsense 21?
I'm working on expanding cloud-init support to BSDs*. The errors should be fixed by now since at least https://github.com/canonical/cloud-init/pull/1779
And by now, Vultr is fairly well supported.
If ...
3
votes
Accepted
Unexpected token within environment variable throws syntax error in cloud-init
You don't need to escape the double quotes in a here-doc. The way you have it there, the outer shell expands the variables, and the shell started by su sees -p \"gy75k9([0y6se2v^\" literally,...
3
votes
How to disable `apt-daily.service` on Ubuntu cloud VM image?
The excellent answers on here have been working for me for ages but suddenly I started getting the dreaded
{"changed": false, "msg": "Failed to lock apt for exclusive ...
2
votes
Accepted
How to boot after partitioning
I see you have changed the partitioning type from MBR to GPT. Is your firmware in legacy/CSM/BIOS mode, or did you also change the firmware type to UEFI? In any case, you will need to reinstall your ...
2
votes
Accepted
How do I use Hashicorp's Linux Repository with Centos 8 and cloud-init to install Vault
The URL https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo is not the repository URL, but the YUM configuration file for the repository. The yum-config-manager command works with YUM ...
2
votes
How to disable `apt-daily.service` on Ubuntu cloud VM image?
This cloud-init works.
#cloud-config
apt:
conf: |
APT {
Periodic {
Update-Package-Lists "0";
};
};
Unattended-Upgrade {
Package-Blacklist {
"*";
}...
2
votes
Accepted
Why does the cloud-init version in log file conflict with the version in the binary?
Cloud-init ran as version 21.2 but has since been upgraded to 21.4.
The update might have been a manual sudo apt update && sudo apt upgrade, or it may have upgraded itself.
Sidenote: Your ...
2
votes
cloud-init.log shows write_files.0: Additional properties are not allowed ('defer' was unexpected)
What does the following show?
head -n 1 /var/log/cloud-init.log
Without the defer statement I see a similar exception on Ubuntu 20.04 cloud-init 22.1:
arc~ cat ~/my-user-data
#cloud-config
users:
- ...
2
votes
Errors during downloading metadata for repository 'epel'
This is a proof-of-concept that I have come up with. You can use this as a starting point.
for repourl in \
"https://fedora.cu.be/epel" \
"https://lon.mirror.rackspace.com/epel" \
&...
2
votes
Why are cloud-init processes running long after server creation?
From a helpful chat over on the #cloud-init IRC channel, apparently this relates to a problem with cloud-init version 21.3 that is fixed in 21.4, which will be released in a few days.
Until then, a ...
2
votes
Accepted
ubuntu-live-server installation through PXE user-data config error
ssh_pwauth is not a per-user config key, but a top-level config key. So:
users:
- name: user
gecos: ubuntu-server
groups: adm, cdrom, dip, lxd, plugdev, sudo
lock_passwd: false
...
2
votes
Accepted
cloud-init does not work for Ubuntu 22.04 images
sudo: true is invalid. Specify an actual rule, not just "true".
According to the documentation:
sudo: (string/null) Sudo rule to use or false. Absence of a sudo value or null will result in ...
1
vote
Accepted
cloud-init tailscale setup fails due to missing /dev/net/tun
Does the kernel get upgraded on first boot?
@tom-yan pretty much got it
I just ran into the same error with tun and found this post
The problem was this kernel package getting upgraded by apk upgrade:...
1
vote
Accepted
cloud-init: Getting the error: No such function check
This was a simple typo gpt, should be gpt.
Change:
disk_setup:
/dev/vdb:
table_type: gpt,
layout: true
to:
disk_setup:
/dev/vdb:
table_type: gpt
layout: true
So the no-such ...
1
vote
Accepted
Debian 12 Cloud Image Deployment Issue - Growpart can not find grep and other basic utilities
The package containing the failing script seems to be cloud-initramfs-growroot, and it actually has a more specific bug report for this issue, with a patch attached.
I am seeing the same issue on my ...
1
vote
cloudinit does not run for qemu/kvm systems created by terraform and libvirt provider
As Brett-holman mentioned, the issue is most likely the cloud-init YAML you are passing in. If you monitor the console of the booting domain ( virsh console --domain your-kvm-domain ) using a un-...
1
vote
Accepted
secrets unintentionally printed to cloud-init logs
The quickest and easiest solution would probably be to use set +x to disable the shell tracing option that seems to have been set in a parent script.
Ultimately a better solution is to remove the set -...
1
vote
Debian 11 fails to set IPv6 via Cloud-Init: "ens18/disable_ipv6: No such file or directory"
If you are using ifupdown, installing ifupdown2 instead of ifupdown solved the problem here.
sudo apt-get update
sudo apt-get install ifupdown2
1
vote
Changing default values in /etc/ssh/sshd_config using cloud init config
What you need is to include a single line to tell cloud-init to append to sshd_config rather that replace the whole file, i.e append: true.
So your cloud_init.cfg file will look like this:
---
...
1
vote
Ubuntu Server won't start if no GPU is installed
As I run some tests thanks to the comments I figured out, that the problem is the fstab entry. If I comment out the fstab entry the system will boot without VGA installed. I find it quite strange, as ...
1
vote
How to disable `apt-daily.service` on Ubuntu cloud VM image?
If the purpose is to provision the machine without incurring in a locking error, the simplest and most stable solution is to run the provisioner remote command (or the apt-related commands) while ...
1
vote
How to disable `apt-daily.service` on Ubuntu cloud VM image?
This waits for 1sec in a whil loop and checks if the lock is released.
while : ; do
sleep 1
echo $( ps aux | grep -c lock_is_held ) processes are using apt.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cloud-init × 40ubuntu × 15
bash × 6
rhel × 6
linux × 5
aws × 5
qemu × 4
debian × 3
kvm × 3
terraform × 3
mount × 2
virtual-machine × 2
password × 2
pxe × 2
shell-script × 1
centos × 1
ssh × 1
networking × 1
systemd × 1
boot × 1
apt × 1
partition × 1
sudo × 1
kali-linux × 1
python × 1