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 <[email protected]> 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 > >
