Commit cb53c7b6 by Bilal

adding appneta role

parent 925ec561
- name: Deploy appneta
hosts: all
sudo: True
gather_facts: True
vars:
NGINX_APT_REPO: "{{ appneta_apt_repo }}"
roles:
- appneta
- nginx
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role appneta
#
#
# vars are namespaced with the module name.
#
appneta_role_name: appneta
USE_STATIC_CONFIG: false
apt_server: "apt.appneta.com"
config_server: "config.tv.appneta.com"
skip_certs: true
ACCESS_KEY: "eb3e9f99-f37e-4f66-b87b-cae73313ad9c"
install_sequencer: true
appneta_apt_repo: "deb http://{{ apt_server }}/{{ ACCESS_KEY }} {{ ansible_distribution_release }} main"
#
# OS packages
#
nginx_extra_pkgs:
- nginx-extras
- nginx-light
appneta_debian_pkgs:
- liboboe0
- liboboe-dev
- tracelyzer
appneta_redhat_pkgs: []
---
- name: restart nginx
service: name=nginx state=restarted
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Role includes for role appneta
#
# Example:
#
# dependencies:
# - {
# role: my_role
# my_role_var0: "foo"
# my_role_var1: "bar"
# }
dependencies:
- common
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Tasks for role appneta
#
# Overview:
#
#
# Dependencies:
#
#
# Example play:
#
- name: write static config in case of static IPs
lineinfile:
dest: /etc/default/tracelyzer
regexp: ^STATIC_IP=
line: "STATIC_IP=YES"
state: present
create: yes
when: USE_STATIC_CONFIG
- name: change config in case of non-static IPs
lineinfile:
dest: /etc/default/tracelyzer
regexp: ^STATIC_IP=
line: "STATIC_IP=NO"
state: present
create: yes
when: not USE_STATIC_CONFIG
- name: set facts according to static config
set_fact:
apt_server: "apt-static.appneta.com"
config_server: "config-static.appneta.com"
when: USE_STATIC_CONFIG
- name: install certificates
apt:
name: ca-certificates
state: latest
force: yes
when: not skip_certs
- name: create appneta sources.list
apt_repository:
repo: "{{ appneta_apt_repo }}"
- name: adding AppNeta package signature public key to system list
apt_key:
url: https://{{ apt_server }}/appneta-apt-key.pub
state: present
- name: adding key to tracelyzer conf
lineinfile:
dest: /etc/tracelytics.conf
line: "tracelyzer.access_key={{ ACCESS_KEY }}"
state: present
create: yes
- name: install common library and headers
apt: >
pkg={{ item }}
force=yes
with_items: appneta_debian_pkgs
- name: install appneta-sequencer
apt:
name: appneta-sequencer
state: present
force: yes
when: install_sequencer
- name: Start appneta-sequencer
service:
name: appneta-sequencer
state: started
when: install_sequencer
#- name: Install nginx agent
# apt:
# name: nginx
# state: present
#
#- name: Install nginx light and nginx extras
# apt: pkg={{ item }} state=present
# notify: restart nginx
# with_items: nginx_extra_pkgs
#
#- name: Install oboe
# pip:
# name: oboe
# state: present
#
#- name: Add greenlet instrumentation
# pip:
# extra_args: '-i https://pypi.appneta.com'
# name: greenlet
# version: 0.4.5-oboe1
# state: present
#
#- name: Add tornado instrumentation
# pip:
# extra_args: '-i https://pypi.appneta.com'
# name: tornado
# version: 2.3-oboe3
# state: present
#
#- name: Add ruby instrumentaion
# gem:
# name: traceview
# state: present
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