aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/install
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail/tasks/install')
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml16
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml84
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml47
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml24
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml24
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml17
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml22
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml51
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml18
9 files changed, 303 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml
new file mode 100755
index 00000000..02bc7f81
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml
@@ -0,0 +1,16 @@
+---
+#- hosts: collector
+# sudo: yes
+# tasks:
+
+- name: "temporary disable supervisor analytics"
+ template:
+# src: "templates/override.j2"
+ src: "install/override.j2"
+ dest: "/etc/init/supervisor-analytics.override"
+
+- name: "install contrail openstack analytics package"
+# apt:
+# name: "contrail-openstack-analytics"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: collector_packages
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml
new file mode 100755
index 00000000..ea08e49b
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml
@@ -0,0 +1,84 @@
+---
+#- hosts: all
+# sudo: yes
+# tasks:
+- name: "copy contrail install package temporary"
+# sudo: True
+ copy:
+ src: "files/{{ package }}"
+ dest: "/tmp/{{ package }}"
+
+- name: "install contrail install package"
+# sudo: True
+ apt:
+ deb: "/tmp/{{ package }}"
+
+- name: "delete temporary contrail install package"
+# sudo: True
+ file:
+ dest: "/tmp/{{ package }}"
+ state: "absent"
+
+- name: "make directory for contrail binary files"
+# sudo: True
+ file:
+ path: "/opt/contrail/bin"
+ state: "directory"
+
+- name: "make directory for contrail repository"
+# sudo: True
+ file:
+ path: "/opt/contrail/contrail_install_repo"
+ state: "directory"
+
+- name: "unarchive contrail packages"
+# sudo: True
+ unarchive:
+ src: "/opt/contrail/contrail_packages/contrail_debs.tgz"
+ dest: "/opt/contrail/contrail_install_repo"
+ copy: no
+
+- name: "find required packages in advance"
+# sudo: True
+ shell: "find /opt/contrail/contrail_install_repo -name binutils_*.deb -or -name make_*.deb -or -name libdpkg-perl_*.deb -or -name dpkg-dev_*.deb -or -name patch_*.deb -type f"
+ register: required_packages
+ changed_when: no
+
+- name: "install required packages"
+# sudo: True
+ apt:
+ deb: "{{ item }}"
+ with_items: required_packages.stdout_lines
+
+- name: modify source list
+# sudo: True
+ lineinfile:
+ dest: "/etc/apt/sources.list"
+ line: "deb file:/opt/contrail/contrail_install_repo ./"
+ insertbefore: "BOF"
+
+- name: "modify apt configuration"
+# sudo: True
+ lineinfile:
+ dest: "/etc/apt/apt.conf"
+ line: "APT::Get::AllowUnauthenticated \"true\";"
+ create: "yes"
+
+- name: "copy apt preferences file"
+# sudo: True
+ shell: "cp /opt/contrail/contrail_packages/preferences /etc/apt/preferences"
+ args:
+ creates: "/etc/apt/preferences"
+
+- name: create contrail packages list
+# sudo: True
+ shell: "dpkg-scanpackages . | gzip -9c > Packages.gz"
+ args:
+ chdir: "/opt/contrail/contrail_install_repo"
+ creates: "Packages.gz"
+
+- name: install contrail setup package
+ sudo: True
+ apt:
+ name: "contrail-setup"
+ update_cache: yes
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml
new file mode 100755
index 00000000..12b6ad28
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml
@@ -0,0 +1,47 @@
+---
+#- hosts: [compute, tsn]
+# sudo: yes
+# tasks:
+- name: "temporary disable supervisor vrouter"
+# sudo: True
+ template:
+ src: "install/override.j2"
+ dest: "/etc/init/supervisor-vrouter.override"
+
+# - name: "install nova-compute for contrail package"
+# apt:
+# name: "nova-compute"
+# when: install_nova
+
+- name: "install contrail vrouter 3.13.0-40 package"
+# apt:
+# name: "contrail-vrouter-3.13.0-40-generic"
+# when: ansible_kernel == "3.13.0-40-generic"
+# sudo: True
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: vrouter_packages
+ when: ansible_kernel == kernel_required
+
+- name: "install contrail vrouter dkms package"
+# apt:
+# name: "contrail-vrouter-dkms"
+# when: ansible_kernel != "3.13.0-40-generic"
+# sudo: True
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: dkms_packages
+ when: ansible_kernel != kernel_required
+
+# - name: "install contrail vrouter common package"
+# apt:
+# name: "contrail-vrouter-common"
+
+# - name: "install contrail nova vif package"
+# apt:
+# name: "contrail-nova-vif"
+
+- name: "install contrail vrouter common & nova vif package"
+# sudo: True
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: compute_packages | union(compute_packages_noarch)
+
+
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml
new file mode 100755
index 00000000..52459eb8
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml
@@ -0,0 +1,24 @@
+---
+#- hosts: config
+# sudo: yes
+# tasks:
+- name: "temporary disable supervisor config"
+# sudo: True
+ template:
+# src: "templates/override.j2"
+ src: "install/override.j2"
+ dest: "/etc/init/supervisor-config.override"
+
+- name: "temporary disable neutron server"
+# sudo: True
+ template:
+# src: "templates/override.j2"
+ src: "install/override.j2"
+ dest: "/etc/init/neutron-server.override"
+
+- name: "install contrail openstack config package"
+# sudo: True
+# apt:
+# name: "contrail-openstack-config"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: config_packages
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml
new file mode 100755
index 00000000..6bb7fb25
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml
@@ -0,0 +1,24 @@
+---
+#- hosts: control
+# sudo: yes
+# tasks:
+- name: "temporary disable supervisor control"
+# sudo: True
+ template:
+# src: "templates/override.j2"
+ src: "install/override.j2"
+ dest: "/etc/init/supervisor-control.override"
+
+- name: "temporary disable supervisor dns"
+# sudo: True
+ template:
+# src: "templates/override.j2"
+ src: "install/override.j2"
+ dest: "/etc/init/supervisor-dns.override"
+
+- name: "install contrail openstack control package"
+# sudo: True
+# apt:
+# name: "contrail-openstack-control"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: control_packages
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml
new file mode 100755
index 00000000..fea4cef7
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml
@@ -0,0 +1,17 @@
+---
+#- hosts: database
+# sudo: yes
+# tasks:
+- name: "temporary disable supervisor database"
+# sudo: True
+ template:
+# src: "templates/override.j2"
+ src: "install/override.j2"
+ dest: "/etc/init/supervisor-database.override"
+
+- name: "install contrail openstack database package"
+# sudo: True
+# apt:
+# name: "contrail-openstack-database"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: database_packages
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml
new file mode 100755
index 00000000..4e914749
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml
@@ -0,0 +1,22 @@
+---
+#- hosts: all
+# sudo: yes
+# tasks:
+- name: "configure interface"
+# sudo: True
+ lineinfile:
+ dest: "/etc/network/interfaces"
+ line: "{{ item }}"
+ with_items:
+ - "auto {{ contrail_device }}"
+ - "iface {{ contrail_device }} inet static"
+ - "\taddress {{ contrail_address }}"
+ - "\tnetmask {{ contrail_netmask }}"
+
+- name: "set interface address"
+# sudo: True
+ shell: "ifconfig {{ contrail_device }} {{ contrail_address }} netmask {{ contrail_netmask }}"
+
+- name: "up interface"
+# sudo: True
+ shell: "ifconfig {{ contrail_device }} up"
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml
new file mode 100755
index 00000000..6d4ca035
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml
@@ -0,0 +1,51 @@
+---
+#- hosts: all
+# sudo: yes
+# tasks:
+- name: "install Ubuntu kernel"
+# sudo: True
+# apt:
+# name: "linux-headers-3.13.0-40"
+# name: "linux-headers-3.13.0-40-generic"
+# name: "linux-image-3.13.0-40-generic"
+# name: "linux-image-extra-3.13.0-40-generic"
+# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: kernel_packages | union(kernel_packages_noarch)
+ when: (kernel_install) and (ansible_kernel != kernel_required)
+
+- name: "setup grub"
+# sudo: True
+ lineinfile:
+ dest: "/etc/default/grub"
+ regexp: "GRUB_DEFAULT=.*"
+ line: "GRUB_DEFAULT='Advanced options for Ubuntu>Ubuntu, with Linux 3.13.0-40-generic'"
+# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
+ when: (kernel_install) and (ansible_kernel != kernel_required)
+
+- name: "reflect grub"
+# sudo: True
+ shell: "update-grub2"
+# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
+ when: (kernel_install) and (ansible_kernel != kernel_required)
+
+- name: "reboot Server"
+# sudo: True
+ shell: "shutdown -r now"
+ async: 0
+ poll: 0
+ ignore_errors: true
+ notify: Wait for server to come back
+# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
+ when: (kernel_install) and (ansible_kernel != kernel_required)
+
+handlers:
+- name: "Wait for server to come back"
+ local_action:
+ module: wait_for
+ host={{ inventory_hostname }}
+ port=22
+ delay=30
+ timeout=600
+# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
+ when: (kernel_install) and (ansible_kernel != kernel_required)
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml
new file mode 100755
index 00000000..d66af675
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml
@@ -0,0 +1,18 @@
+---
+#- hosts: webui
+# sudo: yes
+# tasks:
+
+- name: "temporary disable supervisor webui"
+# sudo: True
+ template:
+# src: "templates/override.j2"
+ src: "install/override.j2"
+ dest: "/etc/init/supervisor-webui.override"
+
+- name: "install contrail openstack webui package"
+# sudo: True
+# apt:
+# name: "contrail-openstack-webui"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ with_items: webui_packages