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

Error running ansible-playbook #32

Open
tbennett6421 opened this issue Oct 4, 2022 · 4 comments
Open

Error running ansible-playbook #32

tbennett6421 opened this issue Oct 4, 2022 · 4 comments

Comments

@tbennett6421
Copy link

Following the steps on https://pimp-my-box.readthedocs.io/en/latest/setup.html

When running ansible-playbook I get the following error.

❯ ansible-playbook -i hosts site.yml
ERROR! 'include' is not a valid attribute for a Play

The error appears to be in '/Users/user/pimp-my-box/site.yml': line 3, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

# All available playbooks
- include: common.yml
  ^ here
@clidx
Copy link

clidx commented Oct 6, 2022

"include" has been deprecated. https://docs.ansible.com/ansible/latest/collections/ansible/builtin/include_module.html#deprecated

It's been split into different modules. I tried doing a find/replace to change all include to import-playbook but import-playbook isn't the correct one for every instance of include in all the .yml files so no there's quick hack to fix this.

So the last commit was well over a year ago. I'll try and fix this, if I can I'll fork and post here again.

@clidx
Copy link

clidx commented Oct 6, 2022

Well that was easy... I think, because I've run into a sudo issue trying to execute the playbook so can't really test it yet, but ansible doesn't complain about include anymore. Give it a go and let me know if it works so I can raise a PR. https://github.com/clidx/pimp-my-box

@tbennett6421
Copy link
Author

recommend you add become: True to the deadsnakes ppa as well.
pimp-my-box/roles/common/tasks/main.yml:4

I continued to run into issues installing. But I'm using ubuntu 22 which may be why.
That being said, your solution did get ansible to begin running the play.

@clidx
Copy link

clidx commented Oct 7, 2022

It's not up-to-date for newer versions of Ubuntu and Debian. I had to add Become: True to a lot of commands as a lot of them install packages or change things for the rtorrent user, and pyrocore still wouldn't install because it's based on python 2 and many of the packages only exist for python 3 now. Even after changing the required packages and setting ansible to use the system python interpreter, pyrocore still doesn't install.

I've given up on pyrocore, luckily I don't need the extra tools for my workflow, however I couldn't even get rtorrent-PS to compile with the provided script. rtorrent-PS-ch compiles fine though so I'm using that.

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