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

subutai_clone seems does not work #31

Open
etursunbaev opened this issue May 24, 2018 · 2 comments
Open

subutai_clone seems does not work #31

etursunbaev opened this issue May 24, 2018 · 2 comments

Comments

@etursunbaev
Copy link

etursunbaev commented May 24, 2018

  1. Documentation how to install/setup plugin (it is module in ansible meaning) is pure. I understand that this is not in Ansible. Anyway there should be solid instructions how to install it properly

  2. I cloned this repo and placed into this path: /usr/lib/python2.7/dist-packages/ansible/modules/cloud/subutai

  3. I imported debian-stretch template like this:

- name: Import debian-stretch
   subutai:
        name: debian-stretch
        state: present

and it worked:

root@jenkins:~# subutai list   
CONT/TEMP
---------
debian-stretch:subutai:0.4.2
  1. When I want clone debian-stretch to builder name using like this:
 - name: Clone debian-stretch to builder
   subutai_clone:
        parent: debian-stretch
        child: builder

it fails:

fatal: [jenkins]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 192.168.121.188 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_YCtJ1n/ansible_module_subutai_clone.py\", line 161, in <module>\r\n    main()\r\n  File \"/tmp/ansible_YCtJ1n/ansible_module_subutai_clone.py\", line 158, in main\r\n    run_module()\r\n  File \"/tmp/ansible_YCtJ1n/ansible_module_subutai_clone.py\", line 134, in run_module\r\n    if container_exists(module.params['child']):\r\n  File \"/tmp/ansible_YCtJ1n/ansible_module_subutai_clone.py\", line 150, in container_exists\r\n    out = subprocess.Popen([\"/snap/bin/subutai\", \"list\"], stdout=subprocess.PIPE).stdout.read()\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 390, in __init__\r\n    errread, errwrite)\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 1024, in _execute_child\r\n    raise child_exception\r\nOSError: [Errno 2] No such file or directory\r\n", "msg": "MODULE FAILURE", "rc": 1}

With agent cli I usually do like this:

  • subutai import debian-stretch
  • subutai clone debian-stretch new_name which creates container from debian-stretch template

So It seems to me subutai_clone does not work as agent does

Also there a lot of modules missed in repo.

@liquuid pls. help

@liquuid
Copy link
Contributor

liquuid commented May 25, 2018

Hello @etursunbaev

1 - The easiest way is using the entire fork from https://github.com/liquuid/ansible, but this is based on ansible 2.6, the subutai module was tested on this version. But, should work if you drop subutai.py on your system ansible module dir. I had not tested this way.

2 - Not all functionality was covered by subutai.py at this time, the Red Hat ansible people ask to make a small first PR. That's why several agent capabilities is not in this consolidated version.

3-4 - Those modules subutai_* are outdated, they not will work on subutai 7.x

I can help you mantaining a full featured version of this module in sync with subutai 7, separated from small one to be reviewed by ansible upstream community.

Can you create a new issue with all modules you'll need ? I'll will work on that ASAP.

Thanks !

@etursunbaev
Copy link
Author

@liquuid did noy get you. In your repo there are too many files. Where is subutai.py?

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

No branches or pull requests

2 participants