Commit fa411651 authored by levinericzimmermann's avatar levinericzimmermann Committed by Levin Zimmermann

playbook: Remove Fluentd role

Should be installed via rapid.space panel.
parent b36b42d1
- set_fact:
request_fluentd_python_script_path=/tmp/request-fluentd.py
- name: Solve template to request Fluentd
template:
src: request-fluentd.j2
dest: "{{ request_fluentd_python_script_path }}"
- name: Request Fluentd from SlapOS Master
shell: slapos console "{{ request_fluentd_python_script_path }}"
# Constants
fluentd_software_release_uri = product.fluentd
computer_id = "{{computer_id}}"
fluentd_software_name = "{{fluentd_software_name}}"
fluentd_config = """{{fluentd_config}}"""
# Supplying and requesting
supply(fluentd_software_release_uri, computer_id)
request(
fluentd_software_release_uri,
fluentd_software_name,
filter_kw={"computer_guid": computer_id},
partition_parameter_kw={"conf_text": fluentd_config},
)
......@@ -5,41 +5,3 @@
- name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
pre_tasks:
- name: Set Computer reference
block:
- pause:
prompt: "What is the reference of your computer (COMP-XXXX)?"
register: prompt
- set_fact:
computer_id: "{{ prompt.user_input }}"
- name: Set Fluentd Software Release Name
block:
- pause:
prompt: "What is the name of your Fluentd Software Relase? [Fluentd-Software-Release]"
register: prompt
- set_fact:
fluentd_software_name: "{{ prompt.user_input | default('Fluentd-Software-Release', true) }}"
tasks:
- name: Check if client configuration exists already
stat: path=/root/.slapos/slapos-client.cfg
register: slapos_client_cfg
- name: Configure SlapOS client
block:
- pause:
prompt: "Please enter a token from your SlapOS account."
register: prompt
- set_fact:
slapos_user_token: "{{ prompt.user_input }}"
- name: Configure SlapOS Client
shell: slapos configure client --token {{ slapos_user_token }}
when: slapos_client_cfg.stat.exists == False
......@@ -6,44 +6,3 @@
- name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
vars_prompt:
- name: "streamtool_uri"
prompt: "What is the URL of your Wendelin instance? (e.g. https://softinstXXXX.host.vifib.net)"
private: no
- name: "tag_name"
prompt: "What is your tag name?\nYour tag name must consist of 2 part separated by .(dot). First part is the name of the sensor and must be the same as the reference of the Data Supply. The second part is the type of data (Data Product)."
private: no
default: "sensor_1.sample-environment-raw-data"
- name: "user_name"
prompt: "What is the user name for your Wendelin instance?"
private: no
default: "zope"
- name: "user_password"
prompt: "What is the password for the user of your Wendelin instance?"
private: yes
vars:
fluentd_config: |
<source>
@type forward
port 24224
bind ::0
</source>
<match {{ tag_name }}>
@type wendelin
streamtool_uri {{ streamtool_uri }}/erp5/portal_ingestion_policies/default
user {{ user_name }}
password {{ user_password }}
<buffer>
flush_mode interval
@type file
path fluentd-buffer-file/
flush_interval 1m
</buffer>
roles:
- role: fluentd
......@@ -7,35 +7,5 @@
hosts: 127.0.0.1
connection: local
vars_prompt:
- name: "ipv6_address_iot_gateway"
prompt: "What is the IPv6 address of the host where the data will be send to (IoT Gateway)?"
private: no
- name: "tag_name"
prompt: "What is your tag name?\nYour tag name must consist of 2 part separated by .(dot). First part is the name of the sensor and must be the same as the reference of the Data Supply. The second part is the type of data (Data Product)."
private: no
default: "sensor_1.sample-environment-raw-data"
vars:
fluentd_config: |
<source>
@type exec
tag {{ tag_name }}
command python /usr/local/bin/custom_read_bme280.py
run_interval 1m
<parse>
keys pressure, humidity, temperature
</parse>
</source>
<match {{ tag_name }}>
@type forward
<server>
name myserver1
host {{ ipv6_address_iot_gateway }}
</server>
</match>
roles:
- role: olimex-sensor
- role: fluentd
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment