i'm trying to add a value in inline module in sysctl.conf file, how can i achieve that? once i enter the value in the prompt it should be updated in the sysctl.conf file.
- name: shmmax
prompt: " Please enter the value for kernel.shmmax "
private: false
- name: Set some kernel parameters
lineinfile:
dest: /etc/sysctl.conf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^kernel.shmmax', line: 'kernel.shmmax = {{ shmmax }}' }
error is get is.
TASK [Set some kernel parameters] **********************************************************************************************************************************
fatal: [192.168.1.28]: FAILED! => {"msg": "'kernel' is undefined"}
to retry, use: --limit `enter code here`
Thank you
Best Answer
There is the pause module to prompt for an input inside a task.
For example
gives (abridged)
Notes
Running such code would produce