Commit db245ae0 authored by Aleksey Shirokih's avatar Aleksey Shirokih
Browse files

Deploy writes limits vars to consul

parent 1b7a18ec
......@@ -14,6 +14,8 @@ consul_temp_file: "{{tower_dist_dir}}/{{consul_pkg}}"
consul_temp_unarchive: "/tmp/consul/{{ consul_version }}"
consul_temp_file_checksum: "{{tower_dist_dir}}/{{ consul_version }}_SHA256SUMS"
python_consul_version: 0.7.2
### Paths
consul_bin_path: "/bin"
consul_data_path: "/var/consul"
......
......@@ -7,6 +7,7 @@
vars_files:
- "../../vars/main.yml"
- "../../vars/{{ ansible_distribution }}.yml"
- "vars/{{ ansible_distribution }}.yml"
roles:
- role: consul
tags:
......
- name: Install python-consul
pip:
name: "python-consul=={{python_consul_version}}"
virtualenv: "{{consul_control_venv}}"
environment:
https_proxy: "{{http_proxy}}"
tags:
- requirements
......@@ -36,6 +36,11 @@
tags:
- requirements
- name: Install consul python bindings
import_tasks: control.yml
tags:
- requirements
- name: Consul config
import_tasks: config.yml
tags:
......
---
- name: Install CentOS consul depends
yum:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- python-virtualenv
environment:
https_proxy: "{{ http_proxy }}"
http_proxy: "{{ http_proxy }}"
tags:
- requirements
- name: systemd script
template:
src: consul_systemd.service.j2
......
---
- name: Install Debian consul depends
apt:
name: "{{item}}"
update_cache: yes
cache_valid_time: "{{apt_cache_valid_time | default (3600)}}"
with_items:
- python-virtualenv
environment:
https_proxy: "{{http_proxy}}"
http_proxy: "{{http_proxy}}"
tags:
- requirements
- name: systemd script
template:
src: consul_systemd.service.j2
......
---
- name: Install FreeBSD system packages
pkgng:
name: "{{item}}"
state: present
with_items:
- py27-virtualenv
tags:
- requirements
- name: BSD init script
template:
src: consul_bsdinit.j2
......
---
- name: Install RedHat consul depends
yum:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- python-virtualenv
environment:
https_proxy: "{{ http_proxy }}"
http_proxy: "{{ http_proxy }}"
tags:
- requirements
- name: systemd script
template:
src: consul_systemd.service.j2
......
---
- name: Install Debian consul depends
apt:
name: "{{item}}"
update_cache: yes
cache_valid_time: "{{apt_cache_valid_time | default (3600)}}"
with_items:
- python-virtualenv
environment:
https_proxy: "{{http_proxy}}"
http_proxy: "{{http_proxy}}"
tags:
- requirements
- name: systemd script
template:
src: consul_systemd.service.j2
......
---
- name: import path to control repo
include_vars: "vars/{{ ansible_distribution }}.yml"
# https://github.com/ansible/ansible/issues/18665#issuecomment-350144774
- name: Ansible full of bugs
set_fact:
ansibe_correct_python: "{{ansible_python_interpreter}}"
ansible_python_interpreter: "{{consul_control_python}}"
- name: Register a key/value pair for {{consul_service_key}}
consul_kv:
key: "{{consul_service_key}}"
value: "{{consul_service_value}}"
- name: Ansible full of bugs 2
set_fact:
ansible_python_interpreter: "{{ansibe_correct_python}}"
\ No newline at end of file
---
- name: import path to control repo
include_vars: "vars/{{ ansible_distribution }}.yml"
# https://github.com/ansible/ansible/issues/18665#issuecomment-350144774
- name: Ansible full of bugs
set_fact:
ansibe_correct_python: "{{ansible_python_interpreter}}"
ansible_python_interpreter: "{{consul_control_python}}"
# Read default value.
- name: Read key/value pair for key {{consul_service_key}}
consul_kv:
......@@ -32,3 +41,6 @@
#token: "{{consul_service_token}}"
when: consul_key_response.data.Value
- name: Ansible full of bugs 2
set_fact:
ansible_python_interpreter: "{{ansibe_correct_python}}"
\ No newline at end of file
......@@ -5,10 +5,6 @@ key "" {
key "noc/" {
policy = "write"
}
key "noc/private/" {
# Deny access to the dir "noc/private"
policy = "deny"
}
# Default all services to allow registration. Also permits all
# services to be discovered.
......
# CentOS settings
---
consul_control_venv: /opt/pyconsul
consul_control_python: "{{consul_control_venv}}/bin/python"
\ No newline at end of file
# Debian settings
---
consul_control_venv: /opt/pyconsul
consul_control_python: "{{consul_control_venv}}/bin/python"
\ No newline at end of file
# FreeBSD settings
---
consul_control_venv: /usr/local/pyconsul
consul_control_python: "{{consul_control_venv}}/bin/python"
\ No newline at end of file
# RHEL settings
---
consul_control_venv: /opt/pyconsul
consul_control_python: "{{consul_control_venv}}/bin/python"
\ No newline at end of file
# Ubuntu settings
---
consul_control_venv: /opt/pyconsul
consul_control_python: "{{consul_control_venv}}/bin/python"
\ No newline at end of file
Supports Markdown
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