aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles')
-rwxr-xr-xdeploy/adapters/ansible/roles/boot-recovery/tasks/main.yml26
-rwxr-xr-xdeploy/adapters/ansible/roles/boot-recovery/vars/Debian.yml14
-rwxr-xr-xdeploy/adapters/ansible/roles/boot-recovery/vars/RedHat.yml15
-rwxr-xr-xdeploy/adapters/ansible/roles/boot-recovery/vars/main.yml11
-rw-r--r--deploy/adapters/ansible/roles/controller-recovery/vars/Debian.yml1
-rw-r--r--deploy/adapters/ansible/roles/controller-recovery/vars/RedHat.yml1
-rw-r--r--deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml8
-rw-r--r--deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml8
-rw-r--r--deploy/adapters/ansible/roles/glance/tasks/main.yml2
-rw-r--r--deploy/adapters/ansible/roles/glance/tasks/nfs.yml8
-rwxr-xr-xdeploy/adapters/ansible/roles/odl_cluster/files/install_jdk8.tarbin4608 -> 0 bytes
-rwxr-xr-xdeploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml10
-rwxr-xr-xdeploy/adapters/ansible/roles/onos_cluster/files/install_jdk8.tarbin4608 -> 0 bytes
-rw-r--r--deploy/adapters/ansible/roles/onos_cluster/files/networking-onos.tarbin153600 -> 0 bytes
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml15
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml15
-rw-r--r--deploy/adapters/ansible/roles/open-contrail/templates/neutron_plugin_contrail.tar.gzbin73771 -> 0 bytes
-rw-r--r--deploy/adapters/ansible/roles/open-contrail/templates/nova_contrail_vif.tar.gzbin3552 -> 0 bytes
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/vars/main.yml3
19 files changed, 126 insertions, 11 deletions
diff --git a/deploy/adapters/ansible/roles/boot-recovery/tasks/main.yml b/deploy/adapters/ansible/roles/boot-recovery/tasks/main.yml
new file mode 100755
index 00000000..67206bf6
--- /dev/null
+++ b/deploy/adapters/ansible/roles/boot-recovery/tasks/main.yml
@@ -0,0 +1,26 @@
+##############################################################################
+# 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: Register RECOVERY
+ set_fact: RECOVERY_ENV={{RECOVERY_ENV | default('False')}}
+ tags:
+ - recovery-stop-service
+
+- include_vars: "{{ ansible_os_family }}.yml"
+ when: RECOVERY_ENV
+ tags:
+ - recovery-stop-service
+
+- name: stop controller services
+ service: name={{ item }} state=stopped enabled=yes
+ with_items: controller_services | union(controller_services_noarch)
+ when: RECOVERY_ENV
+ tags:
+ - recovery-stop-service
+
diff --git a/deploy/adapters/ansible/roles/boot-recovery/vars/Debian.yml b/deploy/adapters/ansible/roles/boot-recovery/vars/Debian.yml
new file mode 100755
index 00000000..084deebc
--- /dev/null
+++ b/deploy/adapters/ansible/roles/boot-recovery/vars/Debian.yml
@@ -0,0 +1,14 @@
+##############################################################################
+# 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
+##############################################################################
+---
+controller_services:
+ - cron
+ - aodh-expirer
+ - neutron-openvswitch-agent
+ - mysql
diff --git a/deploy/adapters/ansible/roles/boot-recovery/vars/RedHat.yml b/deploy/adapters/ansible/roles/boot-recovery/vars/RedHat.yml
new file mode 100755
index 00000000..c46f79c8
--- /dev/null
+++ b/deploy/adapters/ansible/roles/boot-recovery/vars/RedHat.yml
@@ -0,0 +1,15 @@
+##############################################################################
+# 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
+##############################################################################
+---
+controller_services:
+ - cron
+ - neutron-openvswitch-agent
+ - openstack-aodh-expirer
+ - mysql
+
diff --git a/deploy/adapters/ansible/roles/boot-recovery/vars/main.yml b/deploy/adapters/ansible/roles/boot-recovery/vars/main.yml
new file mode 100755
index 00000000..22af29f4
--- /dev/null
+++ b/deploy/adapters/ansible/roles/boot-recovery/vars/main.yml
@@ -0,0 +1,11 @@
+##############################################################################
+# 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
+##############################################################################
+---
+controller_services_noarch: []
+
diff --git a/deploy/adapters/ansible/roles/controller-recovery/vars/Debian.yml b/deploy/adapters/ansible/roles/controller-recovery/vars/Debian.yml
index 34675f6b..62753413 100644
--- a/deploy/adapters/ansible/roles/controller-recovery/vars/Debian.yml
+++ b/deploy/adapters/ansible/roles/controller-recovery/vars/Debian.yml
@@ -37,4 +37,5 @@ controller_services:
- aodh-notifier
- aodh-evaluator
- aodh-listener
+ - cron
diff --git a/deploy/adapters/ansible/roles/controller-recovery/vars/RedHat.yml b/deploy/adapters/ansible/roles/controller-recovery/vars/RedHat.yml
index 35c0a955..145acecd 100644
--- a/deploy/adapters/ansible/roles/controller-recovery/vars/RedHat.yml
+++ b/deploy/adapters/ansible/roles/controller-recovery/vars/RedHat.yml
@@ -36,4 +36,5 @@ controller_services:
- openstack-aodh-notifier
- openstack-aodh-evaluator
- openstack-aodh-listener
+ - cron
diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml
index 6b670312..f083a40f 100644
--- a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml
+++ b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml
@@ -7,6 +7,14 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
+- name: Register RECOVERY
+ set_fact: RECOVERY_ENV={{RECOVERY_ENV | default('False')}}
+
+- name: killall mysqld processes
+ shell: sudo killall -9 mysqld
+ when: RECOVERY_ENV
+ ignore_errors: True
+
- name: get cluster status
shell: mysql --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_evs_state"'|awk '{print $2}'
register: cluster_status
diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml
index da1b863c..cfd778f1 100644
--- a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml
+++ b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml
@@ -7,6 +7,14 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
+- name: Register RECOVERY
+ set_fact: RECOVERY_ENV={{RECOVERY_ENV | default('False')}}
+
+- name: killall mysqld processes
+ shell: sudo killall -9 mysqld
+ when: RECOVERY_ENV
+ ignore_errors: True
+
- name: get cluster status
shell: mysql --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_evs_state"'|awk '{print $2}'
register: cluster_status
diff --git a/deploy/adapters/ansible/roles/glance/tasks/main.yml b/deploy/adapters/ansible/roles/glance/tasks/main.yml
index a78ba771..caece26c 100644
--- a/deploy/adapters/ansible/roles/glance/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/glance/tasks/main.yml
@@ -8,6 +8,8 @@
##############################################################################
---
- include_vars: "{{ ansible_os_family }}.yml"
+ tags:
+ - recovery
- include: glance_install.yml
tags:
diff --git a/deploy/adapters/ansible/roles/glance/tasks/nfs.yml b/deploy/adapters/ansible/roles/glance/tasks/nfs.yml
index 7895c386..179229de 100644
--- a/deploy/adapters/ansible/roles/glance/tasks/nfs.yml
+++ b/deploy/adapters/ansible/roles/glance/tasks/nfs.yml
@@ -38,10 +38,14 @@
- name: get mount info
command: mount
register: mount_info
+ tags:
+ - recovery
- name: get nfs server
shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf
register: ip_info
+ tags:
+ - recovery
- name: restart host nfs service
service: name={{ item }} state=restarted enabled=yes
@@ -51,7 +55,9 @@
shell: |
mount -t nfs -onfsvers=3 {{ ip_info.stdout_lines[0] }}:/opt/images /var/lib/glance/images
sed -i '/\/var\/lib\/glance\/images/d' /etc/fstab
- echo {{ ip_info.stdout_lines[0] }}:/opt/images /var/lib/glance/images/ nfs nfsvers=3 >> /etc/fstab
+ #echo {{ ip_info.stdout_lines[0] }}:/opt/images /var/lib/glance/images/ nfs nfsvers=3 >> /etc/fstab
when: mount_info.stdout.find('images') == -1
retries: 5
delay: 3
+ tags:
+ - recovery
diff --git a/deploy/adapters/ansible/roles/odl_cluster/files/install_jdk8.tar b/deploy/adapters/ansible/roles/odl_cluster/files/install_jdk8.tar
deleted file mode 100755
index faaaeb39..00000000
--- a/deploy/adapters/ansible/roles/odl_cluster/files/install_jdk8.tar
+++ /dev/null
Binary files differ
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml
index f0ca1054..1ea5e0d2 100755
--- a/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml
@@ -21,8 +21,14 @@
#"
-- name: upload install_jdk8 scripts
- unarchive: src=install_jdk8.tar dest=/opt/
+- name: download oracle-jdk8 script file
+ get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/onos/{{ jdk8_script_name }}" dest=/opt/
+
+- name: unarchive onos driver package
+ command: su -s /bin/sh -c "tar xvf /opt/install_jdk8.tar -C /opt/"
+
+#- name: upload install_jdk8 scripts
+# unarchive: src=install_jdk8.tar dest=/opt/
- name: install install_jdk8 package
command: su -s /bin/sh -c "/opt/install_jdk8/install_jdk8.sh"
diff --git a/deploy/adapters/ansible/roles/onos_cluster/files/install_jdk8.tar b/deploy/adapters/ansible/roles/onos_cluster/files/install_jdk8.tar
deleted file mode 100755
index faaaeb39..00000000
--- a/deploy/adapters/ansible/roles/onos_cluster/files/install_jdk8.tar
+++ /dev/null
Binary files differ
diff --git a/deploy/adapters/ansible/roles/onos_cluster/files/networking-onos.tar b/deploy/adapters/ansible/roles/onos_cluster/files/networking-onos.tar
deleted file mode 100644
index 9358199c..00000000
--- a/deploy/adapters/ansible/roles/onos_cluster/files/networking-onos.tar
+++ /dev/null
Binary files differ
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml
index d9258ef5..374c4e13 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml
@@ -221,10 +221,17 @@
###################### nova plugin workaround #######################
#######################################################################
-- name: "copy nova plugs on compute"
- copy:
- src: "../../templates/nova_contrail_vif.tar.gz"
- dest: "/opt/nova_contrail_vif.tar.gz"
+#- name: "copy nova plugs on compute"
+# copy:
+# src: "../../templates/nova_contrail_vif.tar.gz"
+# dest: "/opt/nova_contrail_vif.tar.gz"
+
+- name: get image http server
+ shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf
+ register: http_server
+
+- name: download nova plugin package
+ get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/open-contrail/{{ nova_plugin }}" dest=/opt/
- name: "unzip nova plugs"
command: su -s /bin/sh -c "tar xzf /opt/nova_contrail_vif.tar.gz -C /opt/"
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml
index 32142471..615ac281 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml
@@ -247,10 +247,17 @@
############# neutron plugins workaround ##################
###########################################################
-- name: "copy neutron plugs on controller"
- copy:
- src: "../../templates/neutron_plugin_contrail.tar.gz"
- dest: "/opt/neutron_plugin_contrail.tar.gz"
+#- name: "copy neutron plugs on controller"
+# copy:
+# src: "../../templates/neutron_plugin_contrail.tar.gz"
+# dest: "/opt/neutron_plugin_contrail.tar.gz"
+
+- name: get image http server
+ shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf
+ register: http_server
+
+- name: download neutron_plugin_contrail package
+ get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/open-contrail/{{ neutron_plugin }}" dest=/opt/
- name: "unzip neutron plugs"
command: su -s /bin/sh -c "tar xzf /opt/neutron_plugin_contrail.tar.gz -C /opt/"
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/neutron_plugin_contrail.tar.gz b/deploy/adapters/ansible/roles/open-contrail/templates/neutron_plugin_contrail.tar.gz
deleted file mode 100644
index 08077049..00000000
--- a/deploy/adapters/ansible/roles/open-contrail/templates/neutron_plugin_contrail.tar.gz
+++ /dev/null
Binary files differ
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/nova_contrail_vif.tar.gz b/deploy/adapters/ansible/roles/open-contrail/templates/nova_contrail_vif.tar.gz
deleted file mode 100644
index 78dac037..00000000
--- a/deploy/adapters/ansible/roles/open-contrail/templates/nova_contrail_vif.tar.gz
+++ /dev/null
Binary files differ
diff --git a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml
index 6facb475..582e41e8 100755
--- a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml
@@ -17,6 +17,9 @@ contrail_keystone_address: "{{ public_vip.ip }}"
contrail_admin_user: "admin"
contrail_admin_password: "console"
+neutron_plugin: neutron_plugin_contrail.tar.gz
+nova_plugin: nova_contrail_vif.tar.gz
+
# network infor adapter for compass
# contrail_address: "{{ internal_ip }}"