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

Switch to become plugins #29

Merged
merged 1 commit into from
Jan 7, 2021
Merged

Switch to become plugins #29

merged 1 commit into from
Jan 7, 2021

Conversation

kuPyxa
Copy link
Contributor

@kuPyxa kuPyxa commented Aug 16, 2019

No description provided.

@madpilot78
Copy link
Contributor

madpilot78 commented Sep 23, 2019

I have tried using this patch, since I'm running into rpoblems with ansible 2.8, but it's not working for me.

I get this error:

The full traceback is:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/ansible/executor/task_executor.py", line 145, in run
    res = self._execute()
  File "/usr/local/lib/python3.6/site-packages/ansible/executor/task_executor.py", line 664, in _execute
    result = self._handler.run(task_vars=variables)
  File "/usr/local/lib/python3.6/site-packages/ansible/plugins/action/service.py", line 55, in run
    facts = self._execute_module(module_name='setup', module_args=dict(gather_subset='!all', filter='ansible_service_mgr'), task_vars=task_vars)
  File "/usr/local/lib/python3.6/site-packages/ansible/plugins/action/__init__.py", line 836, in _execute_module
    self._transfer_data(remote_module_path, module_data)
  File "/usr/local/lib/python3.6/site-packages/ansible/plugins/action/__init__.py", line 447, in _transfer_data
    self._transfer_file(afile, remote_path)
  File "/usr/local/lib/python3.6/site-packages/ansible/plugins/action/__init__.py", line 424, in _transfer_file
    self._connection.put_file(local_path, remote_path)
  File "/usr/local/lib/python3.6/site-packages/ansible/plugins/connection/sshjail.py", line 437, in put_file
    self._copy_file(tmp, out_path)
  File "/usr/local/lib/python3.6/site-packages/ansible/plugins/connection/sshjail.py", line 407, in _copy_file
    copycmd = plugin.build_become_command(' '.join(['cp', from_file, to_file]), shell)
AttributeError: 'NoneType' object has no attribute 'build_become_command'

jail@host | FAILED! => {
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}

@madpilot78
Copy link
Contributor

I followup to myself, to state, I actually got that error because I forgot the "become" flag, so no become plugin was present, as the error states.

If I pass the "-b" flag(or have become: yes in the play) everything works.

Maybe adding a check for this condition could be useful.

@dch
Copy link
Contributor

dch commented Dec 5, 2019

BTW this PR works brilliantly. @austinhyde if you're not actively using this we could move it to a "freebsd community" fork?

@austinhyde austinhyde merged commit 93f7f31 into austinhyde:master Jan 7, 2021
@austinhyde
Copy link
Owner

My apologies for the terribly long time without a response.

It's true that I am no longer using this project, and no longer have any "real" machines to test against, which has made accepting PRs much more onerous than it used to be. Fortunately, I've recently had some time to set up Vagrant (now on master), which should allow much easier testing of PRs.

In this case, I was able to confirm that this PR

  • does not break on Ansible 2.5
  • on master, shows a deprecation warning on 2.9
  • on this branch, shows no deprecation warning and works as expected on 2.9

This PR aside, in response to @dch - I would definitely be open to transferring this to someone else that's more actively using it or some sort of community organization. If no one is willing to take that on or has ideas on where this can live, I can continue to steward the project, and make some of you co-maintainers.

Thoughts?

@madpilot78
Copy link
Contributor

I would not be able to be a maintainer for the project because I am not a python programmer, I know the language only superficially.

But I'd like to add it to the official FreeBSD ports tree.

It would be much easier if a new release was cut from it here on github to use as a basis.

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

Successfully merging this pull request may close these issues.

None yet

4 participants