博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
passwd:只能指定一个用户的名称。
阅读量:2338 次
发布时间:2019-05-10

本文共 501 字,大约阅读时间需要 1 分钟。

在执行 ansible playbook是报错

 

创建用户并密码

  tasks:

    - name: create user
      become: yes
      become_method: su
      become_user: root
      user: home={
{ home }} name={
{ username }} createhome=yes system=yes state=present shell=/bin/bash
    - name: set passwd
      become: yes
      become_method: su
      become_user: root
      shell: /usr/bin/echo {
{ pwd }}|/usr/bin/passwd --stdin {
{ username }}

 

报错:

passwd:只能指定一个用户的名称。

 

最后发现:

shell: /usr/bin/echo {

{ pwd }}|/usr/bin/passwd --stdin {
{ username }}

这条命令是网上复制过来的,个人认为是字符集问题

解决方法:

找台机器手动敲一遍然后在粘贴到yml里就可以了

 

转载地址:http://bugpb.baihongyu.com/

你可能感兴趣的文章
Palindrome Partitioning II
查看>>
Clone Graph
查看>>
Gas Station
查看>>
Candy
查看>>
Single Number
查看>>
SetForeGroundWindow
查看>>
判断程序执行用户和活动用户是否一致
查看>>
Com引起计数
查看>>
IHTMLDocument2 IE浏览器编程
查看>>
C/C++中指针和引用之相关问题研究
查看>>
一些AIX问题,自动logout
查看>>
AIX操作系统及HACMP群集系统安装步骤
查看>>
AIX资源监控与调制工具
查看>>
aix里面怎么查看实际的磁盘空间
查看>>
银行AIX日常维护内容
查看>>
AIX 安全命令
查看>>
AIX故障定位
查看>>
AIX运行级别介绍
查看>>
Linux zombie进程
查看>>
Linux 的僵尸(zombie)进程
查看>>