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

Dockutil error #153

Closed
will62185 opened this issue Jun 14, 2022 · 6 comments
Closed

Dockutil error #153

will62185 opened this issue Jun 14, 2022 · 6 comments

Comments

@will62185
Copy link

When running $ ansible-playbook main.yml -K --tags "dock" error msg: '[Errno 2] No such file or directory: b''dockutil''' is observed.

System info: MacOS Monterey 12.4 (21F79) on M1 Macbook Pro

Found this issue from Dockutil repo: kcrawford/dockutil#127

Command output:

PLAY [all] ****************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************************************************************************************************************
[WARNING]: Platform darwin on host 127.0.0.1 is using the discovered Python interpreter at /opt/homebrew/bin/python3.9, but future installation of another Python interpreter could change the meaning of that path. See
https://docs.ansible.com/ansible-core/2.12/reference_appendices/interpreter_discovery.html for more information.
ok: [127.0.0.1]

TASK [Include playbook configuration.] ************************************************************************************************************************************************************************************
ok: [127.0.0.1] => (item=/Users/{USER}/src/mac-dev-playbook/config.yml)

TASK [geerlingguy.mac.dock : Install dockutil.] ***************************************************************************************************************************************************************************
changed: [127.0.0.1]

TASK [geerlingguy.mac.dock : Remove configured Dock items.] ***************************************************************************************************************************************************************

TASK [geerlingguy.mac.dock : Ensure required dock items exist.] ***********************************************************************************************************************************************************
included: /Users/{USER}/.ansible/collections/ansible_collections/geerlingguy/mac/roles/dock/tasks/dock-add.yml for 127.0.0.1 => (item={'name': 'Google Chrome', 'path': '/Applications/Google Chrome.app/', 'pos': 3})
included: /Users/{USER}/.ansible/collections/ansible_collections/geerlingguy/mac/roles/dock/tasks/dock-add.yml for 127.0.0.1 => (item={'name': 'Firefox', 'path': '/Applications/Firefox.app/', 'pos': 4})
included: /Users/{USER}/.ansible/collections/ansible_collections/geerlingguy/mac/roles/dock/tasks/dock-add.yml for 127.0.0.1 => (item={'name': 'Slack', 'path': '/Applications/Slack.app/', 'pos': 5})
included: /Users/{USER}/.ansible/collections/ansible_collections/geerlingguy/mac/roles/dock/tasks/dock-add.yml for 127.0.0.1 => (item={'name': 'iTerm', 'path': '/Applications/iTerm.app/', 'pos': 6})
included: /Users/{USER}/.ansible/collections/ansible_collections/geerlingguy/mac/roles/dock/tasks/dock-add.yml for 127.0.0.1 => (item={'name': 'Visual Studio Code', 'path': '/Applications/Visual Studio Code.app/', 'pos': 7})
included: /Users/{USER}/.ansible/collections/ansible_collections/geerlingguy/mac/roles/dock/tasks/dock-add.yml for 127.0.0.1 => (item={'name': 'Sublime Text', 'path': '/Applications/Sublime Text.app/', 'pos': 8})
included: /Users/{USER}/.ansible/collections/ansible_collections/geerlingguy/mac/roles/dock/tasks/dock-add.yml for 127.0.0.1 => (item={'name': '1Password', 'path': '/Applications/1Password.app/', 'pos': 9})
included: /Users/{USER}/.ansible/collections/ansible_collections/geerlingguy/mac/roles/dock/tasks/dock-add.yml for 127.0.0.1 => (item={'name': 'AWS VPN Client', 'path': '/Applications/AWS VPN Client/AWS VPN Client.app/', 'pos': 10})

TASK [geerlingguy.mac.dock : See if Dock item Google Chrome exists.] ******************************************************************************************************************************************************
ok: [127.0.0.1]

TASK [geerlingguy.mac.dock : Ensure Dock item Google Chrome exists.] ******************************************************************************************************************************************************
fatal: [127.0.0.1]: FAILED! => changed=false 
  cmd: dockutil --add '/Applications/Google Chrome.app/'
  msg: '[Errno 2] No such file or directory: b''dockutil'''
  rc: 2
  stderr: ''
  stderr_lines: <omitted>
  stdout: ''
@einSelbst
Copy link

einSelbst commented Jun 19, 2022

Some context: as newer MacOS don't have python, docutilwas rewritten in swift. Not sure how it is installed in this playbook, it should be possible to just add it as a home-brew install. However, there are issues with that, see eg

As a temporary workaround adding hpedrorodrigues/tools/dockutilto the home-brew cask section works.

@will62185
Copy link
Author

As a temporary workaround adding hpedrorodrigues/tools/dockutilto the home-brew cask section works.

Thanks @einSelbst i'll give the workaround a try.

@lotyp
Copy link

lotyp commented Jun 19, 2022

@will62185 as by now there is mess with all that, you can use my roles

There are several issues right now,

  1. in Ansible itself - homebrew_cask: unhelpful error when become_user set wrong ansible-collections/community.general#4708 (comment),
  2. in Homebrew with merging dockutil - dockutil 3.0.2 Homebrew/homebrew-core#97394
  3. in dockutil - Not working on macOS 12.3 - need to upgrade Homebrew version from 2 to 3 kcrawford/dockutil#127
  4. and in geerlingguy roles and collections, which depends on all that, mentioned in 1. and 2.

I've invested time to fix all that.

My roles:

Third link can be replaced with hpedrorodrigues/tools/dockutil as @einSelbst mentioned

@geerlingguy I'm really sorry, as this looks like we are using your repo issues section for adverts for our code 😀

@will62185
Copy link
Author

Hi @einSelbst @lotyp, I wanted to report back that the workaround for docktuil worked great. Thank you both.

@geerlingguy
Copy link
Owner

Merging this discussion into #42, which is the original report.

@einSelbst
Copy link

Thanks for the feedback @geerlingguy . However, reading through #42 it doesnt seem to be related. This bug report is regarding the tool called -dockutil-, which places an app in the dock, but #42 is about dotfiles.

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

4 participants