On 03.02.2019 13:16, ameya agashe wrote:
Hi Guys,
I'm not sure why the below yaml gives me an error ?
- name: Install Gluster and create file system on Cluster
hosts: localhost
connection: local
tasks:
- name: create gluster volume
gluster_volume:
state: present
name: gluster_vol1
bricks: /bricks/brick1/g1
rebalance: yes
cluster:
- 192.168.1.9
- 192.168.1.7
run_once: true
Error message below:
TASK [create gluster volume]
****************************************************************************************
An exception occurred during task execution. To see the full traceback,
use
-vvv. The error was: None
fatal: [localhost]: FAILED! => {"changed": false, "msg": "error running
gluster (/usr/sbin/gluster --mode=script peer status) command (rc=255):
ERROR: failed to create logfile \"/var/log/glusterfs/cli.log\"
(Permission
denied)\nERROR: failed to open logfile /var/log/glusterfs/cli.log\n"}
The playbook is running at the user you started ansible-playbook with.
This user have no permission in /var/log/glusterfs.
You probably need to run this as root/sudo, and that's called become in
Ansible
Good staring point is here
https://docs.ansible.com/ansible/latest/user_guide/become.html
--
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/779b95f4e2a4b134ef22917ad40d73ca%40olstad.com.
For more options, visit https://groups.google.com/d/optout.