Also, since a version prior to 2.0 it's been possible to specify the mode 
using non-octal notation. That is: 

Or, in a playbook:

- name: Update permissions on a file.
    dest: /path/to/file
    owner: user
    group: group
    mode: ug+rw,o-rwx
    state: file

Personally I prefer this method and recall being quite happy when it was 
implemented mostly because I just don't like octal notation. 

On Friday, September 16, 2016 at 9:41:04 AM UTC-7, Kai Stian Olstad wrote:
> On 15. sep. 2016 14:10, Алексей Гуносов wrote: 
> > Hello. 
> > I have a server with Ubuntu Server 16.04.1. I test some ansible features 
> on 
> > it from my desktop with Ubuntu 16.04.1. 
> > So I have system user "www-data" for Apache with uid=33(www-data) 
> > gid=33(www-data) groups=33(www-data). 
> > I have directory /var/www/html/wordpress that I want to set permissions 
> to 
> > the system user/group "www-data". 
> > I write that in playbook: 
> > file: path=/var/www/html/wordpress owner=www-data group=www-data 
> mode=775 
> > state=directory recurse=yes 
> Mode should always start with a 0 since it's a octal. 
> To change the owner and group you need to be root to allow that. 
> > So when I check the permissions of directory /var/www/html/wordpress I 
> see 
> > that the owner is "1001" and group is "1001". But I haven't the user and 
> > group with uid and gid 1001. And this is the problem. 
> > What can I do? 
> Since you have provided little information about how you run this it's 
> hard for people to help. Which user are you using, are you using become, 
> what is the output of ansible-playbook -vvvv <your playbook> 
> -- 
> Kai Stian Olstad 

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 post to this group, send email to
To view this discussion on the web visit
For more options, visit

Reply via email to