ansible on Ubuntu

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

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