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

Using a pre-defined Ansible node #770

Closed
alahiff opened this issue Jan 28, 2019 · 6 comments
Closed

Using a pre-defined Ansible node #770

alahiff opened this issue Jan 28, 2019 · 6 comments
Assignees
Milestone

Comments

@alahiff
Copy link

alahiff commented Jan 28, 2019

From looking at https://imdocs.readthedocs.io/en/latest/radl.html it seems to be possible to use a specified Ansible node (using the ansible keyword) as an alternative to using Ansible on the IM node.
What are the requirements of this node, besides being accessible by IM via ssh and having ssh access to nodes provisioned by IM? e.g. does it need to have a specific version of Ansible pre-installed and configured?

@micafer
Copy link
Member

micafer commented Jan 28, 2019

It needs to have Ansible version (2.0 or higher) installed and configured.

@alahiff
Copy link
Author

alahiff commented Jan 28, 2019

Ok, that's what I've tried, using Ansible 2.7.6 with the same /etc/ansible/ansible.cfg as used in IM. I'm getting an error like this:

2019-01-28 09:59:08,400 - ConfManager - INFO - Inf ID: e34d7924-22e2-11e9-8482-0242ac110002: Waiting processes of step -1 to finish.
2019-01-28 09:59:12,941 - ConfManager - ERROR - Inf ID: e34d7924-22e2-11e9-8482-0242ac110002: Error in the ansible installation process
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/IM/ConfManager.py", line 822, in configure_master
    ssh.sftp_mkdir(remote_dir, 0o700)
  File "/usr/local/lib/python2.7/dist-packages/IM/retry.py", line 50, in f_retry
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IM/SSHRetry.py", line 72, in sftp_mkdir
    return SSH.sftp_mkdir(self, directory, mode)
  File "/usr/local/lib/python2.7/dist-packages/IM/SSH.py", line 428, in sftp_mkdir
    sftp.mkdir(directory, mode)
  File "/usr/local/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 460, in mkdir
    self._request(CMD_MKDIR, path, attr)
  File "/usr/local/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 813, in _request
    return self._read_response(num)
  File "/usr/local/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 865, in _read_response
    self._convert_status(msg)
  File "/usr/local/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 894, in _convert_status
    raise IOError(errno.ENOENT, text)
IOError: [Errno 2] No such file
2019-01-28 09:59:13,404 - ConfManager - INFO - Inf ID: e34d7924-22e2-11e9-8482-0242ac110002: Configuration process of master node failed.

One definite (and bad) problem I've found is that the security groups generated by IM don't allow the Ansible node to access any of the VMs created by IM via ssh. Is there any way to specify a default security group or to add tcp port 22 from a specific host? (I'm currently testing this using OpenStack).

@micafer
Copy link
Member

micafer commented Jan 28, 2019

You are right I forgot that some IM files are copied into the master VM so, also de the IM must be installed in the ansible host.

Regarding the security groups issue. You can add the port 22 to the ourports keywork of the networs used, to assure that the port is opened in the SGs of all VMs:

network public (outbound = 'yes' and outports='22')
network private (outports='22')

@alahiff
Copy link
Author

alahiff commented Jan 28, 2019

I've now installed IM on the Ansible host. I've also have tried changing:

network private ()

to

network private (outports='22')

but this unfortunately doesn't have any affect on the security groups created by IM. As a workaround I've therefore modified create_security_groups in IM/connectors/OpenStack.py in order to add a security group with port 22 open.

I still get the "No such file" error as before. I tried increasing LOG_LEVEL to DEBUG in im.cfg but it doesn't seem to provide any more information about what's going wrong.

@micafer
Copy link
Member

micafer commented Jan 29, 2019

The issue with port 22 is a bug in the connectors: see #771

@micafer micafer self-assigned this Feb 6, 2019
@micafer
Copy link
Member

micafer commented Feb 6, 2019

I had time to test it.
There is a bug in the IM that does not create a needed directoy. It is fixed in commit: 7a198bd
The ansible host only needs to have ansible installed and the ansible.cfg configured as described in the IM README.md

@micafer micafer added this to the 1.8.2 milestone Feb 6, 2019
@micafer micafer closed this as completed in 2a2b788 Feb 6, 2019
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