-T, --timeout=TIMEOUT执行命令的超时时间,默认10s -u, --user=REMOTE_USER 执行远程执行的用户 -b, --become 代替旧版的sudo切换 ansible系列命令 ansible ansible-doc ansible-playbook ansible-vault ansible-console ansible-galaxy ansible-pull ansible-doc:显示模块帮助 ansible-doc [options] [module…] ...
[root@note0 ~]# ansible note1 -m user -a 'name=testpass password="$a" update_password=always' [WARNING]: The input password appears not to have been hashed. The 'password' argument must be encrypted for this module to work properly. 176.16.128.1 | CHANGED => { "ansible_facts": { ...
# ansible10.0.0.11-m user -a'name=sky01 password=$6$sky01$Ppe22caGxlbHwCR5biZ0oCcMa63McBIBgXD3RIkO080MckocOdUl2/SpKWUgPCdAOOE1Yjzyb5Oir2vgOjVwL/'[WARNING]: The input password appears not to have been hashed. The'password'argument must be encryptedforthismodule to work properly.10.0....
password_lock:参数用于锁定指定用户,布尔类型,默认为空 update_password:参数可选值有always和on_create,默认为always。 当设置为always时,password参数的值与/etc/shadow中密码字符串不一致时更新用户的密码; 当设置为on_create时,password参数的值与/etc/shadow中密码字符串不一致时也不会更新用户的密码,但如果是...
user:生成用户、删除用户 group:生成组、删除组 1、生成用户:ansible all -m user -a "name=test password=1DhUWqz2JZqc home=/home uid=999 comment=‘this is a ansible test user‘ shell=/bin/sh" 其中密码为123,生成方式为: openssl passwd -salt -1 "123" ...
Ansible-user模块 一、user模块 user模块用于管理用户账号和用户属性 https://docs.ansible.com/ansible/latest/modules/user_module.html#user-module 创建一个用户sky,密码是123 要求是系统用户 非交互式登陆 要求生成自己的秘钥对 不创建家目录 代码语言:javascript...
ansible-doc -s user常用的参数:name :用户名,必选参数state=present|absent:创建账号或者删除账号,present表示创建,absent 表示删除system=yes|no:是否为系统账号uid: 用户uidgroup:用户基本组groups:附加组shell:默认使用的shellmove_home=yse|no:如果设置的家日录已经存在,是否将已经存在的家日录进行移动password:...
remote_user:远程连接时使用的用户,默认使用当前用户 ask_pass:连接时是否询问输入密码(如果没有配置密钥登录,需要配置该选项为 true。) privilege_escalation 模块:sudo 提权相关的配置 become:是否开启切换用户 become_method:如何切换用户 become_user:切换到那个用户 ...
* Both `login_password' and `login_user' are required when you are passing credentials. If none are present,the module will attempt to read the credentials from `~/.my.cnf',and finally fall back to using the MySQL default login of 'root' with no password.REQUIREMENTS:MySQLdbAUTHOR:Jonathan...
#创建用户指定uid和gid,不创建家目录也不允许登陆[root@m01~]# ansible oldboy-m user-a"name=oldgirl uid=888 group=888 shell=/sbin/nologin create_home=no"#将明文密码进行hash加密,然后进行用户创建[root@m01~]# ansible localhost-m debug-a"msg={{ 'bgx' | password_hash('sha512', 'salt') ...