我有一个安装docker的ansible攻略。它看起来是这样的:
---
- hosts: local
connection: local
become: yes
become_user: root
tasks:
- name: add docker's key
apt_key:
keyserver: hkp://p80.pool.sks-keyservers.net:80
id: 58118E89F3A912897C070ADBF76221572C52609D
- name: add deb repo
file: path=/etc/apt/sources.list.d/docker.list state=touch
- name: register apt sources
lineinfile: dest="/etc/apt/sources.list.d/docker.list" line="{{item}}"
with_items:
- "deb https://apt.dockerproject.org/repo ubuntu-trusty main"
- name: install docker-engine
apt: name=docker-engine state=present update-cache=yes force=yes问题是,当我在我的本地主机上运行这个剧本时,我得到一个错误:
fatal: [127.0.0.1]: FAILED! => {"changed": false, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}那么,本攻略的哪些部分可能会导致这样的错误,我如何更改它们?
发布于 2017-12-04 22:43:11
尝试在命令行中使用--ask-become-pass。然后应该会提示您输入密码。
https://stackoverflow.com/questions/47635480
复制相似问题