-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup-server.yml
54 lines (54 loc) · 2.15 KB
/
setup-server.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
- hosts: monitored-servers
gather_facts: False
become: yes
vars_files:
- vars/setup-server.yml
pre_tasks:
- include_tasks: tasks/python3-ubuntu.yml
- name: Setup Ansible
setup:
roles:
- role: ssh
tags:
- ssh
- role: linux-config
tags:
- linux-config
- role: hostname
server_hostname: "{{ server_monitoring_hostname }}"
hostname_from_ec2_Name_tag: "{{ server_monitoring_hostname_from_ec2_Name_tag }}"
when: server_monitoring_set_hostname == true
tags:
- monitoring
- hostname
- role: collectd
collectd_scripts: "{{ server_monitoring_collectd_scripts }}"
collectd_graphite_server_ip: "{{ server_monitoring_graphite_server_ip }}"
collectd_graphite_server_port: "{{ server_monitoring_graphite_server_port }}"
collectd_graphite_server_protocol: "{{ server_monitoring_graphite_server_protocol }}"
collectd_server_mode: true
collectd_server_hostname: "{{ _hostname_to_use if server_monitoring_set_hostname else server_monitoring_hostname }}"
collectd_server_type: "{{ server_monitoring_server_type }}"
collectd_server_owner: "{{ server_monitoring_owner }}"
tags:
- monitoring
- collectd
- role: onaio.monit
monit_setup_mode: True
monit_scripts: "{{ server_monitoring_monit_scripts }} + {{ extra_server_monitoring_monit_scripts | default([]) }}"
tags:
- monitoring
- monit
- role: sre-tooling
tags:
- sre-tooling
- role: fluentd
when: server_monitoring_enable_fluentd is defined and server_monitoring_enable_fluentd == true
tags:
- fluentd
- role: christiangda.amazon_cloudwatch_agent
cwa_conf_json_file_content: "{{ server_monitoring_cwa_conf_json_file_content | default(default_server_monitoring_cwa_conf_json_file_content) }}"
cwa_aws_region: "{{ server_monitoring_aws_region | default(default_server_monitoring_aws_region) }}"
when: (server_monitoring_enable_cwa is defined and server_monitoring_enable_cwa == true) or (placement is defined and placement.availability_zone is defined)
tags:
- cloudwatch