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

Possibly not using user_data properly? #348

Open
FilBot3 opened this issue Dec 5, 2017 · 0 comments
Open

Possibly not using user_data properly? #348

FilBot3 opened this issue Dec 5, 2017 · 0 comments

Comments

@FilBot3
Copy link

FilBot3 commented Dec 5, 2017

I seem to be having an issue with my user_data block defined per Instance OpenStack provider overrides. I'm attaching a volume per node, and then using user_data to format and add that volume to my LVM. However, it doesn't seem to be adding, or extending the volume, nor is there anything I know to search for showing a log.

config.vm.define 'splunk_standalone' do |cfg|
  cfg.vm.provider :openstack do |os, _override|
    os.server_name = 'splunk-standalone'
    os.floating_ip_pool = ENV['OPENSTACK_FLOATING_IP_POOL']
    os.security_groups = ['os_sg_splunk']
    os.networks = [{
      name: ENV['OPENSTACK_NETWORK_IDS'],
      address: '192.168.0.3'
    }]
    os.volumes = [{
      name: 'splunk-standalone-data'
    }]
    os.user_data = %(
      #!/bin/bash;
      set -x;
      sleep 10;
      parted /dev/vdb mklabel gpt;
      parted /dev/vdb mkpart primary 0% 100%;
      pvcreate /dev/vdb1;
      vgextend vg00 /dev/vdb1;
      lvextend -L +19G /dev/mapper/vg00-optlv00;
      resize2fs /dev/mapper/vg00-optlv00;
      sed -i 's/\(^.*\/dev\/vdb.*$\)/\#\1/' /etc/fstab;
      mount -a;
    ).gsub(/\s+/, ' ').strip
  end
  cfg.vm.provision 'chef_client' do |chef|
    chef.chef_server_url = 'https://192.168.0.2:4000/'
    chef.validation_key_path = 'chef-repo/keys/fake-key.pem'
    chef.environment = 'splunk_standalone'
    chef.add_role 'splunk_monitors'
    chef.add_recipe 'splunk::server'
    chef.node_name = 's_standalone'
    chef.client_key_path = '/vagrant/chef-repo/keys/s_standalone.pem'
    chef.encrypted_data_bag_secret_key_path = 'chef-repo/encrypted_data_bag_secret'
  end
end
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