-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from kamigerami/travistest
#11-Add travis.yml CI build testing
- Loading branch information
Showing
9 changed files
with
42 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
sudo: required | ||
env: | ||
- distribution: centos | ||
version: 7 | ||
|
||
language: python | ||
python: "2.7" | ||
|
||
before_install: | ||
# Make sure everything's up to date. | ||
|
||
install: | ||
# Install Ansible. | ||
- pip install ansible | ||
|
||
script: | ||
# We'll add some commands to test the role here. | ||
- ansible-playbook provisioning/site.yml --syntax-check | ||
# Run playbook | ||
- ansible-playbook provisioning/site.yml --connection=local --sudo |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
roles: | ||
- { role: consul } | ||
- { role: docker } | ||
- { role: dockerswarm } |
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,6 +1,5 @@ | ||
--- | ||
- name: restart systemd | ||
sudo: yes | ||
command: systemctl daemon-reload | ||
|
||
- name: restart consul | ||
|
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,3 +1,3 @@ | ||
--- | ||
# Options passed to the docker daemon at start | ||
docker_opts: "" | ||
docker_opts: "-H 0.0.0.0:2375" |
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,8 +1,14 @@ | ||
- name: Swarm create | ||
--- | ||
- name: Swarm pull | ||
docker: | ||
name: swarm_cluster | ||
image: swarm | ||
# pull: always | ||
state: present | ||
# command: create | ||
#register: cluster_id | ||
|
||
- name: Swarm create | ||
command: docker run --rm swarm create | ||
register: cluster_id | ||
when: ansible_fqdn == swarm.cluster | ||
|
||
- name: debug stuff | ||
debug: msg="{{cluster_id.stdout_lines}}" |
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,4 @@ | ||
--- | ||
- name: start swarm agents | ||
command: docker run -d swarm join --addr="{{ansible_eth1.ipv4.address}}":2375 token://"{{ cluster_id }}" | ||
when: "{{ cluster_id}}" is defined |