Hi Joe,
On 29.07.19 22:29, Joe Langdon wrote:
> I am using an Ansible Role to copy a template file. It is not allowing me
> saying...... "The destination directory (/sys/module/nvme_core/parameters)
> is not writable by the current user"
> I am not sure how to proceed at this point. I have close to 100 servers
> with this issue and it is causing some intermittent outages (apparently
> this is a known issue with AWS NVME) Thanks for your thoughts in advance
so the problem is, /sys is a virtual file system. You (afaik) can't
remove files from it.
What Ansible does is creating a temporary file with the desired content
and moving it to the destination. And moving implies first removing the
original file. The following won't work either:
echo 40 > /tmp/io_timeout
mv /tmp/io_timeout /sys/module/nvme_core/parameters/io_timeout
The correct solution would be setting the nvme.io_timeout kernel
parameter in /etc/default/grub, regenerating grub config and rebooting.
The easy solution would be something like:
- name: Get nvme.io_timeout value
command: /bin/cat /sys/module/nvme_core/parameters/io_timeout
register: nvme_current_timeout
changed_when: false
- name: Set nvme.io_timeout value
shell: "echo {{ nvme_target_timeout }} >
/sys/module/nvme_core/parameters/io_timeout"
when: nvme_current_timeout.stdout|int != nvme_target_timeout|int
Regards,
Sebastian
--
Sebastian Meyer
Linux Consultant & Trainer
Mail:
me...@b1-systems.de
B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg /
http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537