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

Vagrant: excessive whitespace in Vagrantfile #276

Open
dinadins opened this issue Oct 3, 2024 · 0 comments
Open

Vagrant: excessive whitespace in Vagrantfile #276

dinadins opened this issue Oct 3, 2024 · 0 comments

Comments

@dinadins
Copy link
Contributor

dinadins commented Oct 3, 2024

When running molecule with the Vagrant driver a Vagrantfile is produced in ~/.cache/molecule/[...]/default/Vagrantfile. This can be very useful when troubleshooting. Unfortunately, this file has very many blank lines and the indentation is not consistent, making it hard to read.

It would be helpful to have this compacted and easier to read.

Example:

molecule.yml:

driver:
  name: vagrant
platforms:
  - name: instance-1
    instance_raw_config_args:
      - "vm.network 'forwarded_port', guest: 80, host: 8080"
    interfaces:
      - auto_config: true
        network_name: private_network
        type: dhcp
    config_options:
      synced_folder: True
    box: debian/jessie64
    memory: 1024
    cpus: 1
    provider_options:
      gui: True
    provider_raw_config_args:
      - "customize ['modifyvm', :id, '--cpuexecutioncap', '50']"
    provider_override_args:
      - "vm.synced_folder './', '/vagrant', disabled: true, type: 'nfs'"
    provision: True

Vagrantfile:

# Ansible managed

Vagrant.configure('2') do |config|
  if Vagrant.has_plugin?('vagrant-cachier')
    
    config.cache.scope = 'machine'
    
  end


  config.vm.define "instance-1" do |c|
    ##
    # Box definition
    ##
    c.vm.box = "debian/jessie64"





    ##
    # Config options
    ##
    

    
    
    
    c.ssh.insert_key = true
    

    
    c.vm.hostname = "instance-1"
    

    ##
    # Network
    ##
    
    c.vm.network "private_network", auto_config: true, type: "dhcp"
    

    ##
    # instance_raw_config_args
    ##
    c.vm.network 'forwarded_port', guest: 80, host: 8080
    

    ##
    # Provider
    ##
    c.vm.provider "virtualbox" do |virtualbox, override|
      
      virtualbox.memory = 1024
      virtualbox.cpus = 1
      

      
      virtualbox.gui = true
      

      
        
      virtualbox.customize ['modifyvm', :id, '--cpuexecutioncap', '50']
        
      

      
        override.vm.synced_folder './', '/vagrant', disabled: true, type: 'nfs'
        
      

      
      
      virtualbox.linked_clone = true
      
      
      
    end
  end

end
dinadins added a commit to dinadins/molecule-plugins that referenced this issue Oct 3, 2024
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