Comments (5)
AttributeError: 'NoneType' object has no attribute 'version'
usually either means your Ansible version is too old (2.9 or later is recommended), or your Python version is too old (3.6 or later is recommended)βmost likely the latter.
from ansible-collection-mac.
Here are the relevant versions on the node executing the playbook
% ansible --version
ansible [core 2.11.5]
config file = None
configured module search path = ['/Users/administrator/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /Users/administrator/Library/Python/3.8/lib/python/site-packages/ansible
ansible collection location = /Users/administrator/.ansible/collections:/usr/share/ansible/collections
executable location = /Users/administrator/Library/Python/3.8/bin/ansible
python version = 3.8.2 (default, Apr 8 2021, 23:19:18) [Clang 12.0.5 (clang-1205.0.22.9)]
jinja version = 3.0.2
libyaml = True
from ansible-collection-mac.
@zharbour - It's weird, because in the playbook output, I'm seeing:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
Which seems to indicate when you run ansible-playbook
it's picking up Python 2.7.
from ansible-collection-mac.
Figured it out.
Looking at the traceback it is running on the remote machine. File "/Users/anka/.ansible/...
is in the anka userspace, which only exists on the VM. The anka
user is the default user created by the anka CLI when creating VMs.
I opened a session on the VM and tried running python3
$ python3
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
Looks like there are no command line tools on a fresh VM. Installed that.
$ softwareupdate -i "Command Line Tools for Xcode-13.0"
Software Update Tool
Finding available software
Downloaded Command Line Tools for Xcode
Installing Command Line Tools for Xcode
Done with Command Line Tools for Xcode
Done.
Python3 is working
$ python3
Python 3.8.9 (default, Aug 21 2021, 15:53:23)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
And I ran the playbook again to see everything running smoothly.
PLAY RECAP ******************************************************************************************************************************************************************************
127.0.0.1 : ok=15 changed=6 unreachable=0 failed=0 skipped=8 rescued=0 ignored=0
Reviewing everything a final time, I noticed this:
playbook.yml
---
- name: Golden image configuration
hosts: packer
vars:
homebrew_installed_packages:
- git
- openjdk@8
roles:
- geerlingguy.mac.homebrew
requirements.yml
---
roles:
- name: elliotweiser.osx-command-line-tools
collections:
- name: geerlingguy.mac
I did not add elliotweiser.osx-command-line-tools
to the playbook roles. I was under the impression that your collection would run it as a dependency, but that's not how it works as I'm now finding out. I'm new to ansible, sorry about that.
from ansible-collection-mac.
I was under the impression that your collection would run it as a dependency, but that's not how it works as I'm now finding out.
Yeah... unfortunately when they built collections, they decided roles were some sort of weird legacy thing and thought people would never build collections that would depend on roles. Grr.
from ansible-collection-mac.
Related Issues (20)
- Sudo Issue with Cask Installed Item
- Ansible fails on a warning message coming from `brew` for a Formula which has an identically named Cask HOT 2
- Homebrew - Add support for link and unlink HOT 2
- Symlink brew to homebrew_brew_bin_path with root user HOT 2
- [M2 issue] Bad CPU type in executable b''/usr/local/bin/git''' HOT 2
- Failed geerlingguy.mac.homebrew : Ensure proper ownership on homebrew_install_path subdirs. HOT 3
- Dock Command does not install correctly, causing the dock commands to skip HOT 6
- Support for spacers in the dock role
- Homebrew fails when tapping homebrew/core HOT 6
- PATH issue finding MAS, when running REMOTELY HOT 1
- Tapping default homebrew taps is broken HOT 2
- install path /opt/homebrew/Homebrew is unsupported HOT 2
- TypeError during Homebrew Cask Installation of android-platform-tools on MacOS HOT 5
- Error on [geerlingguy.mac.homebrew : Ensure proper ownership on homebrew_install_path subdirs.] OSError: [Errno 63] File name too long. HOT 1
- Error during: Ensure Homebrew is installed
- Ensure proper ownership fails for apps with admin as group HOT 1
- Cannot install collection with galaxy: Connection Reset By Peer HOT 1
- Issues possibly with folder permissions HOT 1
- Cannot install git-credential-manager-core
- Make the binary path of "brew" accessible outside role context
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-collection-mac.