Skip to content

Commit

Permalink
Merge pull request #27 from eapugo/fix_rhel_logging
Browse files Browse the repository at this point in the history
added rhel logging and updated vagrant test for rhel support
  • Loading branch information
griggheo authored Sep 13, 2016
2 parents 19a146e + b86f458 commit 7533e50
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 3 deletions.
13 changes: 11 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

Vagrant.configure(2) do |config|

config.vm.box = "ubuntu/trusty64"

# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
Expand All @@ -14,11 +12,22 @@ Vagrant.configure(2) do |config|
# end

config.vm.define "test" do |test|
test.vm.box = "ubuntu/trusty64"
test.vm.hostname = "test"
test.vm.provision "ansible" do |ansible|
ansible.playbook = "test.yml"
ansible.verbose = 'vv'
ansible.become = true
end
end

config.vm.define "test02", autostart: false do |test02|
test02.vm.box = "centos/7"
test02.vm.hostname = "testrhel"
test02.vm.provision "ansible" do |ansible|
ansible.playbook = "testrhel.yml"
ansible.verbose = 'vv'
ansible.sudo = true
end
end
end
5 changes: 5 additions & 0 deletions templates/consul-template.cfg.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
consul = "{{ consul_template_consul_server }}:{{ consul_template_consul_port }}"

{% if consul_template_log_level %}
log_level = "{{consul_template_log_level}}"
{% endif %}

{% if consul_template_templates %}
{% for template in consul_template_templates %}

Expand Down
2 changes: 1 addition & 1 deletion templates/consul-template.service.systemd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Description=consul-template

[Service]
ExecStart={{ consul_template_home }}/bin/{{ consul_template_binary }} -config={{ consul_template_home }}/config/{{ consul_template_config_file }}
ExecStart=/bin/sh -c "{{ consul_template_home }}/bin/{{ consul_template_binary }} -config={{ consul_template_home }}/config/{{ consul_template_config_file }} >> {{ consul_template_log_file }} 2>&1"

[Install]
WantedBy=multi-user.target
29 changes: 29 additions & 0 deletions testrhel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---

- hosts: all
become: yes
pre_tasks:
- name: epel-repo
yum:
name: epel-release
state: present
roles:
- savagegus.consul
- ansible-consul-template


vars:
# Consul
consul_version: 0.6.0
consul_is_server: true
consul_bootstrap_expect: 1
consul_use_systemd: true
consul_install_nginx: false

# Consul Template
consul_template_use_upstart: false
consul_template_use_systemd: true
consul_template_template_files:
- {src: ./test/fixture/template/consul.ctmpl}
consul_template_templates:
- {name: "consul.ctmpl", dest: "/tmp/service-consul", cmd: "touch /tmp/service-consul-updated"}

0 comments on commit 7533e50

Please sign in to comment.