-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gibbsoft-feature_recursors'
- Loading branch information
Showing
13 changed files
with
127 additions
and
64 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 |
---|---|---|
|
@@ -57,3 +57,6 @@ docs/_build/ | |
|
||
.kitchen/ | ||
roles/* | ||
|
||
# Developing on OSX | ||
.DS_Store |
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 |
---|---|---|
|
@@ -67,6 +67,3 @@ DEPENDENCIES | |
kitchen-vagrant | ||
serverspec | ||
test-kitchen | ||
|
||
BUNDLED WITH | ||
1.10.5 |
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,74 +1,85 @@ | ||
- name: update apt | ||
apt: > | ||
update_cache=yes | ||
cache_valid_time=3600 | ||
apt: | ||
update_cache: yes | ||
cache_valid_time: 3600 | ||
when: ansible_os_family == "Debian" | ||
|
||
- name: install deps (Ubuntu) | ||
apt: > | ||
pkg=dnsmasq | ||
state=installed | ||
apt: | ||
pkg: dnsmasq | ||
state: installed | ||
when: ansible_os_family == "Debian" | ||
|
||
- name: install deps (RHEL) | ||
yum: > | ||
name=dnsmasq | ||
state=installed | ||
yum: | ||
name: dnsmasq | ||
state: installed | ||
when: ansible_os_family == "RedHat" | ||
|
||
- name: ensure configure directory | ||
file: > | ||
dest=/etc/dnsmasq.d | ||
state=directory | ||
file: | ||
dest: /etc/dnsmasq.d | ||
state: directory | ||
|
||
- name: ensure dnsmasq configuration | ||
replace: > | ||
dest=/etc/dnsmasq.conf | ||
regexp="^#conf-dir=/etc/dnsmasq.d" | ||
replace="conf-dir=/etc/dnsmasq.d" | ||
lineinfile: | ||
dest: "/etc/dnsmasq.conf" | ||
regexp: "^conf-dir=" | ||
line: "conf-dir=/etc/dnsmasq.d" | ||
state: present | ||
|
||
- name: ensure configure directory | ||
file: > | ||
dest=/etc/resolvconf/resolv.conf.d | ||
state=directory | ||
file: | ||
dest: /etc/resolvconf/resolv.conf.d | ||
state: directory | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: add local dns lookup | ||
lineinfile: > | ||
line="nameserver 127.0.0.1" | ||
insertbefore=BOF | ||
state=present | ||
dest="/etc/resolvconf/resolv.conf.d/consul" | ||
create=yes | ||
lineinfile: | ||
insertbefore: BOF | ||
state: present | ||
line: "nameserver 127.0.0.1" | ||
dest: "/etc/resolvconf/resolv.conf.d/consul" | ||
create: yes | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: configure dnsmasq to listen on loopback interface | ||
replace: > | ||
dest=/etc/dnsmasq.conf | ||
regexp="^#interface=" | ||
replace="interface=lo" | ||
- name: configure dnsmasq to listen on docker0 interface | ||
lineinfile: > | ||
dest=/etc/dnsmasq.conf | ||
insertafter="^interface=lo" | ||
line="interface=docker0" | ||
- name: configure dnsmasq to disable DHCP and TFTP | ||
replace: > | ||
dest=/etc/dnsmasq.conf | ||
regexp="^#no-dhcp-interface=" | ||
replace="no-dhcp-interface=lo" | ||
- name: configure dnsmasq to listen on interface(s) | ||
lineinfile: | ||
regexp: "^interface={{ item }}" | ||
line: "interface={{ item }}" | ||
dest: /etc/dnsmasq.conf | ||
with_items: | ||
"{{ consul_dnsmasq.listen_interface }}" | ||
|
||
- name: configure dnsmasq to disable DHCP and TFTP | ||
lineinfile: > | ||
dest=/etc/dnsmasq.conf | ||
insertafter="^no-dhcp-interface=lo" | ||
line="no-dhcp-interface=docker0" | ||
lineinfile: | ||
regexp: "^no-dhcp-interface={{ item }}" | ||
line: "no-dhcp-interface={{ item }}" | ||
dest: /etc/dnsmasq.conf | ||
with_items: | ||
"{{ consul_dnsmasq.no_dhcp_interface }}" | ||
|
||
- name: configure dnsmasq to delegate all Consul DNS requests to the Consul DNS port | ||
copy: > | ||
content='server=/{{ consul_domain }}/{{ consul_client_address }}#{{ consul_port_dns }}' | ||
dest=/etc/dnsmasq.d/10-consul | ||
copy: | ||
content: 'server=/{{ consul_domain }}/{{ consul_client_address }}#{{ consul_port_dns }}' | ||
dest: /etc/dnsmasq.d/10-consul | ||
notify: | ||
- restart dnsmasq | ||
- pause: minutes=1 | ||
|
||
- name: create alternate upstream servers file for dnsmasq | ||
template: | ||
src: "{{ consul_dnsmasq_upstream_template }}" | ||
dest: /etc/resolv_dnsmasq.conf | ||
when: "{{ (consul_dnsmasq.upstream_servers is defined) and consul_dnsmasq.upstream_servers }}" | ||
notify: | ||
- restart dnsmasq | ||
|
||
- name: configure dnsmasq to use alternate upstream servers file | ||
copy: | ||
content: "resolv-file=/etc/resolv_dnsmasq.conf" | ||
dest: /etc/dnsmasq.d/20-upstream-servers | ||
when: "{{ (consul_dnsmasq.upstream_servers is defined) and consul_dnsmasq.upstream_servers }}" | ||
notify: | ||
- restart dnsmasq | ||
|
||
- pause: minutes=1 |
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,13 +1,16 @@ | ||
[Unit] | ||
Description=Consul Agent | ||
Wants=network-online.target | ||
Requires=network-online.target | ||
After=network-online.target | ||
|
||
[Service] | ||
Environment="GOMAXPROCS=`nproc`" | ||
Restart=on-failure | ||
User={{ consul_user }} | ||
Group={{ consul_group }} | ||
ExecStart=/bin/sh -c '{{ consul_home }}/bin/consul agent -config-dir {{ consul_config_dir }} -config-file={{ consul_config_file }} >> {{ consul_log_file }} 2>&1' | ||
ExecReload=/bin/kill -HUP $MAINPID | ||
KillSignal=SIGINT | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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,2 @@ | ||
{% for host in consul_dnsmasq.upstream_servers | difference(ansible_all_ipv4_addresses) %}nameserver {{host}} | ||
{% endfor %} |
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
test/integration/atlas_configuration/serverspec/spec_helper.rb
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,2 @@ | ||
require 'serverspec' | ||
set :backend, :exec |
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
require 'serverspec' | ||
set :backend, :exec |
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 was deleted.
Oops, something went wrong.
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,2 @@ | ||
require 'serverspec' | ||
set :backend, :exec |