summaryrefslogtreecommitdiffstats
path: root/xci/installer/osa/playbooks
diff options
context:
space:
mode:
Diffstat (limited to 'xci/installer/osa/playbooks')
-rw-r--r--xci/installer/osa/playbooks/bootstrap-scenarios.yml27
-rw-r--r--xci/installer/osa/playbooks/configure-opnfvhost.yml96
-rw-r--r--xci/installer/osa/playbooks/configure-targethosts.yml22
3 files changed, 76 insertions, 69 deletions
diff --git a/xci/installer/osa/playbooks/bootstrap-scenarios.yml b/xci/installer/osa/playbooks/bootstrap-scenarios.yml
deleted file mode 100644
index 975c85c1..00000000
--- a/xci/installer/osa/playbooks/bootstrap-scenarios.yml
+++ /dev/null
@@ -1,27 +0,0 @@
----
-#
-# This file is aimed to be used by scenarios to plug into the XCI.
-# Ideally, all they need to do at this point is to include their
-# role using a statement like the following one
-#
-# - name: Include foobar role
-# include_role:
-# name: "foobar"
-# when: DEPLOY_SCENARIO == "foobar"
-
-- name: Prepare everything to run the os-nosdn-nofeature scenario
- include_role:
- name: "os-nosdn-nofeature"
- when: DEPLOY_SCENARIO == 'os-nosdn-nofeature'
-- name: Prepare everything to run the os-odl-nofeature scenario
- include_role:
- name: "os-odl-nofeature"
- when: DEPLOY_SCENARIO == 'os-odl-nofeature'
-- name: Prepare everything to run the os-odl-sfc scenario
- include_role:
- name: "os-odl-sfc"
- when: DEPLOY_SCENARIO == 'os-odl-sfc'
-- name: Prepare everything to run the os-odl-bgpvpn scenario
- include_role:
- name: "os-odl-bgpvpn"
- when: DEPLOY_SCENARIO == 'os-odl-bgpvpn'
diff --git a/xci/installer/osa/playbooks/configure-opnfvhost.yml b/xci/installer/osa/playbooks/configure-opnfvhost.yml
index 4c30f4d1..47e9a65f 100644
--- a/xci/installer/osa/playbooks/configure-opnfvhost.yml
+++ b/xci/installer/osa/playbooks/configure-opnfvhost.yml
@@ -10,25 +10,37 @@
- hosts: opnfv
remote_user: root
vars_files:
- - "{{ XCI_PATH }}/xci/var/opnfv.yml"
- - "{{ XCI_PATH }}/xci/installer/osa/files/openstack_services.yml"
+ - "{{ xci_path }}/xci/var/opnfv.yml"
+ - "{{ xci_path }}/xci/installer/osa/files/openstack_services.yml"
+ environment:
+ http_proxy: "{{ lookup('env','http_proxy') }}"
+ https_proxy: "{{ lookup('env','https_proxy') }}"
+ no_proxy: "{{ lookup('env','no_proxy') }}"
+ HTTP_PROXY: "{{ lookup('env','http_proxy') }}"
+ HTTPS_PROXY: "{{ lookup('env','https_proxy') }}"
+ NO_PROXY: "{{ lookup('env','no_proxy') }}"
pre_tasks:
- name: Load distribution variables
include_vars:
file: "{{ item }}"
with_items:
- - "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml"
- - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/flavor-vars.yml"
+ - "{{ xci_path }}/xci/var/{{ ansible_os_family }}.yml"
+ - "{{ xci_flavor_ansible_file_path }}/flavor-vars.yml"
- name: Set facts for remote deployment
set_fact:
remote_xci_path: "{{ ansible_env.HOME }}/releng-xci"
- remote_xci_flavor_files: "{{ ansible_env.HOME }}/releng-xci/xci/installer/{{INSTALLER_TYPE}}/files/{{ XCI_FLAVOR }}"
+ remote_xci_flavor_files: "{{ ansible_env.HOME }}/releng-xci/xci/installer/{{installer_type}}/files/{{ xci_flavor }}"
remote_xci_playbooks: "{{ ansible_env.HOME }}/releng-xci/xci/playbooks"
roles:
- role: bootstrap-host
- configure_network: XCI_FLAVOR != 'aio'
+ configure_network: xci_flavor != 'aio'
+ - role: peru.proxy_settings
+ proxy_settings_http_proxy: "{{ lookup('env','http_proxy') }}"
+ proxy_settings_https_proxy: "{{ lookup('env','https_proxy') }}"
+ proxy_settings_ftp_proxy: "{{ lookup('env','ftp_proxy') }}"
+ proxy_settings_no_proxy: "{{ lookup('env','no_proxy') }}"
tasks:
- name: generate SSH keys
@@ -38,61 +50,71 @@
- name: fetch public key
fetch:
src: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
- dest: "{{ XCI_PATH }}/xci/files/authorized_keys"
+ dest: "{{ xci_path }}/xci/files/authorized_keys"
flat: yes
- name: Copy releng-xci to remote host
synchronize:
- src: "{{ XCI_PATH }}/"
+ src: "{{ xci_path }}/"
dest: "{{ remote_xci_path }}"
recursive: yes
delete: yes
- name: copy flavor inventory
shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/inventory {{ remote_xci_playbooks }}"
- name: copy openstack_deploy
- shell: "/bin/cp -rf {{OPENSTACK_OSA_PATH}}/etc/openstack_deploy {{OPENSTACK_OSA_ETC_PATH}}"
+ shell: "/bin/cp -rf {{openstack_osa_path}}/etc/openstack_deploy {{openstack_osa_etc_path}}"
- name: copy openstack_user_config.yml
- shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/openstack_user_config.yml {{OPENSTACK_OSA_ETC_PATH}}"
+ shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/openstack_user_config.yml {{openstack_osa_etc_path}}"
failed_when: false
- name: copy all user override files
- shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/user_variables.yml {{OPENSTACK_OSA_ETC_PATH}}"
+ shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/user_variables.yml {{openstack_osa_etc_path}}"
failed_when: false
- name: copy cinder.yml
- shell: "/bin/cp -rf {{ remote_xci_path }}/xci/installer/osa/files/cinder.yml {{OPENSTACK_OSA_ETC_PATH}}/env.d"
+ shell: "/bin/cp -rf {{ remote_xci_path }}/xci/installer/osa/files/cinder.yml {{openstack_osa_etc_path}}/env.d"
- name: Configure OpenStack-Ansible components
lineinfile:
- path: "{{ OPENSTACK_OSA_ETC_PATH }}/user_variables.yml"
+ path: "{{ openstack_osa_etc_path }}/user_variables.yml"
line: "{{ item.component }}: {{ item.value }}"
state: present
with_items:
- - { component: "tempest_install", value: "{{ RUN_TEMPEST | bool }}" }
- - { component: "tempest_run", value: "{{ RUN_TEMPEST | bool }}" }
- - { component: "core_openstack", value: "{{ CORE_OPENSTACK_INSTALL | bool }}" }
+ - { component: "tempest_install", value: "{{ run_tempest | bool }}" }
+ - { component: "tempest_run", value: "{{ run_tempest | bool }}" }
+ - { component: "core_openstack", value: "{{ core_openstack_install | bool }}" }
- block:
- name: copy ceph.yml
- shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/ceph.yml {{OPENSTACK_OSA_ETC_PATH}}/conf.d/"
+ shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/ceph.yml {{openstack_osa_etc_path}}/conf.d/"
- name: copy user_ceph.yml
- shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/user_ceph.yml {{OPENSTACK_OSA_ETC_PATH}}/user_ceph.yml"
+ shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/user_ceph.yml {{openstack_osa_etc_path}}/user_ceph.yml"
- name: copy user_variables_ceph.yml
- shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/user_variables_ceph.yml {{OPENSTACK_OSA_ETC_PATH}}/user_variables_ceph.yml"
- when: XCI_CEPH_ENABLED == "true"
+ shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/user_variables_ceph.yml {{openstack_osa_etc_path}}/user_variables_ceph.yml"
+ when: xci_ceph_enabled == "true"
+ - block:
+ - name: copy user_variables_proxy.yml
+ shell: "/bin/cp -rf {{ remote_xci_path }}/xci/installer/osa/files/user_variables_proxy.yml {{openstack_osa_etc_path}}/user_variables_proxy.yml"
+ - name: "Configure http_proxy_env_url"
+ lineinfile:
+ path: "{{openstack_osa_etc_path}}/user_variables_proxy.yml"
+ regexp: "^http_proxy_env_url:.*"
+ line: "{{ 'http_proxy_env_url: ' + lookup('env','http_proxy') }}"
+ when:
+ - lookup('env','http_proxy') != "randomfoobarstring"
- name: copy OPNFV OpenStack playbook
- shell: "/bin/cp -rf {{ remote_xci_path }}/xci/installer/osa/files/setup-openstack.yml {{OPENSTACK_OSA_PATH}}/playbooks"
+ shell: "/bin/cp -rf {{ remote_xci_path }}/xci/installer/osa/files/setup-openstack.yml {{openstack_osa_path}}/playbooks"
- name: copy pinned versions of OSA Roles and global requirements
- shell: "/bin/cp -rf {{ remote_xci_path }}/xci/installer/osa/files/{{ item }} {{OPENSTACK_OSA_PATH}}/{{ item }}"
+ shell: "/bin/cp -rf {{ remote_xci_path }}/xci/installer/osa/files/{{ item }} {{openstack_osa_path}}/{{ item }}"
with_items:
- "ansible-role-requirements.yml"
- "global-requirement-pins.txt"
when:
- - OPENSTACK_OSA_VERSION != "master"
+ - openstack_osa_version != "master"
- name: copy pinned versions of OpenStack services
- shell: "/bin/cp -rf {{ remote_xci_path }}/xci/installer/osa/files/openstack_services.yml {{OPENSTACK_OSA_PATH}}/playbooks/defaults/repo_packages/openstack_services.yml"
+ shell: "/bin/cp -rf {{ remote_xci_path }}/xci/installer/osa/files/openstack_services.yml {{openstack_osa_path}}/playbooks/defaults/repo_packages/openstack_services.yml"
when:
- - OPENSTACK_OSA_VERSION != "master"
- - include: bootstrap-scenarios.yml
+ - openstack_osa_version != "master"
+ - include: "{{ xci_path }}/xci/playbooks/bootstrap-scenarios.yml"
- name: bootstrap ansible on opnfv host
command: "/bin/bash ./scripts/bootstrap-ansible.sh"
args:
- chdir: "{{OPENSTACK_OSA_PATH}}"
+ chdir: "{{openstack_osa_path}}"
- name: install opnfv pip required packages
pip:
name: "{{ item }}"
@@ -103,9 +125,9 @@
- python-neutronclient
- python-openstackclient
- name: generate password token
- command: "python pw-token-gen.py --file {{OPENSTACK_OSA_ETC_PATH}}/user_secrets.yml"
+ command: "python pw-token-gen.py --file {{openstack_osa_etc_path}}/user_secrets.yml"
args:
- chdir: "{{OPENSTACK_OSA_PATH}}/scripts"
+ chdir: "{{openstack_osa_path}}/scripts"
- name: check if certificate directory /etc/ssl/certs exists already
stat: path=/etc/ssl/certs
register: check_etc_ssl_certs
@@ -132,7 +154,7 @@
become: true
- name: fetch xci environment
copy:
- src: "{{ XCI_PATH }}/.cache/xci.env"
+ src: "{{ xci_path }}/.cache/xci.env"
dest: /root/xci.env
- hosts: localhost
@@ -140,12 +162,12 @@
tasks:
- name: Append public keys to authorized_keys
- shell: "/bin/cat {{ ansible_env.HOME }}/.ssh/id_rsa.pub >> {{ XCI_PATH }}/xci/files/authorized_keys"
+ shell: "/bin/cat {{ ansible_env.HOME }}/.ssh/id_rsa.pub >> {{ xci_path }}/xci/files/authorized_keys"
- hosts: opnfv
remote_user: root
vars_files:
- - "{{ XCI_PATH }}/xci/var/opnfv.yml"
+ - "{{ xci_path }}/xci/var/opnfv.yml"
pre_tasks:
- name: Load distribution variables
@@ -153,9 +175,9 @@
file: "{{ item }}"
failed_when: false
with_items:
- - "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml"
- - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/flavor-vars.yml"
- - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/user_variables.yml"
+ - "{{ xci_path }}/xci/var/{{ ansible_os_family }}.yml"
+ - "{{ xci_flavor_ansible_file_path }}/flavor-vars.yml"
+ - "{{ xci_flavor_ansible_file_path }}/user_variables.yml"
roles:
- role: "openstack-ansible-openstack_openrc"
@@ -169,10 +191,10 @@
- name: fetch generated openrc
fetch:
src: "{{ ansible_env.HOME }}/openrc"
- dest: "{{ XCI_PATH }}/.cache/openrc"
+ dest: "{{ xci_path }}/.cache/openrc"
flat: true
- name: add public key to host
copy:
- src: "{{ XCI_PATH }}/xci/files/authorized_keys"
+ src: "{{ xci_path }}/xci/files/authorized_keys"
dest: /root/.ssh/authorized_keys
diff --git a/xci/installer/osa/playbooks/configure-targethosts.yml b/xci/installer/osa/playbooks/configure-targethosts.yml
index 31c3e02e..09258e7c 100644
--- a/xci/installer/osa/playbooks/configure-targethosts.yml
+++ b/xci/installer/osa/playbooks/configure-targethosts.yml
@@ -1,27 +1,39 @@
---
- hosts: openstack
+ environment:
+ http_proxy: "{{ lookup('env','http_proxy') }}"
+ https_proxy: "{{ lookup('env','https_proxy') }}"
+ no_proxy: "{{ lookup('env','no_proxy') }}"
+ HTTP_PROXY: "{{ lookup('env','http_proxy') }}"
+ HTTPS_PROXY: "{{ lookup('env','https_proxy') }}"
+ NO_PROXY: "{{ lookup('env','no_proxy') }}"
remote_user: root
vars_files:
- - "{{ XCI_PATH }}/xci/var/opnfv.yml"
+ - "{{ xci_path }}/xci/var/opnfv.yml"
pre_tasks:
- name: Load distribution variables
include_vars:
file: "{{ item }}"
with_items:
- - "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml"
- - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/flavor-vars.yml"
+ - "{{ xci_path }}/xci/var/{{ ansible_os_family }}.yml"
+ - "{{ xci_flavor_ansible_file_path }}/flavor-vars.yml"
roles:
+ - role: peru.proxy_settings
+ proxy_settings_http_proxy: "{{ lookup('env','http_proxy') }}"
+ proxy_settings_https_proxy: "{{ lookup('env','https_proxy') }}"
+ proxy_settings_ftp_proxy: "{{ lookup('env','ftp_proxy') }}"
+ proxy_settings_no_proxy: "{{ lookup('env','no_proxy') }}"
- role: bootstrap-host
- role: configure-nfs
when:
- "'compute' in group_names"
- role: configure-ceph
when:
- - XCI_CEPH_ENABLED == "true"
+ - xci_ceph_enabled == "true"
- "'compute' in group_names"
tasks:
- name: add public key to host
copy:
- src: "{{ XCI_PATH }}/xci/files/authorized_keys"
+ src: "{{ xci_path }}/xci/files/authorized_keys"
dest: /root/.ssh/authorized_keys