summaryrefslogtreecommitdiffstats
path: root/prototypes/xci/playbooks
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-08-16 12:09:58 +0200
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-08-16 12:11:23 +0200
commit878fdf4f0b0c9cbe416adacf001844c0aa6d3b0f (patch)
tree48bb145f56af77292a5e0cc5dc19c403ce878904 /prototypes/xci/playbooks
parentf21b646f8d2045179230c18a301b6e12699d4e80 (diff)
xci: Remove prototypes directory due to migration to releng-xci repo
Change-Id: I3b8a1dff64151dc55f05e621bab61f2b214bfd05 Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'prototypes/xci/playbooks')
-rw-r--r--prototypes/xci/playbooks/configure-localhost.yml59
-rw-r--r--prototypes/xci/playbooks/configure-opnfvhost.yml109
-rw-r--r--prototypes/xci/playbooks/configure-targethosts.yml36
-rw-r--r--prototypes/xci/playbooks/inventory10
-rw-r--r--prototypes/xci/playbooks/provision-vm-nodes.yml88
-rw-r--r--prototypes/xci/playbooks/roles/clone-repository/tasks/main.yml14
-rw-r--r--prototypes/xci/playbooks/roles/configure-network/tasks/main.yml34
-rw-r--r--prototypes/xci/playbooks/roles/configure-nfs/tasks/main.yml43
-rw-r--r--prototypes/xci/playbooks/roles/remove-folders/tasks/main.yml21
-rw-r--r--prototypes/xci/playbooks/roles/synchronize-time/tasks/main.yml18
10 files changed, 0 insertions, 432 deletions
diff --git a/prototypes/xci/playbooks/configure-localhost.yml b/prototypes/xci/playbooks/configure-localhost.yml
deleted file mode 100644
index b6d0fccb7..000000000
--- a/prototypes/xci/playbooks/configure-localhost.yml
+++ /dev/null
@@ -1,59 +0,0 @@
----
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2017 Ericsson AB 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
-##############################################################################
-- hosts: localhost
- connection: local
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/opnfv.yml
- roles:
- - role: remove-folders
- - { role: clone-repository, project: "opnfv/releng", repo: "{{ OPNFV_RELENG_GIT_URL }}", dest: "{{ OPNFV_RELENG_PATH }}", version: "{{ OPNFV_RELENG_VERSION }}" }
-
-- hosts: localhost
- connection: local
- gather_facts: false
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/opnfv.yml
- tasks:
- - name: Synchronize local development releng repository to XCI paths
- synchronize:
- src: "{{ OPNFV_RELENG_DEV_PATH }}"
- dest: "{{ OPNFV_RELENG_PATH }}"
- recursive: yes
- delete: yes
- when:
- - OPNFV_RELENG_DEV_PATH != ""
-
-- hosts: localhost
- connection: local
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/opnfv.yml
- tasks:
- - name: create log directory {{LOG_PATH}}
- file:
- path: "{{LOG_PATH}}"
- state: directory
- recurse: no
- # when the deployment is aio, we overwrite and use playbook, configure-opnfvhost.yml, since everything gets installed on opnfv host
- - name: copy aio playbook
- copy:
- src: "{{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/configure-opnfvhost.yml"
- dest: "{{OPNFV_RELENG_PATH}}/prototypes/xci/playbooks"
- when: XCI_FLAVOR == "aio"
- - name: copy flavor inventory
- copy:
- src: "{{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/inventory"
- dest: "{{OPNFV_RELENG_PATH}}/prototypes/xci/playbooks"
- - name: copy flavor vars
- copy:
- src: "{{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/flavor-vars.yml"
- dest: "{{OPNFV_RELENG_PATH}}/prototypes/xci/var"
diff --git a/prototypes/xci/playbooks/configure-opnfvhost.yml b/prototypes/xci/playbooks/configure-opnfvhost.yml
deleted file mode 100644
index a7ce5216c..000000000
--- a/prototypes/xci/playbooks/configure-opnfvhost.yml
+++ /dev/null
@@ -1,109 +0,0 @@
----
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2017 Ericsson AB 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
-##############################################################################
-- hosts: opnfv
- remote_user: root
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/flavor-vars.yml
- - ../var/opnfv.yml
- roles:
- - role: remove-folders
- - { role: clone-repository, project: "opnfv/releng", repo: "{{ OPNFV_RELENG_GIT_URL }}", dest: "{{ OPNFV_RELENG_PATH }}", version: "{{ OPNFV_RELENG_VERSION }}" }
- - { role: clone-repository, project: "openstack/openstack-ansible", repo: "{{ OPENSTACK_OSA_GIT_URL }}", dest: "{{ OPENSTACK_OSA_PATH }}", version: "{{ OPENSTACK_OSA_VERSION }}" }
-
-- hosts: opnfv
- remote_user: root
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/opnfv.yml
- tasks:
- - name: Synchronize local development releng repository to XCI paths
- synchronize:
- src: "{{ OPNFV_RELENG_DEV_PATH }}"
- dest: "{{ OPNFV_RELENG_PATH }}"
- recursive: yes
- delete: yes
- when:
- - OPNFV_RELENG_DEV_PATH != ""
- - name: Synchronize local development openstack-ansible repository to XCI paths
- synchronize:
- src: "{{ OPENSTACK_OSA_DEV_PATH }}"
- dest: "{{ OPENSTACK_OSA_PATH }}"
- recursive: yes
- delete: yes
- when:
- - OPENSTACK_OSA_DEV_PATH != ""
-
-- hosts: opnfv
- remote_user: root
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/flavor-vars.yml
- - ../var/opnfv.yml
- roles:
- # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros
- - { role: configure-network, when: ansible_distribution_release == "xenial", src: "../template/opnfv.interface.j2", dest: "/etc/network/interfaces" }
- tasks:
- - name: generate SSH keys
- shell: ssh-keygen -b 2048 -t rsa -f /root/.ssh/id_rsa -q -N ""
- args:
- creates: /root/.ssh/id_rsa
- - name: ensure ssh key storage directory exists
- file:
- path: "{{ OPNFV_SSH_HOST_KEYS_PATH }}"
- state: directory
- - name: fetch public key
- fetch: src="/root/.ssh/id_rsa.pub" dest="{{ OPNFV_SSH_HOST_KEYS_PATH }}"
- - name: copy flavor inventory
- shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/inventory {{OPNFV_RELENG_PATH}}/prototypes/xci/playbooks"
- - name: copy flavor vars
- shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/flavor-vars.yml {{OPNFV_RELENG_PATH}}/prototypes/xci/var"
- - name: copy openstack_deploy
- shell: "/bin/cp -rf {{OPENSTACK_OSA_PATH}}/etc/openstack_deploy {{OPENSTACK_OSA_ETC_PATH}}"
- - name: copy openstack_user_config.yml
- shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/openstack_user_config.yml {{OPENSTACK_OSA_ETC_PATH}}"
- - name: copy user_variables.yml
- shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/user_variables.yml {{OPENSTACK_OSA_ETC_PATH}}"
- - name: copy cinder.yml
- shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/cinder.yml {{OPENSTACK_OSA_ETC_PATH}}/env.d"
- # TODO: We need to get rid of this as soon as the issue is fixed upstream
- - name: change the haproxy state from disable to enable
- replace:
- dest: "{{OPENSTACK_OSA_PATH}}/playbooks/os-keystone-install.yml"
- regexp: '(\s+)haproxy_state: disabled'
- replace: '\1haproxy_state: enabled'
- - name: copy OPNFV OpenStack playbook
- shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/setup-openstack.yml {{OPENSTACK_OSA_PATH}}/playbooks"
- - name: copy OPNFV role requirements
- shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/ansible-role-requirements.yml {{OPENSTACK_OSA_PATH}}"
- - name: bootstrap ansible on opnfv host
- command: "/bin/bash ./scripts/bootstrap-ansible.sh"
- args:
- chdir: "{{OPENSTACK_OSA_PATH}}"
- - name: install python Crypto module
- package:
- name: "{{ python_crypto_package_name }}"
- - name: install PyYAML
- pip:
- name: pyyaml
- state: present
- - name: generate password token
- command: "python pw-token-gen.py --file {{OPENSTACK_OSA_ETC_PATH}}/user_secrets.yml"
- args:
- chdir: "{{OPENSTACK_OSA_PATH}}/scripts"
-- hosts: localhost
- remote_user: root
- vars_files:
- - ../var/opnfv.yml
- tasks:
- - name: Generate authorized_keys
- shell: "/bin/cat {{ OPNFV_SSH_HOST_KEYS_PATH }}/opnfv/root/.ssh/id_rsa.pub >> ../file/authorized_keys"
- - name: Append public keys to authorized_keys
- shell: "/bin/cat {{ ansible_env.HOME }}/.ssh/id_rsa.pub >> ../file/authorized_keys"
diff --git a/prototypes/xci/playbooks/configure-targethosts.yml b/prototypes/xci/playbooks/configure-targethosts.yml
deleted file mode 100644
index 50da1f223..000000000
--- a/prototypes/xci/playbooks/configure-targethosts.yml
+++ /dev/null
@@ -1,36 +0,0 @@
----
-- hosts: all
- remote_user: root
- tasks:
- - name: add public key to host
- copy:
- src: ../file/authorized_keys
- dest: /root/.ssh/authorized_keys
-
-- hosts: controller
- remote_user: root
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/flavor-vars.yml
- roles:
- # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros
- - { role: configure-network, src: "../template/controller.interface.j2", dest: "/etc/network/interfaces" }
- # we need to force sync time with ntp or the nodes will be out of sync timewise
- - role: synchronize-time
-
-- hosts: compute
- remote_user: root
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/flavor-vars.yml
- roles:
- # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros
- - { role: configure-network, src: "../template/compute.interface.j2", dest: "/etc/network/interfaces" }
- # we need to force sync time with ntp or the nodes will be out of sync timewise
- - role: synchronize-time
-
-- hosts: compute00
- remote_user: root
- # TODO: this role is for configuring NFS on xenial and adjustment needed for other distros
- roles:
- - role: configure-nfs
diff --git a/prototypes/xci/playbooks/inventory b/prototypes/xci/playbooks/inventory
deleted file mode 100644
index fd9af9016..000000000
--- a/prototypes/xci/playbooks/inventory
+++ /dev/null
@@ -1,10 +0,0 @@
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2017 Ericsson AB 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
-##############################################################################
-[opnfv]
-opnfv ansible_ssh_host=192.168.122.2
diff --git a/prototypes/xci/playbooks/provision-vm-nodes.yml b/prototypes/xci/playbooks/provision-vm-nodes.yml
deleted file mode 100644
index 92b5c5535..000000000
--- a/prototypes/xci/playbooks/provision-vm-nodes.yml
+++ /dev/null
@@ -1,88 +0,0 @@
----
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2017 Ericsson AB 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
-##############################################################################
-- hosts: localhost
- connection: local
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/opnfv.yml
- roles:
- # using these roles here ensures that we can reuse this playbook in different context
- - role: remove-folders
- - { role: clone-repository, project: "opnfv/releng", repo: "{{ OPNFV_RELENG_GIT_URL }}", dest: "{{ OPNFV_RELENG_PATH }}", version: "{{ OPNFV_RELENG_VERSION }}" }
- - { role: clone-repository, project: "opnfv/bifrost", repo: "{{ OPENSTACK_BIFROST_GIT_URL }}", dest: "{{ OPENSTACK_BIFROST_PATH }}", version: "{{ OPENSTACK_BIFROST_VERSION }}" }
-
-- hosts: localhost
- connection: local
- gather_facts: false
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/opnfv.yml
- tasks:
- - name: Synchronize local development bifrost repository to XCI paths
- # command module is much faster than the copy module
- synchronize:
- src: "{{ OPENSTACK_BIFROST_DEV_PATH }}"
- dest: "{{ OPENSTACK_BIFROST_PATH }}"
- recursive: yes
- delete: yes
- when:
- - OPENSTACK_BIFROST_DEV_PATH != ""
- - name: Synchronize local development releng repository to XCI paths
- synchronize:
- src: "{{ OPNFV_RELENG_DEV_PATH }}"
- dest: "{{ OPNFV_RELENG_PATH }}"
- recursive: yes
- delete: yes
- when:
- - OPNFV_RELENG_DEV_PATH != ""
- - name: Copy extra vars to releng and bifrost
- synchronize:
- src: "{{ XCI_EXTRA_VARS_PATH }}"
- dest: "{{ item }}"
- with_items:
- - "{{ OPNFV_RELENG_PATH }}/prototypes/xci/playbooks"
- - "{{ OPENSTACK_BIFROST_PATH }}/playbooks/inventory"
- when:
- - XCI_EXTRA_VARS_PATH != ""
-
-- hosts: localhost
- connection: local
- gather_facts: false
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/opnfv.yml
- tasks:
- - name: combine opnfv/releng and openstack/bifrost scripts/playbooks
- copy:
- src: "{{ OPNFV_RELENG_PATH }}/prototypes/bifrost/"
- dest: "{{ OPENSTACK_BIFROST_PATH }}"
-
-- hosts: localhost
- connection: local
- become: yes
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/opnfv.yml
- tasks:
- - name: destroy VM nodes created by previous deployment
- command: "/bin/bash ./scripts/destroy-env.sh"
- args:
- chdir: "{{ OPENSTACK_BIFROST_PATH }}"
-
-- hosts: localhost
- connection: local
- vars_files:
- - ../var/{{ ansible_os_family }}.yml
- - ../var/opnfv.yml
- tasks:
- - name: create and provision VM nodes for the flavor {{ XCI_FLAVOR }}
- command: "/bin/bash ./scripts/bifrost-provision.sh"
- args:
- chdir: "{{ OPENSTACK_BIFROST_PATH }}"
diff --git a/prototypes/xci/playbooks/roles/clone-repository/tasks/main.yml b/prototypes/xci/playbooks/roles/clone-repository/tasks/main.yml
deleted file mode 100644
index 3f7e09103..000000000
--- a/prototypes/xci/playbooks/roles/clone-repository/tasks/main.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2017 Ericsson AB 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: clone "{{ project }}" and checkout "{{ version }}"
- git:
- repo: "{{ repo }}"
- dest: "{{ dest }}"
- version: "{{ version }}"
diff --git a/prototypes/xci/playbooks/roles/configure-network/tasks/main.yml b/prototypes/xci/playbooks/roles/configure-network/tasks/main.yml
deleted file mode 100644
index aafadf712..000000000
--- a/prototypes/xci/playbooks/roles/configure-network/tasks/main.yml
+++ /dev/null
@@ -1,34 +0,0 @@
----
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2017 Ericsson AB 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
-##############################################################################
-# TODO: this role needs to be adjusted for different distros
-- block:
- - name: configure modules
- lineinfile:
- dest: /etc/modules
- state: present
- create: yes
- line: "8021q"
- - name: add modules
- modprobe:
- name: 8021q
- state: present
- - name: ensure glean rules are removed
- file:
- path: "/etc/udev/rules.d/99-glean.rules"
- state: absent
- - name: ensure interfaces.d folder is empty
- shell: "/bin/rm -rf /etc/network/interfaces.d/*"
- - name: ensure interfaces file is updated
- template:
- src: "{{ src }}"
- dest: "{{ dest }}"
- - name: restart network service
- shell: "/sbin/ifconfig {{ interface }} 0 && /sbin/ifdown -a && /sbin/ifup -a"
- when: ansible_distribution_release == "xenial"
diff --git a/prototypes/xci/playbooks/roles/configure-nfs/tasks/main.yml b/prototypes/xci/playbooks/roles/configure-nfs/tasks/main.yml
deleted file mode 100644
index c52da0bf3..000000000
--- a/prototypes/xci/playbooks/roles/configure-nfs/tasks/main.yml
+++ /dev/null
@@ -1,43 +0,0 @@
----
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2017 Ericsson AB 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
-##############################################################################
-# TODO: this is for xenial and needs to be adjusted for different distros
-- block:
- - name: make NFS directories
- file:
- dest: "{{ item }}"
- mode: 0777
- state: directory
- with_items:
- - "/images"
- - "/volumes"
- - name: configure NFS service
- lineinfile:
- dest: /etc/services
- state: present
- create: yes
- line: "{{ item }}"
- with_items:
- - "nfs 2049/tcp"
- - "nfs 2049/udp"
- - name: configure NFS exports
- lineinfile:
- dest: /etc/exports
- state: present
- create: yes
- line: "{{ item }}"
- with_items:
- - "/images *(rw,sync,no_subtree_check,no_root_squash)"
- - "/volumes *(rw,sync,no_subtree_check,no_root_squash)"
- # TODO: the service name might be different on other distros and needs to be adjusted
- - name: restart ubuntu xenial NFS service
- service:
- name: nfs-kernel-server
- state: restarted
- when: ansible_distribution_release == "xenial"
diff --git a/prototypes/xci/playbooks/roles/remove-folders/tasks/main.yml b/prototypes/xci/playbooks/roles/remove-folders/tasks/main.yml
deleted file mode 100644
index 425b8dbf4..000000000
--- a/prototypes/xci/playbooks/roles/remove-folders/tasks/main.yml
+++ /dev/null
@@ -1,21 +0,0 @@
----
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2017 Ericsson AB 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: cleanup leftovers of previous deployment
- file:
- path: "{{ item }}"
- state: absent
- recurse: no
- with_items:
- - "{{ OPNFV_RELENG_PATH }}"
- - "{{ OPENSTACK_BIFROST_PATH }}"
- - "{{ OPENSTACK_OSA_PATH }}"
- - "{{ OPENSTACK_OSA_ETC_PATH }}"
- - "{{ LOG_PATH }} "
- - "{{ OPNFV_SSH_HOST_KEYS_PATH }}"
diff --git a/prototypes/xci/playbooks/roles/synchronize-time/tasks/main.yml b/prototypes/xci/playbooks/roles/synchronize-time/tasks/main.yml
deleted file mode 100644
index 5c39d897b..000000000
--- a/prototypes/xci/playbooks/roles/synchronize-time/tasks/main.yml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2017 Ericsson AB 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
-##############################################################################
-# TODO: this role needs to be adjusted for different distros
-- block:
- - name: restart chrony
- service:
- name: chrony
- state: restarted
- - name: synchronize time
- shell: "chronyc -a 'burst 4/4' && chronyc -a makestep"
- when: ansible_distribution_release == "xenial"