Permission issue with become

18 views
Skip to first unread message

maheshn...@gmail.com

unread,
Sep 1, 2020, 5:55:17 PM9/1/20
to Ansible Project

Having the same issue here: Any help is appreciated.
Using
ansible --version
ansible 2.5.2
config file = /etc/ansible/ansible.cfg
python version = 2.6.6

site.yml

- name: Live patch
  hosts: all
  become: yes

  tasks:
      - name: Update the packages using uptrack
         shell: 'uptrack-upgrade -y'
          args:
               executable: /usr/sbin
ERROR:
fatal: [10.0.0.1]: FAILED! => {"changed": false, "cmd": "/usr/sbin -c 'uptrack-upgrade -y'", "msg": "[Errno 13] Permission denied", "rc": 13}

Dick Visser

unread,
Sep 2, 2020, 5:43:42 AM9/2/20
to ansible...@googlegroups.com
You're trying to use /usr/sbin as a command, which won't work as this
is a directory.
Remove the 'args' stanza and instead use the full path to the shell
command you want to run:

tasks:
- name: Update the packages using uptrack
shell: '/usr/sbin/uptrack-upgrade -y'
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c25c6cba-ffa3-4268-9058-952db53f5866n%40googlegroups.com.



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT
Reply all
Reply to author
Forward
0 new messages