Ansible Module lineinfile: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=External= * https://docs.ansible.com/ansible/latest/modules/lineinfile_module.html =Internal= * Ansible Concepts =Example= <syntaxhighlig...")
 
Line 9: Line 9:
=Example=
=Example=


<syntaxhighlight lang='bash'>
<syntaxhighlight lang='yaml'>
- name: "Adjust Java version to {{ jdk.version }}"
  lineinfile:
    path: "{{ settings_path }}/settings.conf"
    regexp: '^JAVA_VERSION='
    line: "JAVA_VERSION={{ jdk.version }}"
</syntaxhighlight>
</syntaxhighlight>

Revision as of 03:20, 19 January 2021

External

Internal

Example

- name: "Adjust Java version to {{ jdk.version }}"
  lineinfile:
    path: "{{ settings_path }}/settings.conf"
    regexp: '^JAVA_VERSION='
    line: "JAVA_VERSION={{ jdk.version }}"