-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from UKCloud/feature/addMonitoring
Feature/add monitoring
- Loading branch information
Showing
19 changed files
with
115 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
ansible-playbook --private-key ../id_rsa_jenkins -i openshift-ansible-hosts bastion.yml | ||
ansible-playbook --private-key ../id_rsa_jenkins -i openshift-ansible-hosts site.yml | ||
ansible-playbook --private-key ~/id_rsa_jenkins -i openshift-ansible-hosts bastion.yml | ||
ansible-playbook --private-key ~/id_rsa_jenkins -i openshift-ansible-hosts site.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- hosts: all, localhost | ||
roles: | ||
- name: monitoring | ||
when: setupMonitoring == True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
search {{ env_details.localDomainSuffix }} localdomain | ||
search {{ localDomainSuffix }} localdomain | ||
{% for hostname in groups.dns %} | ||
nameserver {{ hostvars[hostname].ansible_default_ipv4.address }} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
$ORIGIN {{ env_details.localDomainSuffix }}. | ||
$ORIGIN {{ localDomainSuffix }}. | ||
$TTL 60s | ||
@ IN SOA dns1.{{ env_details.localDomainSuffix }}. hostmaster.{{ env_details.localDomainSuffix }}. ( | ||
@ IN SOA dns1.{{ localDomainSuffix }}. hostmaster.{{ localDomainSuffix }}. ( | ||
2001062501 ; serial | ||
21600 ; refresh after 6 hours | ||
3600 ; retry after 1 hour | ||
604800 ; expire after 1 week | ||
86400 ) ; minimum TTL of 1 day | ||
|
||
|
||
IN NS dns1.{{ env_details.localDomainSuffix }}. | ||
IN NS dns2.{{ env_details.localDomainSuffix }}. | ||
IN NS dns1.{{ localDomainSuffix }}. | ||
IN NS dns2.{{ localDomainSuffix }}. | ||
|
||
{% set count = 1 %} | ||
{% for hostname in groups.dns %} | ||
dns{{ count }} IN A {{ hostvars[hostname].ansible_default_ipv4.address }} | ||
{% set count = count + 1 %} | ||
{% endfor %} | ||
|
||
{% for ip, hostname in env_details.haproxy_details.iteritems() %} | ||
{% for ip, hostname in haproxy_details.iteritems() %} | ||
{{ hostname }}. IN A {{ ip }} | ||
{% endfor %} | ||
|
||
{% for ip, hostname in env_details.worker_details.iteritems() %} | ||
{% for ip, hostname in worker_details.iteritems() %} | ||
{{ hostname }}. IN A {{ ip }} | ||
{% endfor %} | ||
|
||
{% for ip, hostname in env_details.master_details.iteritems() %} | ||
{% for ip, hostname in master_details.iteritems() %} | ||
{{ hostname }}. IN A {{ ip }} | ||
{% endfor %} | ||
|
||
console IN A {{ env_details.haproxy_vip }} | ||
console IN A {{ haproxy_vip }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
- name: Enable extras repo | ||
command: subscription-manager repos --enable=rhel-7-server-extras-rpms | ||
when: inventory_hostname in groups.loadbalancers | ||
- name: Install docker | ||
yum: | ||
name: docker | ||
state: latest | ||
when: inventory_hostname == 'localhost' or inventory_hostname in groups.loadbalancers | ||
become: yes | ||
become_method: sudo | ||
- name: Enable and start docker daemon service | ||
systemd: | ||
name: docker | ||
state: started | ||
enabled: yes | ||
daemon_reload: yes | ||
when: inventory_hostname == 'localhost' or inventory_hostname in groups.loadbalancers | ||
become: yes | ||
become_method: sudo | ||
- name: Create a password for zabbix db | ||
shell: openssl passwd -in /dev/urandom | head -1 | ||
register: zabbixDbPassword | ||
when: inventory_hostname == 'localhost' | ||
- name: create persistent storage volume for zabbix | ||
command: docker run -d -v /var/lib/mysql --name zabbix-db-storage busybox:latest | ||
when: inventory_hostname == 'localhost' | ||
become: yes | ||
become_method: sudo | ||
args: | ||
creates: .zabbix_persistence_created | ||
- name: install zabbix db | ||
command: docker run -d --name zabbix-db -v /backups:/backups -v /etc/localtime:/etc/localtime:ro --volumes-from zabbix-db-storage --env="MARIADB_USER=zabbix" --env="MARIADB_PASS={{ zabbixDbPassword.stdout }}" monitoringartist/zabbix-db-mariadb | ||
when: inventory_hostname == 'localhost' | ||
become: yes | ||
become_method: sudo | ||
args: | ||
creates: .zabbix_db_created | ||
- name: install zabbix server | ||
command: docker run -d --name zabbix -p 80:80 -p 10051:10051 -v /etc/localtime:/etc/localtime:ro --link zabbix-db:zabbix.db --env="ZS_DBHost=zabbix.db" --env="ZS_DBUser=zabbix" --env="ZS_DBPassword={{ zabbixDbPassword.stdout }}" monitoringartist/zabbix-xxl:latest | ||
when: inventory_hostname == 'localhost' | ||
become: yes | ||
become_method: sudo | ||
args: | ||
creates: .zabbix_server_created | ||
- name: install zabbix agents | ||
command: docker run --name=dockbix-agent-xxl --net=host --privileged -v /:/rootfs -v /var/run:/var/run --restart unless-stopped -e "ZA_Server=10.2.1.101" -e "ZA_ServerActive=10.2.1.101" -e 'ZA_Hostname={{ inventory_hostname }}' -d monitoringartist/dockbix-agent-xxl-limited:latest | ||
when: inventory_hostname != 'localhost' | ||
become: yes | ||
become_method: sudo | ||
args: | ||
creates: .zabbix_agent_setup | ||
- name: Setup iptables on nodes | ||
command: iptables -I INPUT -p tcp -s 10.2.1.101 --dport 10050 -j ACCEPT | ||
when: inventory_hostname in groups.nodes | ||
become: yes | ||
become_method: sudo | ||
- name: Setup firewall for zabbix agent on loadbalancers | ||
firewalld: | ||
port: 10050/tcp | ||
immediate: true | ||
permanent: true | ||
zone: public | ||
state: enabled | ||
when: inventory_hostname in groups.loadbalancers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
- include: loadbalancers.yml | ||
- include: dns.yml | ||
- include: all.yml | ||
- include: openshift.yml | ||
- include: openshift.yml | ||
- include: monitoring.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters