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_pkg_mgr is unknown on Travis CI instance after installing homebrew #42

Open
GlaIZier opened this issue Feb 20, 2019 · 5 comments

Comments

@GlaIZier
Copy link

Hello there!

Thank you for your work!

This is a duplicate to an issue described here
In short, ansible_pkg_mgr is unknown after applying this role on Travis CI instance.

@elliotweiser
Copy link
Collaborator

I'll see what I can do to reproduce it.

@elliotweiser
Copy link
Collaborator

In the meantime...

Since you're running on MacOS and this appears to be a bug that relates to package installation (which was only really tested on Linux distros), I think you can bypass the error by just skipping the sdkman_privilege tag. Do you need privilege escalation/root access for testing your playbook on MacOS?

@GlaIZier
Copy link
Author

GlaIZier commented Feb 21, 2019

Yes, your workaround has worked. However, I'm still not sure that this is a bug of your role.

My pipeline on Travis is as follows

  1. remove homebrew
  2. run the role to install homebrew
  3. run this role

I ran some tests.
Before the first step ansible_pkg_mgr = homebrew, after it ansible_pkg_mgr = unknown and after the second step it is still ansible_pkg_mgr = unknown.

Seems like the homebrew role doesn't set up the ansible_pkg_mgr fact... Maybe I could do it manually before executing your role?

@elliotweiser
Copy link
Collaborator

It looks MacOS support needs some rework. AFAIK, there should be no need to install homebrew packages, so this task can probably just be skipped if `ansible_os_family == "Darwin". We can tackle this next.

Incidentally, I think if you configure your playbook to run the homebrew role and the sdkman role in separate plays, then gather_facts will repopulate the ansible_pkg_mgr fact with the appropriate value. Granted, I still think there's nothing homebrew-related that should be happening here.

Stay tuned for updates.

@GlaIZier
Copy link
Author

GlaIZier commented Mar 8, 2019

As a workaround, I set up ansible_pkg_mgr manually in pre_tasks since I also use another role and experience the same issue.

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