I'm trying to create a profile to automate the creation of a container, but I'm having trouble with cloud-init. For some reason the password is not being set for the user and is also not being added as a sudoer. Here is the YAML:
config:
boot.autostart: "false"
limits.cpu: "2"
limits.memory: "4GB"
user.user-data: |
#cloud-config
users:
- name: matheus
gecos: Matheus Saraiva da Silva
lock_password: false
plain_text_passwd: tyy7854
ssh-authorized-keys:
- ssh-rsa myrsa
package_update: true
package_upgrade: true
package_reboot_if_required: true
snap:
commands:
00: snap install juju --classic
01: snap install charmcraft --classic
02: snap install node --classic
apt:
preserve_source_list: true
packages:
- gcc
- podman
runcmd:
- usermod, -aG, sudo matheus
- [su, matheus, -c, "wget https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb -P /home/matheus/Downloads"]
- [su, matheus, -c, "sudo dpkg -i /home/matheus/minikube_latest_amd64.deb"]
- [su, matheus, -c, "git config --global user.name matheusssilva"]
- [su, matheus, -c, "git config --global user.email matheus.saraiva@gmail.com"]
description: TaskStack enviroment lxd profile
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
name: TaskStack
used_by: []
When I try to do something with sudo, the password that is in the configuration file does not work. So I am obliged to change the user's password using the root user #passwd matheus
. Is it a bug?