Search code examples
amazon-web-servicescentosprovisioningvagrantpuppet

puppet exec vagrant plugin install not working


I have successfully installed vagrant-aws on a centos VM, and I am trying to 'puppetize' this task. My relevant puppet code is below:

exec { 'install_aws':
  command => '/usr/bin/vagrant plugin install vagrant-aws',
  #require => [Exec['install_dependent'], Package['vagrant']],
}

When I provision the machine, it says the Exec[install_aws]/returns: executed successfully, but the plugin is not installed, and I have to run the command manually for it to work. Never seen this behaviour with puppet, can someone help?


Solution

  • exec { 'install_aws':
      command => '/usr/bin/sudo /usr/bin/vagrant plugin install vagrant-aws',
      require => [Exec['install_dependent'], Package['vagrant']],
    }
    

    Fixed the code above. Good point, needed to run the command as superuser. Seems like a silly mistake, thanks for pointing it out ^^.