From 404f6dd50ca4f379b691700bf36c89572872f285 Mon Sep 17 00:00:00 2001 From: Ignatious Johnson Christopher Date: Sun, 23 Apr 2017 22:40:14 -0700 Subject: [PATCH] Use contrail-compute-setup to provision vrouter agent, nodemgr and to configure vhost0 interface. Change-Id: I40bdc5472b3c193cbb93a72c0d16e6dcc3f7753d Closes-Bug: 1685586 --- .../roles/contrail/agent/tasks/configure.yml | 10 +-- .../contrail/agent/tasks/nodemanager.yml | 20 ------ .../contrail/agent/tasks/vrouter_agent.yml | 65 ------------------- 3 files changed, 3 insertions(+), 92 deletions(-) delete mode 100644 playbooks/roles/contrail/agent/tasks/nodemanager.yml delete mode 100644 playbooks/roles/contrail/agent/tasks/vrouter_agent.yml diff --git a/playbooks/roles/contrail/agent/tasks/configure.yml b/playbooks/roles/contrail/agent/tasks/configure.yml index 1e67d7ba..f6d6af0d 100644 --- a/playbooks/roles/contrail/agent/tasks/configure.yml +++ b/playbooks/roles/contrail/agent/tasks/configure.yml @@ -33,13 +33,9 @@ - include_role: name=contrail/common tasks_from=vncapi tags: [contrail.vncapi, contrail.vncapi.configure, test] -- name: Configure vorouter agent - include: vrouter_agent.yml - tags: [contrail.agent.vrouter_agent.configure, contrail.agent.vrouter_agent] - -- name: Configure vrouter nodemanager - include: nodemanager.yml - tags: [contrail.agent.nodemanager.configure, contrail.agent.nodemanager, test] +- name: Configure vrouter agent and nodemgr using contrail-compute-setup + shell: contrail-compute-setup --self_ip {{ vhost_address }} --cfgm_ip {{ api_server_ip }} + tags: [contrail.agent.vrouter.configure, contrail.agent.vrouter] - name: setup cni include: cni.yml diff --git a/playbooks/roles/contrail/agent/tasks/nodemanager.yml b/playbooks/roles/contrail/agent/tasks/nodemanager.yml deleted file mode 100644 index 725819ea..00000000 --- a/playbooks/roles/contrail/agent/tasks/nodemanager.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: configure agent nodemanager - ini_file: - dest: "{{ nodemanager_conf }}" - section: "{{ item.section }}" - option: "{{ item.option }}" - value: "{{ item.value }}" - create: yes - with_inidata: - COLLECTOR: - server_list: "{{ analytics_collectors_with_port }}" - SANDESH: - sandesh_ssl_enable: "{{ sandesh_ssl_enable }}" - introspect_ssl_enable: "{{ introspect_ssl_enable }}" - sandesh_keyfile: "{{ sandesh_keyfile }}" - sandesh_certfile: "{{ sandesh_certfile }}" - sandesh_ca_cert: "{{ sandesh_ca_cert }}" - notify: - - restart vrouter-nodemgr supervisord - - restart vrouter-nodemgr systemd diff --git a/playbooks/roles/contrail/agent/tasks/vrouter_agent.yml b/playbooks/roles/contrail/agent/tasks/vrouter_agent.yml deleted file mode 100644 index b386cff9..00000000 --- a/playbooks/roles/contrail/agent/tasks/vrouter_agent.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -- name: Configure contrail-vrouter-agent.conf - ini_file: - dest: "{{ vrouter_agent_conf }}" - section: "{{ item.section }}" - option: "{{ item.option }}" - value: "{{ item.value }}" - create: yes - with_inidata: - DEFAULT: - platform: "{{ vrouter_platform }}" - log_file: "{{ vrouter_agent_log }}" - log_level: "{{ vrouter_agent_log_level }}" - log_local: "{{ log_local }}" - collectors: "{{ analytics_collectors_with_port }}" - physical_interface_mac: "{{ vrouter_physical_interface_mac_address }}" - xmpp_auth_enable: "{{ xmpp_auth_enable }}" - CONTROL-NODE: - servers: "{{ control_servers_with_xmpp_port }}" - DNS: - servers: "{{ control_servers_with_dns_port }}" - VIRTUAL-HOST-INTERFACE: - name: "{{ vhost_interface }}" - ip: "{{ vhost_address_with_prefix }}" - gateway: "{{ vhost_gateway }}" - physical_interface: "{{ vrouter_physical_interface_orig }}" - NETWORKS: - control_network_ip: "{{ vhost_address }}" - SANDESH: - sandesh_ssl_enable: "{{ sandesh_ssl_enable }}" - introspect_ssl_enable: "{{ introspect_ssl_enable }}" - sandesh_keyfile: "{{ sandesh_keyfile }}" - sandesh_certfile: "{{ sandesh_certfile }}" - sandesh_ca_cert: "{{ sandesh_ca_cert }}" - notify: - - restart vrouter-agent supervisord - - restart vrouter-agent systemd - tags: [test] - -- name: Configure /etc/contrail/agent_param - template: src=agent_param.j2 dest=/etc/contrail/agent_param - notify: - - restart vrouter-agent supervisord - - restart vrouter-agent systemd - -# TODO: This function need to be split and added as separate tasks -- name: insert vrouter and setup vrouter vifs - shell: source /opt/contrail/bin/vrouter-functions.sh && insert_vrouter - args: - executable: /bin/bash - -- name: Move ip address from vrouter physical device to vhost - shell: "ip address delete {{ vhost_address_with_prefix }} dev {{ vrouter_physical_interface_orig }} && \ - ip address add {{ vhost_address_with_prefix }} dev {{ vhost_interface }} && \ - ip link set dev {{ vhost_interface }} up" - register: vhost_ip_move - when: vhost_interface not in ansible_interfaces - -- name: Add default gateway to new device as link local in case of /32 IP Address - shell: "ip route add unicast {{ vhost_gateway }} dev {{ vhost_interface }} scope link" - when: " {{ vhost_ip_move.changed }} and ({{ vhost_address_with_prefix | ipaddr('prefix') }} == 32) " - -- name: Add default gateway to vhost - shell: "ip route add default via {{ vhost_gateway }} dev {{ vhost_interface }}" - when: vhost_ip_move.changed and (vhost_network == ansible_default_ipv4.network)