ansible on Ubuntu

29 views
Skip to first unread message

Jason Li

unread,
Dec 4, 2016, 9:30:25 PM12/4/16
to Ansible Project
Hi Support,

I'm new for ansible and Linux, may I know, as Ubuntu disabled 'root' account, but when we install system, the permission was grant to 'root' as well, like '/etc/'..

I'm facing the problem when create /etc/nginx/nginx.conf', I'm continue getting 'permission denied' error.

I've copied the ssh key to 'ubuntu' account, and below is the playbook, I used -K to input the password as well.

- name: test playbook
  hosts: webservers
  tasks:
    - name: debug
      debug: msg="{{ group_names }}, {{ ansible_processor_cores }}"

    - name: create nginx config directory
      file: path=/etc/nginx state=directory mode=0755
      become: sudo

"msg": "There was an issue creating /etc/nginx as requested: [Errno 13] Permission denied: '/etc/nginx'"

Can someone help for that.

Thanks.
Best Regards,
Jason

Rodney Quillo

unread,
Dec 5, 2016, 2:23:55 AM12/5/16
to Ansible Project

Hmm, looks like the 'become:sudo' is something that makes permission denied.
It must be something like:

...
become: true
...

See http://docs.ansible.com/ansible/become.html
Reply all
Reply to author
Forward
0 new messages