/srv/irclogs.ubuntu.com/2018/06/23/#cloud-init.txt

tr3lI am trying to get cloud-init to leave root enabled or enable it if it is disabled00:54
tr3lSo far, the only thing it does is ignore the directives and disable root00:54
tr3lI have tried disable_root: false and disable_root: 000:54
tr3lDoes anyone have any idea how I might get it to stop?00:56
tr3lIs anyone available to look over my cloud.cfg for any obvious errors?02:14
blkaddertr3l: What distro/is root enabled by default?02:19
tr3lCentOS 7.502:20
tr3lRoot should not be disabled by default on it02:20
tr3lI am just using the stock ISO to install on a standard KVM VM02:20
tr3lcloud-init is being used to setup the server disks on KVM VM start02:20
tr3lOnce it is setup, I take an image of the VM and use that image to create new VMs02:21
tr3lOn start, cloud-init should do nothing except resize disks as needed02:21
tr3lblkadder: https://pastebin.com/UE6LHcT402:22
tr3lThat is all I am trying to do02:22
tr3lI am not sure what I've got wrong02:22
blkadderWell you are missing #cloud-config for one.02:28
blkadderIf that is the complete content of the file.02:28
tr3lIt is the complete contents02:29
tr3lWhat should I be adding?02:29
tr3lI need zero additional functionality. I basically want it to resize the disk and leave the rest of the server alone and do absolutely nothing to it02:30
blkadderYou need to start the configuration file with #cloud-config as the first line.02:30
blkadderhttps://www.digitalocean.com/community/tutorials/an-introduction-to-cloud-config-scripting02:31
blkadderAlso it's a stickler for spacing/indentation.02:31
tr3lIs there any validator available to validate this?02:31
blkadderWhich has tripped me up more than once or twice (not saying you have issues there just saying you want to be careful)02:31
blkadderThey have something built-in.02:31
blkadderIt has been a while let me see if I can find it...02:32
blkadderThey have been working on a linter, just not sure how far they have gotten.02:32
tr3lI have been struggling to find simple documentation for cloud-init02:32
blkadderYes, documentation is not the greatest. :-)02:32
blkadderMany of the devs are on here, they just tend to seem to work normal business hours so this isn't the best time to find them. :-)02:36
tr3lI appreciate your help02:37
tr3lThis cloud-init config is causing problems on production servers02:37
blkadderI will refrain from any number of snarky comments.02:38
tr3lIf I had any other choice, it wouldn't have been used02:39
tr3lIt comes down to desperation and lack of any other choices. I admit that it is a cowboy solution, but I am trying my best to fix it02:41
blkadderI know there is some sort of built in validator now, I am just not able to find the reference to it I had squirreled away...02:41
tr3land struggling a lot trying to get there02:41
tr3lIt seems like cloud-init devel schema will do something like that02:44
tr3lMy cloud-init doesn't support devel though02:44
tr3land I can't find any packages that install that02:45
blkadderI think I installed from source.02:46
blkadderWhich is how I got it.02:46
blkadderI thought they had moved at least some of it into a production branch but I am really not sure...02:46
blkadderSorry I can't be of more help.02:47
blkadderI'm just an infrequent user.02:47
tr3lThe desperate are happy to have any help02:48
tr3lThank you02:48
blkadderYou have looked at the logs too to see what it is doing, correct?02:50
tr3lI have tried, but I can't make sense of it02:53
blkadderOoh...02:55
blkaddercloud-init devel schema02:55
tr3lYea02:55
tr3lNo devel features in my copy of cloud-init from epel02:55
tr3lI also don't see any documentation anywhere about installing it or how it works even for Ubuntu02:56
blkadderhttps://media.readthedocs.org/pdf/cloudinit/latest/cloudinit.pdf02:56
tr3lThat is the same type of documentation I was struggling with earlier02:56
tr3lIt doesn't give practical examples of structure, syntax, files, etc. I just lists what each thing does and gives you a MASSIVE overwhelming complex example file to start off02:57
tr3lI'm just like.. slow down02:57
tr3lWhy can't we just get a file that changes the hostname and nothing else?02:58
tr3lWhere is the hello world of cloud-init?02:58
blkaddercloud-init devel schema --config-file02:58
tr3lYeah02:58
tr3lIf my copy of cloud-init had devel it would be great :(02:59
blkadderBest I can do for ya... Gotta run to dinner. Good luck.02:59
blackboxswthx blkadder for fielding some questiosn.03:05
blackboxswtr3l: some simple examples are here.   http://cloudinit.readthedocs.io/en/latest/topics/examples.html03:05
blackboxswas per getting latest and greatest cloud-init on your epel.... we build tip and stable over in our copr repos03:06
blackboxswhttps://copr.fedorainfracloud.org/coprs/g/cloud-init/el-stable/03:06
blackboxswhttps://copr.fedorainfracloud.org/coprs/g/cloud-init/el-testing/03:06
blackboxswyou can add those repos and install latest cloud-init on your instance, then a sudo cloud-init clean --logs --reboot would allow cloud-init to run as if the system were a new install03:07
blackboxswso if your image creator (or distro) doesn't have the latest cloud-init you can at least upgrade yourself03:07
tr3lThank you for the help03:09
blackboxswand cloud-init 17.1 or later would have " cloud-init devel schema --config-file <your-yaml-filename> --annotate"  which should tell you about whether the yaml you have is properly formatted and will give hints on schema validation for a few config modules03:09
tr3lShould disable_root and ssh_pwauth be true/false or 1/0?03:10
blackboxswwe haven't finished full schema validation for all config modules, (it's on the agenda this year). then the CLI command will be promoted to "cloud-init schema <your-yaml-file>" (dropping the "devel" param)03:10
blackboxswmost of cloud-init accepts any of those options 0 ,False, false,no  as untrue  and   True, 1, true yes as "true"03:12
blackboxswTRUE_STRINGS = ('true', '1', 'on', 'yes')03:12
blackboxswFALSE_STRINGS = ('off', '0', 'no', 'false')03:12
blackboxswchecking those speciically to be sure03:12
blackboxswafter your instance boots with latest cloud-init  "cloud-init status --long" should quickly give you an idea if there were errors03:12
blackboxswotherwise check /var/log/cloud-init.log for a Traceback03:13
blackboxswdisable_root and ssh_pwauth can both be any of those TRUE/FALSE_STRINGS I pasted03:17
blackboxswssh_pwauth can also additionally be 'unchanged'03:17
tr3lI was really hoping you would say it had to be true/false03:17
blackboxswper http://cloudinit.readthedocs.io/en/latest/topics/modules.html#set-passwords03:18
tr3lI just upgraded it from here:03:20
tr3lhttps://copr.fedorainfracloud.org/coprs/g/cloud-init/el-stable/03:20
tr3lcloud-init: error: invalid choice: 'devel' (choose from 'init', 'modules', 'query', 'single', 'dhclient-hook', 'features')03:20
tr3lUpdated:03:20
tr3l  cloud-init.noarch 0:0.7.9+224.g681baff-1.el7.centos03:20
blackboxswtr3l: we've had discussions a few times about being more strict on schema. I think it's a burden on the user and us to support something so flexible.... too much rope to hang oneself with. per your cloud-config yaml  .....03:21
blackboxswhttp://cloudinit.readthedocs.io/en/latest/topics/modules.html#set-passwords03:21
blackboxswhttp://paste.ubuntu.com/p/RQ4c4hgTHX/03:21
blackboxswthe rest of the file looks like valid yaml.03:21
tr3lI don't mean to sound like a novice user. I've worked with everything from UML to KVM and everything in between. This software is just giving me a lot more trouble than I normally run into03:22
tr3lIt is a bit disconcerting if I'm honest. I usually don't have to jump into IRC03:23
blackboxswhrm, what gives with ssh_genkeytypes:  ~03:23
blackboxswsyslog_fix_perms: ~?03:23
tr3lCan I safely remove those?03:23
tr3lI could never pin that down03:24
blackboxswyes unknown config keys are ignored03:24
tr3lThey were included in the default cloud.cfg for the distro as far as I remember03:24
blackboxswas per the other keys, you are mixing two things.03:25
tr3lThe only part I am solid on is the growroot03:25
tr3lThe rest is just trying to make it run without messing up the system03:25
tr3lPlease run without doing anything else essentially03:25
blackboxswtr3l: /etc/cloud/cloud.cfg is system configuration information.03:25
blackboxswwhich differs from #cloud-config user-data03:26
tr3lI have no idea what any of that means03:26
tr3lYou lost me completely03:26
blackboxswok sorry 'bout that03:26
blackboxswI thought you were trying originally to provide user-data to your instance which cloud-init reacts to03:26
tr3lI am trying to use cloud-init to resize VM disks if they are a different size on boot03:27
tr3lNothing else03:27
tr3lI've been able to do that by editing the /etc/cloud/cloud.cfg file with the contents in pastebin03:27
tr3lUnfortunately, an update or something has caused it to start disabling root so now I'm trying to fix that or find why it is happening03:27
blackboxswright that minimally enables/disables various config modules03:27
blackboxswminimally for resize I think you need:03:28
blackboxsw - growpart03:28
blackboxsw - resizefs03:28
blackboxsw - disk_setup03:28
tr3lgrowroot works as is03:28
tr3lIt just won't stop randomly disabling root login03:28
tr3lI should note that the network portion of the config there is entirely ignored03:28
tr3lI had to use this:03:29
tr3lcd /etc/cloud/cloud.cfg.d/03:29
tr3l[root@server3 cloud.cfg.d]# cat 99-disable-network-config.cfg03:29
tr3lnetwork: {config: disabled}03:29
tr3lTo make it leave the network alone03:29
tr3lI am not sure why03:29
tr3lTrying this now:03:31
tr3lcat 97-disable-root-mods.cfg03:31
tr3ldisable_root: 003:31
tr3l[root@server3 cloud.cfg.d]# cat 98-disable-root-mods.cfg03:31
tr3ldisable_root: false03:31
blackboxswmight check /var/lib/cloud/instance/user-data* or /var/lib/cloud/instance/vendor-data*03:31
tr3lBoth are empty03:31
blackboxswthose files generally contain configuraiton that could override any config you write on disk03:31
blackboxswok .... I do have to bail for a dinner date but hopefully http://cloudinit.readthedocs.io/en/latest/topics/modules.html can help a bit03:32
tr3lsays this?03:32
tr3lFrom nobody Sat Jun 23 00:03:23 201803:32
tr3lContent-Type: multipart/mixed; boundary="===============8880678780223518493=="03:32
tr3lMIME-Version: 1.003:32
tr3lNumber-Attachments: 103:32
tr3l--===============8880678780223518493==03:32
tr3lMIME-Version: 1.003:32
tr3lContent-Type: text/x-not-multipart03:32
tr3lContent-Disposition: attachment; filename="part-001"03:32

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!