ansible 运行creates保存
本帖最后由 batsh 于 2016-10-19 13:22 编辑# ansible lab -l lab1 -a "chdir=/tmp creates=kel.conf" -vvv
Using /opt/ansible.cfg as config file
<172.16.3.222> ESTABLISH SSH CONNECTION FOR USER: root
<172.16.3.222> SSH: EXEC sshpass -d13 ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=22 -o User=root -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r 172.16.3.222 '/bin/sh -c '"'"'LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python && sleep 0'"'"''
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_ChXPEA/ansible_module_command.py", line 250, in <module>
main()
File "/tmp/ansible_ChXPEA/ansible_module_command.py", line 181, in main
if args.strip() == '':
AttributeError: 'NoneType' object has no attribute 'strip'
lab1 | FAILED | rc=0 >>
MODULE FAILURE
# ansible --version
ansible 2.1.2.0
config file = /opt/ansible.cfg
configured module search path = Default w/o overrides
我运行command的creates及removes时都会报一样的错误,不知道问题,求助!!
# Run the command if the specified file does not exist.
- command: /usr/bin/make_database.sh arg1 arg2 creates=/path/to/database
# You can also use the 'args' form to provide the options. This command
# will change the working directory to somedir/ and will only run when
# /path/to/database doesn't exist.
- command: /usr/bin/make_database.sh arg1 arg2
args:
chdir: somedir/
creates: /path/to/database rancho 发表于 2016-10-19 11:25
# Run the command if the specified file does not exist.
- command: /usr/bin/m ...
请指点一下,是我执行的命令格式不对吗
谢谢提供。收下了。
页:
[1]