Cloud-Init - What am I doing wrong?
by jeremy_tourville@hotmail.com
I am running into an issue using Cloud-Init on CentOS 7. I have imported OpenStack Glance Generic cloud images for CentOS 7 & 8 and I chose to save them as a template at the time of import.
In the template, under Initial Config I defined the following values:
-cloud-init : checked
-configure time zone: checked
-choose dropdown for the correct timezone
-VM Hostname, Authentication & Networks are all blank
-Custom script:
#cloud-config
users:
- name: ansuser
passwd: $6$TcX2D/LcPtq/a$m6AKlcIbZXL9ZJGNSgeXjnKGsz98Yw.v7rt5m18zunittqjMTygf7KLliwxXwzFrvj8rrFpOMGZmUYoX.mWib.
In theory I think this should create my user and set the password for my user. When I go to login to the system the login for my new user fails. What am I doing wrong?
If I leave the Custom Script blank and put the user in the Authentication section the login works as expected. This tells me the image itself is working properly and is accepting Cloud-Init input. It would be my preference to add the user under the Custom Script section so I can further extend some functionality such as sudo: ALL=(ALL) NOPASSWD:ALL and SSH keys so that an initial Ansible config could be run easily.
I am going to test 8 in the same manner and see what happens. I sort of expect the same results though. Thanks in advance for you input!