Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于playbook执行出现的bug #86

Open
zzjackaa opened this issue Jul 8, 2020 · 3 comments
Open

关于playbook执行出现的bug #86

zzjackaa opened this issue Jul 8, 2020 · 3 comments

Comments

@zzjackaa
Copy link

zzjackaa commented Jul 8, 2020

执行后发现未有返回结果
后来我将结果打印返回为空 ,后台打印
[WARNING]: No inventory was parsed, only implicit localhost is available

[WARNING]: Could not match supplied host pattern, ignoring: all

[WARNING]: Could not match supplied host pattern, ignoring: test
类似这样的 输出
后来我实例化了 MyInventory这个类 并执行了dynamic_inventory方法返回依旧是空
最终我打印了resource即type发现为tuple并不是dict也不是list 经过查看是返回了两个值

因此将 ans_playbook_websocket.py下的
resource = GenResource().gen_group_dict(group_ids)
改为
resource ,group_name= GenResource().gen_group_dict(group_ids)

@zzjackaa
Copy link
Author

zzjackaa commented Jul 8, 2020

还有建议 执行celery打开调试 root@big02:/data/Ops-master# export C_FORCE_ROOT="true"
root@big02:/data/Ops-master# C_FAKEFORK=1 sh -x /etc/init.d/celeryd start
不然可能会发现不到错误 并且日志后台也不会有输出

@wodezz
Copy link

wodezz commented Dec 16, 2021

已经将ans_playbook_websocket.py下的
resource = GenResource().gen_group_dict(group_ids)
改为
resource ,group_name= GenResource().gen_group_dict(group_ids)

但是执行后还是没东西
image

还有就是yml到底是要怎么写才可以,我写了个测试的

  • hosts: all
    tasks:
    • name: copy file
      copy: src=/root/initial-setup-ks.cfg dest=/root/initial-setup-ks.cfg

1 similar comment
@wodezz
Copy link

wodezz commented Dec 16, 2021

已经将ans_playbook_websocket.py下的
resource = GenResource().gen_group_dict(group_ids)
改为
resource ,group_name= GenResource().gen_group_dict(group_ids)

但是执行后还是没东西
image

还有就是yml到底是要怎么写才可以,我写了个测试的

  • hosts: all
    tasks:
    • name: copy file
      copy: src=/root/initial-setup-ks.cfg dest=/root/initial-setup-ks.cfg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants