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

Cloud Init Support #50

Closed
89luca89 opened this issue Oct 15, 2020 · 1 comment · Fixed by #52
Closed

Cloud Init Support #50

89luca89 opened this issue Oct 15, 2020 · 1 comment · Fixed by #52
Assignees
Labels
enhancement New feature or request experimental This issue needs a deep research and some improvement evaluation
Milestone

Comments

@89luca89
Copy link
Owner

89luca89 commented Oct 15, 2020

Adding cloudinit support for images can be really useful for the disk_source selection.

the terraform-libvirt provider, supports cloudinit images by using a specific resource:

data "template_file" "user_data" {
  template = file("./cloud_init.yml")
}

resource "libvirt_cloudinit_disk" "commoninit" {
  name      = "commoninit.iso"
  user_data = data.template_file.user_data.rendered
}

we should add them in the terraform-vm.tf.j2 file inside an if/else checking if this is a cloud-init image

the cloud_init.yml file can be a template, this is an example of user data:

#cloud-config
ssh_pwauth: True
chpasswd:
  list: |
    root:password
  expire: False

this enables the root user via ssh with password, so terrible can use it as a normal image

@89luca89 89luca89 added enhancement New feature or request experimental This issue needs a deep research and some improvement evaluation labels Oct 15, 2020
@89luca89 89luca89 self-assigned this Oct 15, 2020
@89luca89 89luca89 added this to the 1.2.0 milestone Oct 15, 2020
@89luca89
Copy link
Owner Author

@alegrey91 a basic implementation of cloud-init images support is implemented for all 4 Linux families

A few notes on this road:

  • right now I did not find an official FreeBSD image.
  • not all cloud-init images support dm_crypt and so luks, so for now I've decided to not allow luks on those instances
  • a couple of terraform_custom_provisioners are needed on Debian and Suse images, because of unsupported repos or missing packages

about #41 you could try to use this branch to implement the travis-ci pipeline, using the example inventory in the folder as a base (tweak it to liking)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request experimental This issue needs a deep research and some improvement evaluation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant