diff options
author | vagrant <pmikus@cisco.com> | 2020-02-04 14:16:01 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2020-02-07 20:08:43 +0000 |
commit | 8605f3f406468f57bb9b2eac12a4421f65965300 (patch) | |
tree | 5eef32ff0298ab1c3ac593adced4a502d7c8ea17 /resources/tools/testbed-setup/ansible/roles/tg | |
parent | d7e14a0a93e7e06047daeaf6a5575f227aeb925a (diff) |
CSIT Azure integration
+ Terraform
+ Ansible
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: I353511c5ef39d8c8d43fedc61c8dbb30b4821e1b
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/tg')
6 files changed, 23 insertions, 123 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/tg/files/csit-initialize-docker-tg.sh b/resources/tools/testbed-setup/ansible/roles/tg/files/csit-initialize-docker-tg.sh index 2d307b1c38..7b90d20bda 100755 --- a/resources/tools/testbed-setup/ansible/roles/tg/files/csit-initialize-docker-tg.sh +++ b/resources/tools/testbed-setup/ansible/roles/tg/files/csit-initialize-docker-tg.sh @@ -21,7 +21,7 @@ case "${1:-start}" in "start" ) # Run TG for cnt in $(seq 1 ${2:-1}); do - docker network create --driver bridge csit-nw-tg${cnt} + docker network create --driver bridge csit-nw-tg${cnt} || true # If the IMAGE is not already loaded then docker run will pull the # IMAGE, and all image dependencies, before it starts the container. dcr_image="snergster/csit-sut:latest" @@ -55,4 +55,4 @@ case "${1:-start}" in docker rm --force $(docker ps --all --quiet --filter name=csit) docker network rm $(docker network ls --filter name=csit --quiet) ;; -esac
\ No newline at end of file +esac diff --git a/resources/tools/testbed-setup/ansible/roles/tg/handlers/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg/handlers/main.yaml index 53cbb48e0a..e13e67b2c1 100644 --- a/resources/tools/testbed-setup/ansible/roles/tg/handlers/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/tg/handlers/main.yaml @@ -4,6 +4,7 @@ - name: Start csit-initialize-docker-tg.service systemd: enabled: yes - state: 'started' - name: 'csit-initialize-docker-tg.service' - tags: docker-tg + state: "started" + name: "csit-initialize-docker-tg.service" + tags: + - docker-tg diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml index a7ab90d34a..d7a9ed882d 100644 --- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml @@ -1,38 +1,28 @@ --- # file: roles/tg/tasks/main.yaml -- name: Install distribution - release - machine prerequisites - include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml' - tags: install-csit-dependencies - -- name: Install WRK - include_tasks: 'wrk.yaml' - tags: install-wrk - -- name: Install TRex - include_tasks: 'trex.yaml' - tags: install-trex - -- name: Copy csit-initialize-docker-tg.sh +- name: TG - Copy csit-initialize-docker-tg.sh copy: - src: 'files/csit-initialize-docker-tg.sh' - dest: '/usr/local/bin/csit-initialize-docker-tg.sh' - owner: 'root' - group: 'root' - mode: '744' + src: "files/csit-initialize-docker-tg.sh" + dest: "/usr/local/bin/csit-initialize-docker-tg.sh" + owner: "root" + group: "root" + mode: "744" when: docker_tg is defined - tags: docker-tg + tags: + - docker-tg -- name: Start csit-initialize-docker-tg.service +- name: TG - Start csit-initialize-docker-tg.service copy: - src: 'files/csit-initialize-docker-tg.service' - dest: '/etc/systemd/system/' - owner: 'root' - group: 'root' - mode: '644' + src: "files/csit-initialize-docker-tg.service" + dest: "/etc/systemd/system/" + owner: "root" + group: "root" + mode: "644" notify: - - 'Start csit-initialize-docker-tg.service' + - "Start csit-initialize-docker-tg.service" when: docker_tg is defined - tags: docker-tg + tags: + - docker-tg - meta: flush_handlers diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml deleted file mode 100644 index dc86ec3e5b..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml +++ /dev/null @@ -1,37 +0,0 @@ ---- -# file: roles/tg/tasks/trex.yaml - -- name: T-Rex Install - Get Release Archive - get_url: - url: 'https://github.com/cisco-system-traffic-generator/trex-core/archive/v{{ trex.version }}.tar.gz' - dest: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz' - mode: 0644 - register: trex_downloaded - tags: install-trex - -- name: T-Rex Install - Ensure Directory Exists - file: - path: '{{ trex.target_dir }}/trex-core-{{ trex.version }}' - state: 'directory' - register: trex_dir_created - tags: install-trex - -- name: T-Rex Install - Extract Release Archive - unarchive: - remote_src: true - src: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz' - dest: '{{ trex.target_dir }}/' - creates: '{{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk/' - when: trex_dir_created - register: trex_extracted - tags: install-trex - -- name: T-Rex Install - Compile Release I - raw: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk/; ./b configure; ./b build' - when: trex_extracted - tags: install-trex - -- name: T-Rex Install - Compile Release II - raw: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/scripts/ko/src; make; make install' - when: trex_extracted - tags: install-trex diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml deleted file mode 100644 index d119f9c462..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# file: roles/tg/tasks/ubuntu_bionic.yaml - -- name: Install CSIT dependencies - apt: - name: - - 'libmnl-dev' - - 'libnuma-dev' - - 'libpcap-dev' - - 'libssl-dev' - state: 'present' - cache_valid_time: 3600 - install_recommends: False - tags: install-csit-dependencies diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml deleted file mode 100644 index aee3761476..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -# file: roles/tg/tasks/wrk.yaml - -- name: WRK Install - Get Release Archive - get_url: - url: 'https://github.com/wg/wrk/archive/{{ wrk.version }}.tar.gz' - dest: '{{ wrk.target_dir }}/{{ wrk.version }}.tar.gz' - mode: 0644 - register: wrk_downloaded - tags: install-wrk - -- name: WRK Install - Ensure Directory Exists - file: - path: '{{ wrk.target_dir }}/wrk-{{ wrk.version }}' - state: 'directory' - register: wrk_dir_created - tags: install-wrk - -- name: WRK Install - Extract Release Archive - unarchive: - remote_src: true - src: '{{ wrk.target_dir }}/{{ wrk.version }}.tar.gz' - dest: '{{ wrk.target_dir }}/' - creates: '{{ wrk.target_dir }}/wrk-{{ wrk.version }}/src' - when: wrk_dir_created - register: wrk_extracted - tags: install-wrk - -- name: WRK Install - Compile Release - command: 'make' - args: - chdir: '{{ wrk.target_dir }}/wrk-{{ wrk.version }}' - when: wrk_extracted - register: wrk_compiled - tags: install-wrk - -- name: WRK Install - Move Binary - command: 'mv {{ wrk.target_dir }}/wrk-{{ wrk.version }}/wrk /usr/local/bin/' - when: wrk_compiled - tags: install-wrk |