diff --git a/Vagrantfile b/Vagrantfile index 5fe04d22c5..f836ec2c86 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -111,7 +111,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| server.vm.network :forwarded_port, guest: 3000, host: 3000, auto_correct: true server.vm.network :forwarded_port, guest: 15672, host: 15672, auto_correct: true server.vm.provision :shell, :path => "tests/provision_basic_el.sh" - server.vm.provision :shell, :path => "tests/provision_enterprise_server.sh" + server.vm.provision :shell, + :path => "tests/provision_enterprise_server.sh", + :env => { + 'FACTER_SE_USER' => ENV['FACTER_SE_USER'].to_s, + 'FACTER_SE_PASS' => ENV['FACTER_SE_PASS'].to_s, + } + server.vm.provision :shell, :path => "tests/rabbitmq.sh" end diff --git a/tests/provision_enterprise_server.sh b/tests/provision_enterprise_server.sh index 3cb49a8d31..e1ea1e209d 100644 --- a/tests/provision_enterprise_server.sh +++ b/tests/provision_enterprise_server.sh @@ -1,5 +1,12 @@ #!/bin/bash +if [ -z "${FACTER_SE_USER:-}" ]; then + echo "ERROR: You must export FACTER_SE_USER and FACTER_SE_PASS" >&2 + echo "ERROR: In the shell that executes vagrant up" >&2 + exit 1 +fi +echo "FACTER_SE_USER=$FACTER_SE_USER" + # setup module dependencies puppet module install puppetlabs/rabbitmq diff --git a/tests/sensu-server-enterprise.pp b/tests/sensu-server-enterprise.pp index 03882b9f6e..7a3992a1cb 100644 --- a/tests/sensu-server-enterprise.pp +++ b/tests/sensu-server-enterprise.pp @@ -9,18 +9,19 @@ mode => '0600', } + # NOTE: When testing sensu enterprise, provide the SE_USER and SE_PASS to use + # with the online repository using the FACTER_SE_USER and FACTER_SE_PASS + # environment variables. An effective way to manage this is with `direnv` class { '::sensu': install_repo => true, - server => true, + enterprise => true, + enterprise_user => $facts['se_user'], + enterprise_pass => $facts['se_pass'], manage_services => true, manage_user => true, rabbitmq_password => 'correct-horse-battery-staple', rabbitmq_vhost => '/sensu', - api => true, - api_user => 'admin', - api_password => 'secret', client_address => $::ipaddress_eth1, - # enterprise options api_ssl_port => '4568', api_ssl_keystore_file => '/etc/sensu/api.keystore', api_ssl_keystore_password => 'sensutest',