Seeking help on jq installation using MacPorts

Andrew Udvare audvare at gmail.com
Tue Jun 9 18:42:51 UTC 2020


On 09/06/2020 07:51, Sushma g wrote:
> Hi Team,
> 
> I am trying to install jq on mac using ansible-playbook. I have used
> Macports module available in ansible to achieve this task
> Playbook-snippet
>  - name: install items
>       macports:
>         name: "{{ item }}"
>         state: present
>       with_items:
>         - jq
>         - openjdk11
>         - nodejs12
>         - git
> 
> When I run this playbook the play is success and when I check for jq
> installation using command "jq --version" seeing command not found error,
> whereas other items like git and java are installed. Facing this issue only
> for nodejs and jq

Two possibilities:

1. items not being installed
2. PATH not set to include /opt/local/bin

The reason Git and Java can work is because they are already in macOS
even as wrappers before Developer Tools are installed:

 $ ls -la /usr/bin/java /usr/bin/git
-rwxr-xr-x 1 root wheel 31488 2020-05-19 01:27:38 /usr/bin/git
lrwxr-xr-x 1 root wheel    74 2019-07-20 07:09:55 /usr/bin/java ->
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

SSH into the machine and run `port install jq` and make sure this
actually can work.

If you don't want to have to specify the full path to jq/etc, make sure
to set PATH to prepend /opt/local/bin.

One method is to do this for only the playbook or task:

https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-can-i-set-the-path-or-any-other-environment-variable-for-a-task-or-entire-playbook

--
Andrew

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20200609/4311c1a4/attachment.sig>


More information about the macports-users mailing list