Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not validating required shebang for cloud init files #142

Open
tcurdt opened this issue Jan 29, 2019 · 0 comments
Open

not validating required shebang for cloud init files #142

tcurdt opened this issue Jan 29, 2019 · 0 comments

Comments

@tcurdt
Copy link

tcurdt commented Jan 29, 2019

Running

flash -f --hostname kube01 \
  --device /dev/disk3 \
  --bootconf kubes-boot.yml \
  --userdata kubes-init.yml \
  ~/Downloads/hypriotos-rpi-v1.9.0.img

bootconf gets applied

hdmi_drive=2 # HDMI sound
hdmi_group=2 # DMT
hdmi_mode=16 # 1024x768 60Hz
overscan_left=10
overscan_right=10
overscan_top=10
overscan_bottom=10
disable_splash=1
gpu_mem=16

using this file

hostname: kube01
locale: "en_US.UTF-8"
timezone: "Europe/Berlin"
manage_etc_hosts: true
apt_preserve_sources_list: true
package_upgrade: false

packages:
 - ntp

runcmd:
  - 'systemctl restart avahi-daemon'

users:
  - name: tcurdt
    primary-group: users
    shell: /bin/bash
    sudo: ALL=(ALL) NOPASSWD:ALL
    groups: users,docker,adm
    # password
    plain_text_passwd: tcurdt
    ssh_pwauth: true
    chpasswd: { expire: false }
    lock_passwd: false
    # pubkey
    # lock_passwd: true
    ssh-authorized-keys:
      - ssh-rsa AAAA...VqU2w==

the cloud init gives problems.

When booting it's strange that eth0 is not up. Then the cloud prints

__init__.py[WARNING]: Unhandled non-mulitpart (text/x-not-multipart) userdata: 'b'hostname: kube01'...'

It then waits and eventually creates some keys. Then login appears. Wrong/default hostname though.
Then cloud init says en_US.UTF-8... done which means it's not ignoring the file completely (I guess).
Then it regenerates a machine id and prints fingerprints for user debian.
Later it says no authorized ssh keys fingerprints found for user debian

A little confused I am wondering - are things broken?

Then I found issue #138 and realized that all that was missing was the #cloud-config shebang.

It would be fantastic if this could be checked by the script - and not just that's a valid yml file.

@tcurdt tcurdt changed the title cloud init not working not validating required shebang for cloud init files Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant