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

Ansible 2.0 not supported #33

Open
larsla opened this issue Nov 3, 2015 · 25 comments
Open

Ansible 2.0 not supported #33

larsla opened this issue Nov 3, 2015 · 25 comments

Comments

@larsla
Copy link

larsla commented Nov 3, 2015

When trying to use Ansigenome with Ansible 2.0 i get this error:
ERROR! 'ansigenome_info' is not a valid attribute for a RoleMetadata

I checked the MetaData class in ansible 2.0 and it seems to be more strict than earlier.
https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/role/metadata.py

Do you have any idea how this could be solved? I volunteer to help fix it, but I'm unsure how to proceed.

@ypid
Copy link
Contributor

ypid commented Nov 3, 2015

Hi @larsla
Me and I think also @nickjj would appreciate your help here. This issue is related to #23 and @nickjj somehow closed it. The trick which is already used is to move the ansigenome_info to meta/ansigenome.yml for Ansible 2.0 but Ansigenome can not handle that right now. To fix this, the script would need to be changed so that it tries to read the metadata from meta/ansigenome.yml first. I tired that once but gave up because if the code quallity. @nickjj agrees that the script could need some rework. If you want to help, that would be awesome 👍

@nathanhruby
Copy link

@nickjj is there a specific type of fix you're looking for here? If so, can you let me know? I'd be happy spend some time this weekend on this issue so I can start my 2.0 upgrade work next week.

@nickjj
Copy link
Owner

nickjj commented Feb 5, 2016

Hey @drybjed, would you mind guiding @nathanhruby on what would need to be done to upgrade Ansigenome to be 2.0 compatible?

I haven't used Ansible in quite some time and I'm not sure of any of the changes.

@drybjed
Copy link

drybjed commented Feb 5, 2016

@nathanhruby Hi! Right off the bat the biggest benefit would be to change the default ansigenome metadata file. Right now ansigenome expects the ansigenome_info dict in the meta/main.yml of the Ansible role, however Ansible does not tolerate it at all. In my roles, I moved that dictionary to separate meta/ansigenome.yml file which is not an issue for Ansible.

There should be some changes in the default template that interprets the dictionary data. Ansible Galaxy recently switched from role ids to user/role naming scheme in the Galaxy URLs. Since role id is not easy to find anymore (maybe through API), I would siwtch the ansigenome_info.galaxy_id variable to just ansigenome_info.galaxy bool activating or diactivating the custom template parts, and used the user/role information from separate variable. I'm not sure if Ansible Galaxy uses GitHub user/repository mapping or GitHub user/Galaxy role name, I suppose that could be tested.

One other thing that I would change is removal of role categories and switch to Ansible Galaxy tags.

@ypid
Copy link
Contributor

ypid commented Apr 17, 2016

@larsla, @nathanhruby any progress?

@nathanhruby
Copy link

sorry I got pulled away from the 2.0 upgrade, of which this was a blocker. I haven't had time to get back to it. I will try to carve out some time this week.

@mihai-satmarean
Copy link

Hello everybody, this topic remains unattended even that in the forks there are a lot of changes in this direction. It would be really helpful if you can somehow integrate usage for Ansible > 2.0
Thanks!

@ypid
Copy link
Contributor

ypid commented Mar 14, 2017

#49 fixes this or at least has a workaround for it. Feel free to cherry pick.

@mihai-satmarean
Copy link

mihai-satmarean commented Mar 15, 2017 via email

@ypid
Copy link
Contributor

ypid commented Mar 15, 2017

@mihai-satmarean I mean that https://github.com/ypid/ansigenome already includes a workaround. It might need some rework but then it can be proposed in a separate PR to fix this issue.

@mihai-satmarean
Copy link

Since we would like to automate our documentation with this tool, but we have no bandwidth to address this would be great if someone can point us to a working branch/fork that just works with ansible >2.0.
Thank you!

@ypid
Copy link
Contributor

ypid commented May 4, 2017

As said, https://github.com/ypid/ansigenome/tree/devel includes a patch. It just works with Ansible 2.0 and above (but should be reworked to be merged into Ansigenome).

@adriaand007
Copy link

hi there maybe I'm missing something but I get the following error
File "build/bdist.linux-x86_64/egg/ansigenome/scan.py", line 83, in init
File "build/bdist.linux-x86_64/egg/ansigenome/scan.py", line 183, in scan_roles
File "build/bdist.linux-x86_64/egg/ansigenome/scan.py", line 410, in read_and_validate_meta
KeyError: 'keyids_file'

This is if I run the command like

ansigenome gendoc /etc/ansible/roles/ -f md

ypid added a commit to ypid/ansigenome that referenced this issue May 23, 2017
@ypid
Copy link
Contributor

ypid commented May 23, 2017

@adriaand007 Thanks for reporting! Fixed. The idea is that the keyids_file is provided in Ansigenome configuration (example: https://github.com/debops/debops-keyring/blob/master/keyids)

keyids_file: /home/user/.ansible/ypid-ansible-common/submodules/debops-keyring/keyids

I made it optional. You can try with the latest commit from my fork.

@mihai-satmarean
Copy link

ypid, Thanks for the reply, I had cloned the repo instead of the other ansigenome I had installed, and init a role. After that trying to scan, gendoc or anything would reply
No roles were found at this path:
Also what I understand is that meta/main.yml became more restrictive and that is why ansigenome creates it's own file now.
This looks like a very useful project,
Can anyone help by pointing to a working version with Ansible 2.3? Maybe even a new branch?
Thank you very much!

@ypid
Copy link
Contributor

ypid commented Jun 29, 2017

@mihai-satmarean
Copy link

mihai-satmarean commented Jun 29, 2017

Hi @ypid I had used that repo to generate a new role, and meta/ansigenome.yml is not created, the result of the command "ansigenome scan " against a role created by asnigenome results in
`ansigenome gendoc -l ansigenome_test


Traceback (most recent call last):
  File "/usr/local/bin/ansigenome", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/Volumes/diskE/Users/msn3/Documents/ansible-workspace/used_for_components/ansigenome/bin/ansigenome", line 326, in <module>
    main()
  File "/Volumes/diskE/Users/msn3/Documents/ansible-workspace/used_for_components/ansigenome/bin/ansigenome", line 322, in main
    fn(args, options, reloaded_config, parser)
  File "/Volumes/diskE/Users/msn3/Documents/ansible-workspace/used_for_components/ansigenome/bin/ansigenome", line 161, in execute_gendoc
    Scan(args, options, config, gendoc=True)
  File "/Volumes/diskE/Users/msn3/Documents/ansible-workspace/used_for_components/ansigenome/ansigenome/scan.py", line 83, in __init__
    self.scan_roles()
  File "/Volumes/diskE/Users/msn3/Documents/ansible-workspace/used_for_components/ansigenome/ansigenome/scan.py", line 183, in scan_roles
    if self.read_and_validate_meta(key):
  File "/Volumes/diskE/Users/msn3/Documents/ansible-workspace/used_for_components/ansigenome/ansigenome/scan.py", line 410, in read_and_validate_meta
    keyring_entities = self._get_debops_keyring_entities(self.config["keyids_file"])
KeyError: 'keyids_file'

@ypid
Copy link
Contributor

ypid commented Jun 29, 2017

Hm, Windows is unsupported I guess ;-) But I will look at it. Just the python stacktrace without linebreaks makes me nervous. Can you update the comment and use multiline code formating :) ? Although I think I spotted the issue. There was an issue a few comments above which I fixed #33 (comment). Your stacktrace suggests that you don’t have the fix yet. Please run git pull and confirm that ypid@39d7b1f is included.

https://help.github.com/articles/creating-and-highlighting-code-blocks/

@mihai-satmarean
Copy link

mihai-satmarean commented Jun 29, 2017

Actually I am running it in a mac
I had run
/Library/Python/2.7/site-packages# sudo git clone https://github.com/ypid/ansigenome.git

@ypid
Copy link
Contributor

ypid commented Jun 29, 2017

@mihai-satmarean Ah, mac right. Sorry for that :)

Did the fresh git clone fix it?

@mihai-satmarean
Copy link

mihai-satmarean commented Jun 29, 2017 via email

@ypid
Copy link
Contributor

ypid commented Jun 29, 2017

nope.

There is still an issue with your setup. Line 410 in scan.py does not match up: https://github.com/ypid/ansigenome/blob/39d7b1fd2e4385d689efc1d364b0d30ff460e4da/ansigenome/scan.py#L410
Maybe you forgot pip install or something.

@mihai-satmarean
Copy link

call me names, I forgot to run setup
it works now.
Need to learn how to use it properly

@Hashfyre
Copy link

Hey folks, any update on this issue. The repo docs didn't say ansible2.0+ isn't supported. Is anyone working on this as of now?

@ypid
Copy link
Contributor

ypid commented Aug 24, 2018

Nobody is working on it as far as I know. Feel free to help.

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

8 participants