diff options
Diffstat (limited to 'deploy')
10 files changed, 22 insertions, 173 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml index 93f22117..e3e1b3e5 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml @@ -58,10 +58,6 @@ # when: groups['opencontrail_control']|length !=0 -#- name: Provision rabbitmq on config for Open Contrail -# include: provision/provision-rabbitmq.yml -# when: inventory_hostname in groups['opencontrail_config'] - - name: Provision increase limits for Open Contrail include: provision/provision-increase-limits.yml diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-rabbitmq-stop.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-rabbitmq-stop.yml deleted file mode 100755 index ec6b2fe0..00000000 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-rabbitmq-stop.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- name: 'stop rabbitmq server' - service: - name: 'rabbitmq-server' - state: 'stopped' - -- name: 'check beam process' - shell: 'ps ax | grep -v grep | grep beam' - register: beam_process - changed_when: no - ignore_errors: yes - -- name: 'kill beam processes' - shell: 'pkill -9 beam' - when: beam_process.stdout - -- name: 'check epmd process' - shell: 'ps ax | grep -v grep | grep epmd' - register: epmd_process - changed_when: no - ignore_errors: yes - -- name: 'kill epmd processes' - shell: 'pkill -9 epmd' - when: epmd_process.stdout - -- name: 'remove mnesia directory' - file: - name: '/var/lib/rabbitmq/mnesia' - state: 'absent' diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml deleted file mode 100755 index 58037bce..00000000 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml +++ /dev/null @@ -1,104 +0,0 @@ ---- -#- hosts: config -# sudo: yes -# tasks: -- name: "start supervisor support service" -# sudo: True - service: - name: "supervisor-support-service" - state: "started" - - - -- name: "stop rabbitmq server via supervisor" -# sudo: True - supervisorctl: - name: "rabbitmq-server" - state: "stopped" - server_url: "unix:///tmp/supervisord_support_service.sock" - - - -- name: "-rabbitmq-stop" -# sudo: True - include: -rabbitmq-stop.yml - - - -- name: "update hosts" -# sudo: True - lineinfile: - dest: "/etc/hosts" -# line: "{{ hostvars[item]['contrail_address'] }}\t{{ hostvars[item]['ansible_hostname'] }} {{ hostvars[item]['ansible_hostname'] }}-ctrl" - line: "{{ contrail_address }}\t{{ inventory_hostname }} {{ inventory_hostname }}-ctrl" - with_items: groups['opencontrail_config'] - - - -- name: "fix up rabbitmq env" -# sudo: True - template: - src: "provision/rabbitmq-env-conf.j2" - dest: "/etc/rabbitmq/rabbitmq-env.conf" - - - -- name: "fix up rabbitmq config for single node" -# sudo: True - template: - src: "provision/rabbitmq-conf-single.j2" - dest: "/etc/rabbitmq/rabbitmq.config" - when: groups['opencontrail_config'][1] is not defined - - - -- name: fix up rabbitmq config for multi nodes -# sudo: True - template: - src: "provision/rabbitmq-conf.j2" - dest: "/etc/rabbitmq/rabbitmq.config" - when: groups['opencontrail_config'][1] is defined - - - -- name: "-rabbitmq-stop" -# sudo: True - include: -rabbitmq-stop.yml - - - -- name: "create cookie uuid temporary" -# sudo: True - local_action: - module: "template" - src: "provision/rabbitmq-cookie.j2" - dest: "/tmp/tmp-rabbitmq-cookie" - run_once: yes - - -- name: "update cookie uuid" -# sudo: True - copy: - src: "/tmp/tmp-rabbitmq-cookie" - dest: "/var/lib/rabbitmq/.erlang.cookie" - owner: "rabbitmq" - group: "rabbitmq" - mode: 0400 - - - -- name: "delete temporary cookie uuid" -# sudo: True - local_action: - module: "file" - dest: "/tmp/tmp-rabbitmq-cookie" - state: "absent" - run_once: yes - - - -- name: "start rabbitmq server" -# sudo: True - service: - name: "rabbitmq-server" - state: "started" diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-conf-single.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-conf-single.j2 deleted file mode 100755 index a276d3e2..00000000 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-conf-single.j2 +++ /dev/null @@ -1,6 +0,0 @@ -[ - {rabbit, [ {tcp_listeners, [{"{{ contrail_address }}", 5672}]}, - {loopback_users, []}, - {log_levels,[{connection, info},{mirroring, info}]} ] - } -]. diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-conf.j2 deleted file mode 100755 index c8cbe63f..00000000 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-conf.j2 +++ /dev/null @@ -1,25 +0,0 @@ -[ - {rabbit, [ {tcp_listeners, [{"{{ contrail_address }}", 5672}]}, {cluster_partition_handling, autoheal},{loopback_users, []}, - {cluster_nodes, {[{% for cur_host in groups['opencontrail_config'] %}'rabbit@{{ cur_host }}-ctrl'{% if not loop.last %}, {% endif %}{% endfor %}], disc}}, - {vm_memory_high_watermark, 0.4}, - {disk_free_limit,50000000}, - {log_levels,[{connection, info},{mirroring, info}]}, - {heartbeat,10}, - {delegate_count,20}, - {channel_max,5000}, - {tcp_listen_options, - [binary, - {packet, raw}, - {reuseaddr, true}, - {backlog, 128}, - {nodelay, true}, - {exit_on_close, false}, - {keepalive, true} - ] - }, - {collect_statistics_interval, 60000} - ] - }, - {rabbitmq_management_agent, [ {force_fine_statistics, true} ] }, - {kernel, [{net_ticktime, 30}]} -]. diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-cookie.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-cookie.j2 deleted file mode 100755 index 838d0332..00000000 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-cookie.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ ansible_date_time.iso8601_micro | to_uuid }} diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j2 deleted file mode 100755 index 6728eddb..00000000 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -NODE_IP_ADDRESS={{ contrail_address }} -NODENAME=rabbit@{{ inventory_hostname }}-ctrl diff --git a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml index e19b1fbf..83eea5a3 100755 --- a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml +++ b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml @@ -31,7 +31,7 @@ contrail_router_asn: "64512" ### Modify when need openstack provisioning keystone_provision: no install_nova: no -rabbit_password: "console" +rabbit_password: {{ RABBIT_PASS }} contrail_tor_agents: - name: "test01" diff --git a/deploy/network.sh b/deploy/network.sh index 9f1a7b90..e76fd926 100755 --- a/deploy/network.sh +++ b/deploy/network.sh @@ -57,6 +57,8 @@ function setup_bridge_external() sudo virsh net-define $WORK_DIR/network/external.xml sudo virsh net-start external + + sudo python $COMPASS_DIR/deploy/setup_vnic.py } function setup_nat_net() { diff --git a/deploy/setup_vnic.py b/deploy/setup_vnic.py new file mode 100644 index 00000000..39623031 --- /dev/null +++ b/deploy/setup_vnic.py @@ -0,0 +1,19 @@ +#!/usr/bin/python +import os +import yaml + +if __name__ == "__main__": + network_config_file = "/home/carey/nfv/compass4nfv/deploy/conf/network_cfg.yaml"#os.environ["NETWORK"] + network_config = yaml.load(open(network_config_file, "r")) + os.system("ovs-vsctl --may-exist add-port br-external mgmt_vnic -- set Interface mgmt_vnic type=internal") + os.system("ip addr flush mgmt_vnic") + os.system("ip link set mgmt_vnic up") + for sys_intf in network_config["sys_intf_mappings"]: + if sys_intf["name"] == "mgmt" and sys_intf.get("vlan_tag"): + os.system("ovs-vsctl set port mgmt_vnic tag=%s" % sys_intf["vlan_tag"]) + + for net_info in network_config["ip_settings"]: + if net_info["name"] == "mgmt": + mgmt_ip_range_end= net_info["ip_ranges"][0][1] + mgmt_netmask = net_info["cidr"].split('/')[1] + os.system(r"ip addr add %s/%s dev mgmt_vnic" % (mgmt_ip_range_end, mgmt_netmask)) |