Skip to content
Snippets Groups Projects
Commit 01e731af authored by Benguria Elguezabal, Gorka's avatar Benguria Elguezabal, Gorka
Browse files

adjusted version

parent 76fb3507
No related branches found
No related tags found
No related merge requests found
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html
[defaults]
host_key_checking = False
inventory = {{CWD}}/hosts.yaml ; This points to the file that lists your hosts
remote_user = esilab
deprecation_warnings=False ; to remove the python version depretation warning
display_skipped_hosts = no
\ No newline at end of file
......@@ -5,4 +5,4 @@ roles:
- name: dj-wasabi.telegraf
src: https://github.com/dj-wasabi/ansible-telegraf.git
scm: git
version: 0.13.2
version: 0.14.0
---
input:
- INFLUXDB_BUCKET
- INFLUXDB_TOKEN
- INFLUXDB_ORG
- INFLUXDB_ADDR
- DEPLOYMENT_ID
# - instance_ip_vm1
# - instance_server_private_key_user1
output: []
engine: ansible
...
\ No newline at end of file
all:
hosts:
localhost:
ansible_connection: local
#!/bin/bash
set -e
SCRIPT_DIR=$(dirname "$0")
# to avoid the being run in a world writable directory we explicitly assign the ANSIBLE_CONFIG variable
if [[ -f ./ansible.cfg ]]
then
export ANSIBLE_CONFIG=./ansible.cfg
else
if [[ -f $SCRIPT_DIR/ansible.cfg ]]
then
export ANSIBLE_CONFIG=$SCRIPT_DIR/ansible.cfg
fi
fi
if [[ -z "$ANSIBLE_CONFIG" ]]
then
echo ANSIBLE_CONFIG to assigned using default https://docs.ansible.com/ansible/latest/reference_appendices/config.html
else
echo ANSIBLE_CONFIG=$ANSIBLE_CONFIG
fi
if [[ -z "$1" ]]
then
# echo without params
echo ansible-playbook $SCRIPT_DIR/site_requirements.yaml
ansible-playbook $SCRIPT_DIR/site_requirements.yaml
else
# echo with params
echo ansible-playbook $SCRIPT_DIR/site_requirements.yaml --extra-vars "$1"
ansible-playbook $SCRIPT_DIR/site_requirements.yaml --extra-vars "$1"
fi
[servers_for_piacere_monitoring]
demo-server-for-agents-at-iem
[servers_for_piacere_monitoring:vars]
ansible_connection=ssh
ansible_user=ubuntu
ansible_ssh_private_key_file=ssh_key
[docker]
localhost
\ No newline at end of file
---
- hosts: localhost
tasks:
- name: print disclamer
debug:
msg: this can also be done with "ansible-galaxy install -r requirements"
- name: install telegraf from galaxy
community.general.ansible_galaxy_install:
type: role
requirements_file: ansible_requirements.yml
- hosts: all
pre_tasks:
- name: Check parameters
......@@ -23,8 +34,9 @@
name: gnupg
state: present
become: true
vars_files:
- vars/main.yaml
roles:
- dj-wasabi.telegraf
tasks:
- name: Install telegraf
ansible.builtin.include_role:
name: dj-wasabi.telegraf
#!/bin/bash
set -e
SCRIPT_DIR=$(dirname "$0")
# to avoid the being run in a world writable directory we explicitly assign the ANSIBLE_CONFIG variable
if [[ -f ./ansible.cfg ]]
then
export ANSIBLE_CONFIG=./ansible.cfg
else
if [[ -f $SCRIPT_DIR/ansible.cfg ]]
then
export ANSIBLE_CONFIG=$SCRIPT_DIR/ansible.cfg
fi
fi
if [[ -z "$ANSIBLE_CONFIG" ]]
then
echo ANSIBLE_CONFIG to assigned using default https://docs.ansible.com/ansible/latest/reference_appendices/config.html
else
echo ANSIBLE_CONFIG=$ANSIBLE_CONFIG
fi
if [[ -z "$1" ]]
then
# echo without params
echo ansible-playbook $SCRIPT_DIR/site.yaml
ansible-playbook $SCRIPT_DIR/site.yaml
else
# echo with params
echo ansible-playbook $SCRIPT_DIR/site.yaml --extra-vars "$1"
ansible-playbook $SCRIPT_DIR/site.yaml --extra-vars "$1"
fi
- hosts: localhost
tasks:
- name: print disclamer
debug:
msg: this can also be done with "ansible-galaxy install -r requirements"
- name: install telegraf from galaxy
community.general.ansible_galaxy_install:
type: role
requirements_file: ansible_requirements.yml
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA1FrTNE42EgZr9WJNMtvpKFHYhPUJ4lzEp83EM0jYY3TyjmIe
ThMuqMLAHCk22fl4a8PttucggJ5ZWKhcJh623/y8AybJcmqZgq9a41Q609dmirf0
7frCl+6zL8Mqy2Le2BD4eRADcq11s8r8Ys6J+E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lVKozz6lzn1AoGALVwmaoS6DtRwcwuzwZLUkR7TNhIAujgMKHN1
DyhDOR+4tfpYI39hH+dfmnM83wTrfsKozUawkAepqToflySMo72X/2Zl6VXpMPVT
xjGyo/h87fRRvI/asxblG9702luLcTW6XjrEQBmhn0uVWtc5T15CsIWqxb/y1FPx
BVp+hcMCgYAlJXbjzjbbDoIOCsXPSPe9voBL8zVwp0aNuvQcuB/vCt1n1c1DWuPr
AGMy/fRwY0Znag+ODMuulm7RgXUQy6ifJHiz9cKVGg/mGifaJSjgC+1AI9HFlij3
asM5CueU0gK974rDxQkwmIWpRH57+kf6s8tGDrPPvqX9S4p3oxFlTw==
-----END RSA PRIVATE KEY-----
pma_deployment_id: "{{ lookup('env', 'DEPLOYMENT_ID' ) }}"
pma_influxdb_bucket: "{{ lookup('env', 'INFLUXDB_BUCKET' ) }}"
pma_influxdb_token: "{{ lookup('env', 'INFLUXDB_TOKEN' ) }}"
pma_influxdb_org: "{{ lookup('env', 'INFLUXDB_ORG' ) }}"
pma_influxdb_addr: "{{ lookup('env', 'INFLUXDB_ADDR' ) }}"
telegraf_agent_package_state: latest
telegraf_agent_output:
......@@ -19,5 +25,3 @@ telegraf_plugins_default:
- plugin: processes
- plugin: disk
- plugin: net
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment