You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
905 B
34 lines
905 B
---
|
|
- name: Create {{ conf_directory }} directory if not existing
|
|
file:
|
|
path: "{{ conf_directory }}"
|
|
state: directory
|
|
when: conf_directory is defined
|
|
become: yes
|
|
become_user: "{{ splunk_user }}"
|
|
|
|
- name: Create {{ conf_file }} if not existing
|
|
copy:
|
|
dest: "{{ conf_directory }}/{{ conf_file }}"
|
|
mode: u=rw,g=,o=
|
|
owner: "{{ splunk_user }}"
|
|
group: "{{ splunk_group }}"
|
|
content: ""
|
|
force: no
|
|
become: yes
|
|
become_user: "{{ privileged_user }}"
|
|
|
|
- name: "Set options in {{ stanza_name }}"
|
|
ini_file:
|
|
path: "{{ conf_directory }}/{{ conf_file }}"
|
|
section: "{{ stanza_name }}"
|
|
option: "{{ stanza_setting.key }}"
|
|
value: "{{ stanza_setting.value }}"
|
|
allow_no_value: True
|
|
state: present
|
|
with_dict: "{{ conf_stanzas }}"
|
|
loop_control:
|
|
loop_var: stanza_setting
|
|
become: yes
|
|
become_user: "{{ splunk_user }}"
|