Giter VIP home page Giter VIP logo

Comments (3)

bpg avatar bpg commented on August 9, 2024

Hi @outworld66! 👋🏼

I might not have fully grasped your use case, but there's an option to specify the target file name in the PVE storage via the file_name attribute of proxmox_virtual_environment_file. Could this be what you're looking for? You can see an example here.

Additionally, you don't have to reference file IDs via proxmox_virtual_environment_file resource IDs. For example, this line:

user_data_file_id = proxmox_virtual_environment_file.cloud_config.id

can be replaced with:

user_data_file_id = "local:snippets/cloud-config.yaml"

from terraform-provider-proxmox.

outworld66 avatar outworld66 commented on August 9, 2024

@bpg Hi! Thanks for the answer.

In my case, source_raw is not used, so specifying file_name is problematic. I would like to keep separate files with templates, and not insert the content into source_raw.

Usage

user_data_file_id = "local:snippets/cloud-config.yaml"

would help me, but the proxmox node does not have such files. The indication "local:..." uses the path on the proxmox node, and not the local directory from where terraform is executed? I checked, it seems to be so.

How then to upload cloud-init files to the node? Provided that separate cloud-init files are used for each VM? If you put it all together into a module, it looks impossible.

workaround: use ssh provider to upload files to the proxmox node. but why if there is a proxmox api.

from terraform-provider-proxmox.

outworld66 avatar outworld66 commented on August 9, 2024

I found a more suitable option. I'm surprised I didn't notice it before :)
For snippet, each VM needs to indicate the original name:

resource proxmox_virtual_environment_file cloud_config_meta_data {
  content_type = "snippets"
  datastore_id = "local"
  node_name    = var.virtual_environment_node_name

  source_file {
    path = "./modules/proxmox_vm/cloud-init-configs/data-vm/data-vm-meta-data"
  }
}

then the file will not be overwritten and the original snippet will be used for each VM.

from terraform-provider-proxmox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.