Bläddra i källkod

Add Amazon Linux AMI client side support. (#63)

Alejandro Bednarik 9 år sedan
förälder
incheckning
970dbb293d
6 ändrade filer med 77 tillägg och 0 borttagningar
  1. 1 0
      README.md
  2. 16 0
      tasks/Amazon/dashboard.yml
  3. 21 0
      tasks/Amazon/main.yml
  4. 13 0
      tasks/Amazon/rabbit.yml
  5. 17 0
      tasks/Amazon/redis.yml
  6. 9 0
      vars/Amazon.yml

+ 1 - 0
README.md

@@ -30,6 +30,7 @@ This role requires:
 
 - [SmartOS - base-64 15.x.x](https://docs.joyent.com/images/smartos/base#version-15xx)
 - [CentOS - 7](https://wiki.centos.org/Manuals/ReleaseNotes/CentOS7)
+- [Amazon Linux](https://aws.amazon.com/amazon-linux-ami/) - only client side support is tested
 - [Debian - 8 (Jessie)](https://wiki.debian.org/DebianJessie)
 - [Ubuntu - 15.04 (Vivid Vervet)](http://releases.ubuntu.com/15.04/)
 - [FreeBSD - 10.2 (64-bit only)](https://www.freebsd.org/releases/10.2R/relnotes.html)

+ 16 - 0
tasks/Amazon/dashboard.yml

@@ -0,0 +1,16 @@
+---
+# tasks/Amazon/dashboard.yml: Deployment of the Uchiwa dashboard
+# Specific to CentOS
+
+  - include_vars: "{{ ansible_distribution }}.yml"
+
+  - name: Ensure Uchiwa is installed
+    yum:
+      name: "{{ uchiwa_pkg_download_url }}"
+      state: present
+
+  - name: Deploy Uchiwa config
+    template:
+      src: uchiwa_config.json.j2
+      dest: "{{ sensu_config_path }}/uchiwa.json"
+    notify: restart uchiwa service

+ 21 - 0
tasks/Amazon/main.yml

@@ -0,0 +1,21 @@
+---
+# tasks/Amazon/main.yml: CentOS specific set-up
+# This takes care of base prerequisites for Amazon Linux AMI
+
+  - include_vars: "{{ ansible_distribution }}.yml"
+
+  - name: Ensure the Sensu Core Yum repo is present
+    copy:
+      dest: /etc/yum.repos.d/sensu.repo
+      content: |
+        [sensu]
+        name=sensu
+        baseurl=http://repositories.sensuapp.org/yum/$basearch/
+        gpgcheck=0
+        enabled=1
+      owner: root
+      group: root
+      mode: 0644
+
+  - name: Ensure Sensu is installed
+    yum: name={{ sensu_package }} state={{ sensu_pkg_state }}

+ 13 - 0
tasks/Amazon/rabbit.yml

@@ -0,0 +1,13 @@
+---
+# tasks/Amazon/rabbit.yml: Deploy RabbitMQ
+# Specific to Amazon Linux AMI
+
+  - include_vars: "{{ ansible_distribution }}.yml"
+
+  - name: Ensure Erlang & RabbitMQ are installed
+    yum:
+      name:
+        - erlang
+        - rabbitmq-server
+      state: present
+      enablerepo: epel

+ 17 - 0
tasks/Amazon/redis.yml

@@ -0,0 +1,17 @@
+---
+# tasks/Amazon/redis.yml: Deploy redis
+# Specific to Amazon Linux AMI
+
+  - include_vars: "{{ ansible_distribution }}.yml"
+
+  - name: Ensure redis is installed
+    yum:
+      name: "{{ redis_pkg_name }}"
+      state: "{{ redis_pkg_state }}"
+      enablerepo: epel
+
+  - name: Ensure redis binds to accessible IP
+    lineinfile:
+      dest: /etc/redis.conf
+      regexp: '^bind'
+      line: 'bind 0.0.0.0'

+ 9 - 0
vars/Amazon.yml

@@ -0,0 +1,9 @@
+---
+# vars/Amazon.yml: Variables for Amazon Linux AMI
+# Defaults are defined in vars/default.yml
+
+# Sensu/Uchiwa user/group/service properties
+sensu_user_name: root
+sensu_group_name: root
+uchiwa_pkg_version: 0.14.2-1
+uchiwa_pkg_download_url: http://dl.bintray.com/palourde/uchiwa/uchiwa-{{ uchiwa_pkg_version }}.x86_64.rpm