Does Vagrant create the /etc/sudoers.d/vagrant file, or does it need to be added manually to use ssdo_user?

Some ubuntu cloud images like this one: http://cloud-images.ubuntu.com/vagrant/precise/20140120/precise-server-cloudimg-amd64-vagrant-disk1.box

there is a file /etc/sudoers.d/vagrant, with the contents of vagrant ALL = (ALL) NOPASSWD: ALL

Other fields such as this https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-13.10_chef-provisionerless.box

does not have it, and as a result, inaccessible commands with sudo_user do not work.

I can add a file using

- name: ensure Vagrant is a sudoer
  copy: content="vagrant ALL=(ALL) NOPASSWD:ALL" dest=/etc/sudoers.d/vagrant owner=root group=root
  sudo: yes

I am wondering if the tramp needs to do something, because this task will not be applied when starting an unoccupied play on a real (not vagrant) machine.

+4
1

Vagrant , config.ssh.username = "root" , sudo. Bento Ubuntu /etc/sudoers.

, sudo_user, , /etc/sudoers. , Vagrant sudo . , sudoers.d.

, /etc/sudoers.d/, 0440 , , sudo .

+3

Source: https://habr.com/ru/post/1531850/


All Articles