My ansible-playbook version is latest. I try to activate ONOS service in docker container by running ansible-playbook. I tried some ways. However they all failed.
--- - hosts: local tasks: - name: Create a onos-a container docker_container: name: onos-a image: onosproject/onos restart: yes ports: 8190:8190 - name: Activate onos-a fwd apps #failed by shell shell: "docker exec -it onos-a bash -c '/root/onos/apache-karaf-4.2.6/bin/client app activate org.onosproject.openflow'" become: yes - name: Activate onos-a apps #fialed by commands docker_container: name: onos-a command: export ONOS_APPS=fwd command: export ONOS_APPS=openflow Need some help ~ when I running shell command, the error shows "changed": true, "cmd": "sudo docker exec -it onos_b bash -c '/root/onos/apache-karaf-4.2.6/bin/client app activate org.onosproject.openflow'", "delta": "0:00:03.291473", "end": "2020-01-23 20:00:33.229114", "invocation": { "module_args": { "_raw_params": "sudo docker exec -it onos_b bash -c '/root/onos/apache-karaf-4.2.6/bin/client app activate org.onosproject.openflow'", "_uses_shell": true, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "stdin_add_newline": true, "strip_empty_ends": true, "warn": true } }, "msg": "non-zero return code", "rc": 1, "start": "2020-01-23 20:00:29.937641", "stderr": "", "stderr_lines": [], "stdout": "Logging in as karaf\r\nFailed to get the session.", "stdout_lines": [ "Logging in as karaf", "Failed to get the session." ] } When I ssh to the sever running commands, shows onos-b:~$ sudo docker exec -it onos_b bash -c '/root/onos/apache-karaf-4.2.6/bin/client app activate org.onosproject.fwd' Logging in as karaf Activated org.onosproject.fwd -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a63fedf7-5495-4f02-87bc-bc8a93144ba4%40googlegroups.com.