0

i have a simple ansible playbook that sets two ini variables.

- name: set Apache timeout
  community.general.ini_file:
    path: /etc/apache2/apache2.conf
    section: null
    option: Timeout
    value: 900
    state: present
    exclusive: true

- name: set Proxy timeout
  community.general.ini_file:
    path: /etc/apache2/apache2.conf
    section: null
    option: ProxyTimeout
    value: 900
    state: present
    exclusive: true

Problem is that it sets them like

Timeout = 900
ProxyTimeout = 900

But i need them to be set like, WITHOUT "="

Timeout 900
ProxyTimeout 900
Aidvi
  • 46
  • 5

1 Answers1

1

This works if anyone is curious

- name: set Timeout
  ansible.builtin.lineinfile:
    path: /etc/apache2/apache2.conf
    regexp: '^Timeout '
    insertafter: '^#Timeout '
    line: Timeout 900

- name: set Proxy timeout
  ansible.builtin.lineinfile:
    path: /etc/apache2/apache2.conf
    regexp: '^ProxyTimeout '
    insertafter: '^Timeout '
    line: ProxyTimeout 900
Aidvi
  • 46
  • 5