【发布时间】:2014-03-14 20:30:06
【问题描述】:
一些 ubuntu 云图像,例如这个: http://cloud-images.ubuntu.com/vagrant/precise/20140120/precise-server-cloudimg-amd64-vagrant-disk1.box
拥有文件 /etc/sudoers.d/vagrant,其内容为 vagrant ALL=(ALL) NOPASSWD:ALL
没有,因此带有 sudo_user 的 ansible 命令不起作用。
我可以添加文件:
- name: ensure Vagrant is a sudoer
copy: content="vagrant ALL=(ALL) NOPASSWD:ALL" dest=/etc/sudoers.d/vagrant owner=root group=root
sudo: yes
我想知道 Vagrant 是否应该做些什么,因为这个任务 在真实(非流浪)机器上运行 ansible playbook 时将不适用。
【问题讨论】: