-
Notifications
You must be signed in to change notification settings - Fork 9
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 #46 from mapuri/ansible
vendor recent changes in contiv/ansible repo
- Loading branch information
Showing
26 changed files
with
247 additions
and
50 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
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
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
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 +1 @@ | ||
NETPLUGIN_ARGS='-docker-plugin -vlan-if {{netplugin_if}} -vtep-ip {{node_addr}}' | ||
NETPLUGIN_ARGS='-plugin-mode {{netplugin_mode}} -vlan-if {{netplugin_if}} -vtep-ip {{node_addr}} -fwd-mode {{fwd_mode}}' |
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
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 @@ | ||
--- | ||
# Role defaults for contiv_scheduler | ||
|
||
scheduler_provider: "native-swarm" # Accepted values: native-swarm, ucp-swarm |
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,7 @@ | ||
--- | ||
# This role contains tasks for configuring and starting the scheduler stacks | ||
# like native-swarm, ucp-swarm, k8s, mesos etc | ||
|
||
dependencies: | ||
- { role: swarm, when: scheduler_provider == "native-swarm" } | ||
- { role: ucp, when: scheduler_provider == "ucp-swarm" } |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
# This role contains tasks for installing test environment packages | ||
|
||
- include: os_agnostic_tasks.yml | ||
tags: | ||
- prebake-for-test | ||
|
||
- include: ubuntu_tasks.yml | ||
when: ansible_os_family == "Debian" | ||
tags: | ||
- prebake-for-test | ||
|
||
|
||
- include: redhat_tasks.yml | ||
when: ansible_os_family == "RedHat" | ||
tags: | ||
- prebake-for-test |
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,18 @@ | ||
- name: check packer's version | ||
shell: packer --version | ||
register: packer_version | ||
ignore_errors: yes | ||
|
||
- name: download packer | ||
get_url: | ||
validate_certs: "{{ validate_certs }}" | ||
url: https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_linux_amd64.zip | ||
dest: /tmp/packer_0.8.6_linux_amd64.zip | ||
force: no | ||
when: packer_version.stdout != "0.8.6" | ||
|
||
- name: install packer | ||
shell: rm -f packer* && unzip /tmp/packer_0.8.6_linux_amd64.zip | ||
args: | ||
chdir: /usr/local/bin | ||
when: packer_version.stdout != "0.8.6" |
File renamed without changes.
File renamed without changes.
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,9 @@ | ||
--- | ||
# Role defaults for ucp | ||
|
||
ucp_version: "0.7.1" | ||
ucp_local_dir: "fetch/ucp" | ||
ucp_remote_dir: "/tmp" | ||
ucp_instance_id_file: "ucp-instance-id" | ||
ucp_fingerprint_file: "ucp-fingerprint" | ||
ucp_fifo_file: "ucp-fifo" |
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,8 @@ | ||
[Unit] | ||
Description=Ucp | ||
After=auditd.service systemd-user-sessions.service time-sync.target docker.service | ||
|
||
[Service] | ||
ExecStart=/usr/bin/ucp.sh start | ||
ExecStop=/usr/bin/ucp.sh stop | ||
KillMode=control-group |
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,12 @@ | ||
--- | ||
# This play contains tasks for cleaning up ucp | ||
|
||
- name: stop ucp | ||
service: name=ucp state=stopped | ||
|
||
- name: cleanup ucp files from remote | ||
file: name="{{ ucp_remote_dir }}/{{ item }}" state=absent | ||
with_items: | ||
- "{{ ucp_fingerprint_file }}" | ||
- "{{ ucp_instance_id_file }}" | ||
- "{{ ucp_fifo_file }}" |
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,52 @@ | ||
--- | ||
# This role contains tasks for configuring and starting the swarm stack using ucp | ||
|
||
- name: download and install ucp images | ||
shell: > | ||
docker run --rm -t \ | ||
--name ucp \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
docker/ucp \ | ||
images --image-version={{ ucp_version }} | ||
- name: copy the ucp files to worker nodes | ||
copy: | ||
src: "{{ ucp_local_dir }}/{{ item }}" | ||
dest: "{{ ucp_remote_dir }}/{{ item }}" | ||
with_items: | ||
- "{{ ucp_fingerprint_file }}" | ||
- "{{ ucp_instance_id_file }}" | ||
when: run_as == "worker" | ||
|
||
- name: copy the ucp start/stop script | ||
template: src=ucp.j2 dest=/usr/bin/ucp.sh mode=u=rwx,g=rx,o=rx | ||
|
||
- name: copy systemd units for ucp | ||
copy: src=ucp.service dest=/etc/systemd/system/ucp.service | ||
|
||
- name: start ucp | ||
service: name=ucp state=started | ||
|
||
- name: create a local fetch directory if it doesn't exist | ||
local_action: file path={{ ucp_local_dir }} state=directory | ||
when: run_as == "master" | ||
|
||
- name: wait for ucp files to be created, which ensures the service has started | ||
wait_for: | ||
path: "{{ ucp_remote_dir }}/{{ item }}" | ||
state: present | ||
with_items: | ||
- "{{ ucp_fingerprint_file }}" | ||
- "{{ ucp_instance_id_file }}" | ||
when: run_as == "master" | ||
|
||
- name: fetch the ucp files from master nodes | ||
fetch: | ||
src: "{{ ucp_remote_dir }}/{{ item }}" | ||
dest: "{{ ucp_local_dir }}/{{ item }}" | ||
flat: yes | ||
fail_on_missing: yes | ||
with_items: | ||
- "{{ ucp_fingerprint_file }}" | ||
- "{{ ucp_instance_id_file }}" | ||
when: run_as == "master" |
Oops, something went wrong.