Seeking help on jq installation using MacPorts

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Seeking help on jq installation using MacPorts

Sushma g
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

Can anyone assists me on this ??

Awaiting for your reply.

Regards,
Sushma
Reply | Threaded
Open this post in threaded view
|

Re: Seeking help on jq installation using MacPorts

Andrew Udvare
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


signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Seeking help on jq installation using MacPorts

Sushma g
Hi Andrew,

I tried the way as u suggested, but I was not able to install even with commands in mac machine. PFB screenshot for your reference.

image.png

Regards,
Sushma
On Wed, 10 Jun 2020 at 00:13, Andrew Udvare <[hidden email]> wrote:
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

Reply | Threaded
Open this post in threaded view
|

Re: Seeking help on jq installation using MacPorts

Sushma g
In reply to this post by Andrew Udvare
Hi Andrew,

Also I have installed Macports in mac , but seeing command port not found. 

Regards,
Sushma

On Wed, 10 Jun 2020 at 00:13, Andrew Udvare <[hidden email]> wrote:
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

Reply | Threaded
Open this post in threaded view
|

Re: Seeking help on jq installation using MacPorts

ryandesign2
Administrator


On Jun 10, 2020, at 04:57, Sushma g wrote:

> Also I have installed Macports in mac , but seeing command port not found.

Then you haven't set up the PATH environment variable properly in your shell startup file. The MacPorts installer is supposed to do it for you, but if that doesn't work or if you installed MacPorts another way, you can set it up manually:

https://guide.macports.org/#installing.shell