Adjust the plugins directory structure 27/37827/5
authorYifei Xue <xueyifei@huawei.com>
Thu, 20 Jul 2017 03:46:14 +0000 (11:46 +0800)
committerJustin chi <chigang@huawei.com>
Fri, 21 Jul 2017 01:35:06 +0000 (01:35 +0000)
JIRA:-

Since there may be multiple roles in one plugin, so add
a level of roles to the directory.
Move the copy operation of ODL from configure_osa to
a new setup-opendaylgiht role.
Add excute_order in the plugin description of ODL.

Change-Id: I905fb84b11df201dc1436ec888f511e251bba89c
Signed-off-by: Yifei Xue <xueyifei@huawei.com>
Signed-off-by: chigang <chigang@huawei.com>
33 files changed:
deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
deploy/adapters/ansible/roles/config-osa/tasks/main.yml
plugins/ntp/roles/ntp/handlers/main.yml [moved from plugins/ntp/handlers/main.yml with 100% similarity]
plugins/ntp/roles/ntp/tasks/main.yml [moved from plugins/ntp/tasks/main.yml with 100% similarity]
plugins/ntp/roles/ntp/templates/ntp.conf.j2 [moved from plugins/ntp/templates/ntp.conf.j2 with 100% similarity]
plugins/ntp/roles/ntp/vars/main.yml [moved from plugins/ntp/vars/main.yml with 100% similarity]
plugins/odl_cluster/plugins.desc
plugins/odl_cluster/roles/odl_cluster/files/opendaylight.service [moved from plugins/odl_cluster/files/opendaylight.service with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/handlers/main.yml [moved from plugins/odl_cluster/handlers/main.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/control-agents-1.yml [moved from plugins/odl_cluster/tasks/control-agents-1.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/control-agents-2.yml [moved from plugins/odl_cluster/tasks/control-agents-2.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/control-agents-3.yml [moved from plugins/odl_cluster/tasks/control-agents-3.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/control-db-1.yml [moved from plugins/odl_cluster/tasks/control-db-1.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/control-hosts-1.yml [moved from plugins/odl_cluster/tasks/control-hosts-1.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/control-hosts-2.yml [moved from plugins/odl_cluster/tasks/control-hosts-2.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/control-repos-1.yml [moved from plugins/odl_cluster/tasks/control-repos-1.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/control-servers-1.yml [moved from plugins/odl_cluster/tasks/control-servers-1.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/control-servers-2.yml [moved from plugins/odl_cluster/tasks/control-servers-2.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/control-servers-3.yml [moved from plugins/odl_cluster/tasks/control-servers-3.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/main.yml [moved from plugins/odl_cluster/tasks/main.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/tasks/odl-post.yml [moved from plugins/odl_cluster/tasks/odl-post.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/templates/acl_conf.sh [moved from plugins/odl_cluster/templates/acl_conf.sh with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/templates/custom.properties [moved from plugins/odl_cluster/templates/custom.properties with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/templates/ml2_conf.sh [moved from plugins/odl_cluster/templates/ml2_conf.sh with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/templates/org.apache.karaf.features.cfg [moved from plugins/odl_cluster/templates/org.apache.karaf.features.cfg with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/vars/Debian.yml [moved from plugins/odl_cluster/vars/Debian.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/vars/RedHat.yml [moved from plugins/odl_cluster/vars/RedHat.yml with 100% similarity]
plugins/odl_cluster/roles/odl_cluster/vars/main.yml [moved from plugins/odl_cluster/vars/main.yml with 100% similarity]
plugins/odl_cluster/roles/setup-opendaylight/tasks/main.yml [new file with mode: 0644]
plugins/odl_cluster/roles/setup-opendaylight/templates/setup-odl.yml.j2 [moved from deploy/adapters/ansible/roles/config-osa/templates/setup-odl.yml.j2 with 100% similarity]
plugins/rt_kvm/roles/rt_kvm/tasks/kvm.yml [moved from plugins/rt_kvm/tasks/kvm.yml with 100% similarity]
plugins/rt_kvm/roles/rt_kvm/tasks/main.yml [moved from plugins/rt_kvm/tasks/main.yml with 100% similarity]
plugins/rt_kvm/roles/rt_kvm/vars/main.yml [moved from plugins/rt_kvm/vars/main.yml with 100% similarity]

index 41139c5..1e721aa 100644 (file)
@@ -32,4 +32,5 @@
     - role: setup-infrastructure
     - role: setup-openstack
     - role: setup-openvswitch
+    - role: setup-opendaylight
     - role: post-openstack
index c766391..b1b32f7 100644 (file)
     src: setup-ovs.yml
     dest: /opt/openstack-ansible/playbooks
 
-- name: copy setup-odl.yml
-  template:
-    src: setup-odl.yml.j2
-    dest: /opt/openstack-ansible/playbooks/setup-odl.yml
-
-- name: copy odl_cluster role
-  copy:
-    src: /var/ansible/run/openstack_ocata-opnfv2/roles/odl_cluster
-    dest: /etc/ansible/roles/
-
 - name: copy flavor roles
   copy:
     src: os-flavor
index 04e78f9..86413ae 100644 (file)
@@ -49,8 +49,12 @@ plugin:
   orchestration:
     cm: ansible
     roles:
-      - role: opendaylight
-        phrase: post_openstack
+      - role: setup_opendaylight
+        excute_after: setup_openvswitch
+        inventory:
+          - localhost
+      - role: odl_cluster
+        excute_in: setup_opendaylight
         inventory:
           - neutron_all
           - galera_container
diff --git a/plugins/odl_cluster/roles/setup-opendaylight/tasks/main.yml b/plugins/odl_cluster/roles/setup-opendaylight/tasks/main.yml
new file mode 100644 (file)
index 0000000..3abca82
--- /dev/null
@@ -0,0 +1,25 @@
+##############################################################################
+# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+
+- name: copy setup-odl.yml
+  template:
+    src: setup-odl.yml.j2
+    dest: /opt/openstack-ansible/playbooks/setup-odl.yml
+
+- name: copy odl_cluster role
+  copy:
+    src: /var/ansible/run/openstack_ocata-opnfv2/roles/odl_cluster
+    dest: /etc/ansible/roles/
+
+- name: setup odl
+  shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \
+          cd /opt/openstack-ansible/playbooks; \
+          openstack-ansible setup-odl.yml > /dev/null"
+  when: opendaylight is defined and opendaylight == "Enable"