From f93fc4fc70694d21f136ae1599b13fd237018b74 Mon Sep 17 00:00:00 2001 From: chigang Date: Tue, 4 Jul 2017 13:21:12 +0800 Subject: Fix keepalived ping address JIRA:- Replace OSA default address with ntp_server address. OSA will use it to check internet connection. Rename some roles that make users confused. Change-Id: I4dd7e242e427e5bc3a611450a3bc436e44a8fefe Signed-off-by: chigang --- .../ansible/openstack/HA-ansible-multinodes.yml | 8 +- .../adapters/ansible/roles/common/templates/hosts | 9 - .../roles/config-deployment/files/cinder.yml | 13 -- .../ansible/roles/config-deployment/files/http.yml | 17 -- .../files/os-flavor/tasks/main.yml | 17 -- .../files/os-flavor/vars/main.yml | 45 ---- .../roles/config-deployment/files/setup-ovs.yml | 57 ----- .../ansible/roles/config-deployment/tasks/main.yml | 58 ------ .../roles/config-deployment/templates/ansible.cfg | 3 - .../templates/create-flavor.yml.j2 | 15 -- .../templates/create-network.yml.j2 | 41 ---- .../templates/openstack_user_config.yml.j2 | 232 --------------------- .../templates/user_variables.yml.j2 | 47 ----- .../ansible/roles/config-osa/files/cinder.yml | 13 ++ .../ansible/roles/config-osa/files/http.yml | 17 ++ .../config-osa/files/os-flavor/tasks/main.yml | 17 ++ .../roles/config-osa/files/os-flavor/vars/main.yml | 45 ++++ .../ansible/roles/config-osa/files/setup-ovs.yml | 57 +++++ .../ansible/roles/config-osa/tasks/main.yml | 58 ++++++ .../ansible/roles/config-osa/templates/ansible.cfg | 3 + .../config-osa/templates/create-flavor.yml.j2 | 15 ++ .../config-osa/templates/create-network.yml.j2 | 41 ++++ .../templates/openstack_user_config.yml.j2 | 232 +++++++++++++++++++++ .../config-osa/templates/user_variables.yml.j2 | 48 +++++ .../ansible/roles/openstack-post/tasks/main.yml | 23 -- .../ansible/roles/openstack-post/vars/main.yml | 45 ---- .../ansible/roles/post-openstack/tasks/main.yml | 23 ++ .../ansible/roles/post-openstack/vars/main.yml | 45 ++++ .../roles/pre-openstack/files/centos_base.repo | 31 +++ .../ansible/roles/pre-openstack/files/modules | 7 + .../ansible/roles/pre-openstack/tasks/RedHat.yml | 77 +++++++ .../ansible/roles/pre-openstack/tasks/Ubuntu.yml | 76 +++++++ .../ansible/roles/pre-openstack/tasks/main.yml | 14 ++ .../ansible/roles/pre-openstack/templates/hosts | 9 + .../roles/pre-openstack/templates/sources.list | 36 ++++ .../ansible/roles/pre-openstack/vars/main.yml | 20 ++ .../roles/pre-prepare/files/centos_base.repo | 31 --- .../ansible/roles/pre-prepare/files/modules | 7 - .../ansible/roles/pre-prepare/tasks/RedHat.yml | 77 ------- .../ansible/roles/pre-prepare/tasks/Ubuntu.yml | 76 ------- .../ansible/roles/pre-prepare/tasks/main.yml | 14 -- .../roles/pre-prepare/templates/sources.list | 36 ---- .../ansible/roles/pre-prepare/vars/main.yml | 20 -- .../ansible/roles/setup-openvswitch/tasks/main.yml | 2 + 44 files changed, 889 insertions(+), 888 deletions(-) delete mode 100644 deploy/adapters/ansible/roles/common/templates/hosts delete mode 100755 deploy/adapters/ansible/roles/config-deployment/files/cinder.yml delete mode 100644 deploy/adapters/ansible/roles/config-deployment/files/http.yml delete mode 100644 deploy/adapters/ansible/roles/config-deployment/files/os-flavor/tasks/main.yml delete mode 100644 deploy/adapters/ansible/roles/config-deployment/files/os-flavor/vars/main.yml delete mode 100644 deploy/adapters/ansible/roles/config-deployment/files/setup-ovs.yml delete mode 100644 deploy/adapters/ansible/roles/config-deployment/tasks/main.yml delete mode 100644 deploy/adapters/ansible/roles/config-deployment/templates/ansible.cfg delete mode 100644 deploy/adapters/ansible/roles/config-deployment/templates/create-flavor.yml.j2 delete mode 100644 deploy/adapters/ansible/roles/config-deployment/templates/create-network.yml.j2 delete mode 100644 deploy/adapters/ansible/roles/config-deployment/templates/openstack_user_config.yml.j2 delete mode 100644 deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml.j2 create mode 100755 deploy/adapters/ansible/roles/config-osa/files/cinder.yml create mode 100644 deploy/adapters/ansible/roles/config-osa/files/http.yml create mode 100644 deploy/adapters/ansible/roles/config-osa/files/os-flavor/tasks/main.yml create mode 100644 deploy/adapters/ansible/roles/config-osa/files/os-flavor/vars/main.yml create mode 100644 deploy/adapters/ansible/roles/config-osa/files/setup-ovs.yml create mode 100644 deploy/adapters/ansible/roles/config-osa/tasks/main.yml create mode 100644 deploy/adapters/ansible/roles/config-osa/templates/ansible.cfg create mode 100644 deploy/adapters/ansible/roles/config-osa/templates/create-flavor.yml.j2 create mode 100644 deploy/adapters/ansible/roles/config-osa/templates/create-network.yml.j2 create mode 100644 deploy/adapters/ansible/roles/config-osa/templates/openstack_user_config.yml.j2 create mode 100644 deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 delete mode 100644 deploy/adapters/ansible/roles/openstack-post/tasks/main.yml delete mode 100644 deploy/adapters/ansible/roles/openstack-post/vars/main.yml create mode 100644 deploy/adapters/ansible/roles/post-openstack/tasks/main.yml create mode 100644 deploy/adapters/ansible/roles/post-openstack/vars/main.yml create mode 100644 deploy/adapters/ansible/roles/pre-openstack/files/centos_base.repo create mode 100644 deploy/adapters/ansible/roles/pre-openstack/files/modules create mode 100644 deploy/adapters/ansible/roles/pre-openstack/tasks/RedHat.yml create mode 100644 deploy/adapters/ansible/roles/pre-openstack/tasks/Ubuntu.yml create mode 100644 deploy/adapters/ansible/roles/pre-openstack/tasks/main.yml create mode 100644 deploy/adapters/ansible/roles/pre-openstack/templates/hosts create mode 100644 deploy/adapters/ansible/roles/pre-openstack/templates/sources.list create mode 100644 deploy/adapters/ansible/roles/pre-openstack/vars/main.yml delete mode 100644 deploy/adapters/ansible/roles/pre-prepare/files/centos_base.repo delete mode 100644 deploy/adapters/ansible/roles/pre-prepare/files/modules delete mode 100644 deploy/adapters/ansible/roles/pre-prepare/tasks/RedHat.yml delete mode 100644 deploy/adapters/ansible/roles/pre-prepare/tasks/Ubuntu.yml delete mode 100644 deploy/adapters/ansible/roles/pre-prepare/tasks/main.yml delete mode 100644 deploy/adapters/ansible/roles/pre-prepare/templates/sources.list delete mode 100644 deploy/adapters/ansible/roles/pre-prepare/vars/main.yml (limited to 'deploy/adapters') diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml index 663f02b8..417c0546 100644 --- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml +++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml @@ -10,7 +10,7 @@ - hosts: all remote_user: root roles: - - pre-prepare + - pre-openstack - hosts: controller remote_user: root @@ -25,11 +25,9 @@ - hosts: localhost remote_user: root roles: - - role: config-deployment + - role: config-osa - role: setup-host - role: setup-infrastructure - role: setup-openstack - role: setup-openvswitch - when: NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" or - NEUTRON_MECHANISM_DRIVERS[0] == "opendaylight" - - role: openstack-post + - role: post-openstack diff --git a/deploy/adapters/ansible/roles/common/templates/hosts b/deploy/adapters/ansible/roles/common/templates/hosts deleted file mode 100644 index bb770d5b..00000000 --- a/deploy/adapters/ansible/roles/common/templates/hosts +++ /dev/null @@ -1,9 +0,0 @@ -# localhost -127.0.0.1 localhost -# controller -10.1.0.50 host1 -10.1.0.51 host2 -10.1.0.52 host3 -# compute -10.1.0.53 host4 -10.1.0.54 host5 diff --git a/deploy/adapters/ansible/roles/config-deployment/files/cinder.yml b/deploy/adapters/ansible/roles/config-deployment/files/cinder.yml deleted file mode 100755 index 3a39935a..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/files/cinder.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# This file contains an example to show how to set -# the cinder-volume service to run in a container. -# -# Important note: -# When using LVM or any iSCSI-based cinder backends, such as NetApp with -# iSCSI protocol, the cinder-volume service *must* run on metal. -# Reference: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1226855 - -container_skel: - cinder_volumes_container: - properties: - is_metal: true diff --git a/deploy/adapters/ansible/roles/config-deployment/files/http.yml b/deploy/adapters/ansible/roles/config-deployment/files/http.yml deleted file mode 100644 index 248fc06d..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/files/http.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: change https to http in haproxy configuratio - hosts: network_hosts - gather_facts: "{{ gather_facts | default(True) }}" - max_fail_percentage: 20 - user: root - tasks: - - name: change the haproxy configuration - shell: "sed -i 's/ssl crt.*//g' /etc/haproxy/haproxy.cfg; - sed -i 's/https$/http/g' /etc/haproxy/haproxy.cfg" - when: openstack_service_publicuri_proto == "http" - - - name: restart haproxy service - service: - name: haproxy - state: restarted - when: openstack_service_publicuri_proto == "http" diff --git a/deploy/adapters/ansible/roles/config-deployment/files/os-flavor/tasks/main.yml b/deploy/adapters/ansible/roles/config-deployment/files/os-flavor/tasks/main.yml deleted file mode 100644 index 03b57120..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/files/os-flavor/tasks/main.yml +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################## -# 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: create openstack flavors - shell: | - . /root/openrc; - openstack flavor create {{ item.name }} \ - --id {{ item.id }} --ram {{ item.ram }} \ - --disk {{ item.disk }} --vcpus {{ item.vcpus }} || true - with_items: "{{ flavors }}" diff --git a/deploy/adapters/ansible/roles/config-deployment/files/os-flavor/vars/main.yml b/deploy/adapters/ansible/roles/config-deployment/files/os-flavor/vars/main.yml deleted file mode 100644 index d9c36d42..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/files/os-flavor/vars/main.yml +++ /dev/null @@ -1,45 +0,0 @@ -############################################################################## -# Copyright (c) 2017 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 -############################################################################## ---- -flavors: - - id: 0 - name: m1.nano - vcpus: 1 - ram: 64 - disk: 1 - - - id: 1 - name: m1.tiny - vcpus: 1 - ram: 512 - disk: 1 - - - id: 2 - name: m1.small - vcpus: 1 - ram: 2048 - disk: 20 - - - id: 3 - name: m1.medium - vcpus: 2 - ram: 4096 - disk: 40 - - - id: 4 - name: m1.large - vcpus: 4 - ram: 8192 - disk: 80 - - - id: 5 - name: m1.xlarge - vcpus: 8 - ram: 16384 - disk: 160 diff --git a/deploy/adapters/ansible/roles/config-deployment/files/setup-ovs.yml b/deploy/adapters/ansible/roles/config-deployment/files/setup-ovs.yml deleted file mode 100644 index 57bc5ef1..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/files/setup-ovs.yml +++ /dev/null @@ -1,57 +0,0 @@ ---- -- name: Installation and setup of Neutron - hosts: neutron_openvswitch_agent - gather_facts: "{{ gather_facts | default(True) }}" - max_fail_percentage: 20 - user: root - tasks: - - name: stop neutron-openvswitch-agent - service: - name: neutron-openvswitch-agent - state: stopped - - # yamllint disable rule:line-length - - name: change the openvswitch_agent.ini - lineinfile: - dest: /etc/neutron/plugins/ml2/openvswitch_agent.ini - insertafter: '^bridge_mappings' - line: "local_ip = {{ hostvars[inventory_hostname]['container_networks']['tunnel_address']['address'] }}" - when: - - inventory_hostname not in groups['nova_compute'] - - - name: change the openvswitch_agent.ini - lineinfile: - dest: /etc/neutron/plugins/ml2/openvswitch_agent.ini - regexp: '^bridge_mappings' - insertafter: '^bridge_mappings' - line: "local_ip = {{hostvars[inventory_hostname]['ansible_br_vxlan']['ipv4']['address']}}" - notify: - - Restart neutron-openvswitch-agent - when: - - inventory_hostname in groups['nova_compute'] - # yamllint enable rule:line-length - - - name: Setup br-provider - openvswitch_bridge: - bridge: br-provider - state: present - notify: - - Restart neutron-openvswitch-agent - when: - - inventory_hostname not in groups['nova_compute'] - - - name: Add port to br-provider - openvswitch_port: - bridge: br-provider - port: "eth12" - state: present - notify: - - Restart neutron-openvswitch-agent - when: - - inventory_hostname not in groups['nova_compute'] - - handlers: - - name: Restart neutron-openvswitch-agent - service: - name: neutron-openvswitch-agent - state: restarted diff --git a/deploy/adapters/ansible/roles/config-deployment/tasks/main.yml b/deploy/adapters/ansible/roles/config-deployment/tasks/main.yml deleted file mode 100644 index 8246d6e7..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/tasks/main.yml +++ /dev/null @@ -1,58 +0,0 @@ -# ############################################################################# -# Copyright (c) 2017 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: create osa log directory - file: - path: /var/log/osa/ - state: directory - -- name: copy openstack_user_config - template: - src: openstack_user_config.yml.j2 - dest: /etc/openstack_deploy/openstack_user_config.yml - -- name: copy user_variables - template: - src: user_variables.yml.j2 - dest: /etc/openstack_deploy/user_variables.yml - -- name: copy cinder.yml - copy: - src: cinder.yml - dest: /etc/openstack_deploy/env.d/cinder.yml - -- name: copy ansible.cfg - template: - src: ansible.cfg - dest: /opt/openstack-ansible/playbooks/ - -- name: copy setup-ovs.yml - copy: - src: setup-ovs.yml - dest: /opt/openstack-ansible/playbooks - -- name: copy flavor roles - copy: - src: os-flavor - dest: /etc/ansible/roles/ - -- name: generate create-network.yml - template: - src: create-network.yml.j2 - dest: /opt/openstack-ansible/playbooks/create-network.yml - -- name: generate create-flavor.yml - template: - src: create-flavor.yml.j2 - dest: /opt/openstack-ansible/playbooks/create-flavor.yml - -- name: copy http.yml - copy: - src: http.yml - dest: /opt/openstack-ansible/playbooks/http.yml diff --git a/deploy/adapters/ansible/roles/config-deployment/templates/ansible.cfg b/deploy/adapters/ansible/roles/config-deployment/templates/ansible.cfg deleted file mode 100644 index 41502fbf..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/templates/ansible.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[ssh_connection] -retries = 5 -scp_if_ssh = True diff --git a/deploy/adapters/ansible/roles/config-deployment/templates/create-flavor.yml.j2 b/deploy/adapters/ansible/roles/config-deployment/templates/create-flavor.yml.j2 deleted file mode 100644 index b33cd414..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/templates/create-flavor.yml.j2 +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################## -# 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: Create flavor - hosts: utility_container[0] - max_fail_percentage: 20 - user: root - roles: - - os-flavor diff --git a/deploy/adapters/ansible/roles/config-deployment/templates/create-network.yml.j2 b/deploy/adapters/ansible/roles/config-deployment/templates/create-network.yml.j2 deleted file mode 100644 index 419b9b18..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/templates/create-network.yml.j2 +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################## -# 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: Create external network - hosts: utility_container[0] - max_fail_percentage: 20 - user: root - tasks: - - name: create external net - shell: | - . /root/openrc; - openstack network create --share --external \ - --provider-physical-network {{ public_net_info.provider_network }} \ - --provider-network-type {{ public_net_info.type }} {{ public_net_info.network }}; - when: {{ public_net_info.enable }} == True - and "{{ public_net_info.type }}" == "flat" - - - name: create external net - shell: | - . /root/openrc; - openstack network create --share --external \ - --network-segment {{ public_net_info.segment_id }} \ - --provider-network-type {{ public_net_info.type }} {{ public_net_info.network }}; - when: {{public_net_info.enable}} == True - and "{{ public_net_info.type }}" != "flat" - - - name: create external subnet - shell: | - . /root/openrc; - openstack subnet create --network "{{ public_net_info.network }}" \ - --allocation-pool \ - start={{ public_net_info.floating_ip_start }},end={{ public_net_info.floating_ip_end }} \ - --gateway "{{ public_net_info.external_gw }}" \ - --subnet-range "{{ public_net_info.floating_ip_cidr }}" \ - "{{ public_net_info.subnet }}" diff --git a/deploy/adapters/ansible/roles/config-deployment/templates/openstack_user_config.yml.j2 b/deploy/adapters/ansible/roles/config-deployment/templates/openstack_user_config.yml.j2 deleted file mode 100644 index 2a24113b..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/templates/openstack_user_config.yml.j2 +++ /dev/null @@ -1,232 +0,0 @@ ---- -cidr_networks: - container: 10.1.0.0/24 - tunnel: 172.29.240.0/22 - storage: 172.16.2.0/24 - -used_ips: - - "10.1.0.1,10.1.0.55" - - "10.1.0.100,10.1.0.110" - - "172.29.240.1,172.29.240.50" - - "172.16.2.1,172.16.2.50" - - "172.29.248.1,172.29.248.50" - -global_overrides: - internal_lb_vip_address: 10.1.0.22 - external_lb_vip_address: {{ public_vip.ip }} - tunnel_bridge: "br-vxlan" - management_bridge: "br-mgmt" - provider_networks: - - network: - container_bridge: "br-mgmt" - container_type: "veth" - container_interface: "eth1" - ip_from_q: "container" - type: "raw" - group_binds: - - all_containers - - hosts - is_container_address: true - is_ssh_address: true - - network: - container_bridge: "br-vxlan" - container_type: "veth" - container_interface: "eth10" - ip_from_q: "tunnel" - type: "vxlan" - range: "1:1000" - net_name: "vxlan" - group_binds: -{% if "linuxbridge" == NEUTRON_MECHANISM_DRIVERS[0] %} - - neutron_linuxbridge_agent -{% else %} - - neutron_openvswitch_agent -{% endif %} - - network: - container_bridge: "br-vlan" - container_type: "veth" - container_interface: "eth12" - host_bind_override: "eth12" - type: "flat" - net_name: "{{ public_net_info.provider_network }}" - group_binds: -{% if "linuxbridge" == NEUTRON_MECHANISM_DRIVERS[0] %} - - neutron_linuxbridge_agent -{% else %} - - neutron_openvswitch_agent -{% endif %} - - network: - container_bridge: "br-vlan" - container_type: "veth" - container_interface: "eth11" - type: "vlan" - range: "1:1" - net_name: "vlan" - group_binds: -{% if "linuxbridge" == NEUTRON_MECHANISM_DRIVERS[0] %} - - neutron_linuxbridge_agent -{% else %} - - neutron_openvswitch_agent -{% endif %} - - network: - container_bridge: "br-storage" - container_type: "veth" - container_interface: "eth2" - ip_from_q: "storage" - type: "raw" - group_binds: - - glance_api - - cinder_api - - cinder_volume - - nova_compute - -### -### Infrastructure -### - -# galera, memcache, rabbitmq, utility -shared-infra_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# repository (apt cache, python packages, etc) -repo-infra_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# load balancer -# Ideally the load balancer should not use the Infrastructure hosts. -# Dedicated hardware is best for improved performance and security. -haproxy_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# rsyslog server -#log_hosts: - # log1: - # ip: 10.1.0.53 - -### -### OpenStack -### - -# keystone -identity_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# cinder api services -storage-infra_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# glance -# The settings here are repeated for each infra host. -# They could instead be applied as global settings in -# user_variables, but are left here to illustrate that -# each container could have different storage targets. -image_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} - container_vars: - limit_container_types: glance - glance_nfs_client: - - server: "{{ip_settings[groups.compute[0]]['storage']['ip']}}" - remote_path: "/images" - local_path: "/var/lib/glance/images" - type: "nfs" - options: "_netdev,auto" -{% endfor %} - -# nova api, conductor, etc services -compute-infra_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# heat -orchestration_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# horizon -dashboard_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# neutron server, agents (L3, etc) -network_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# ceilometer (telemetry API) -metering-infra_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# aodh (telemetry alarm service) -metering-alarm_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# gnocchi (telemetry metrics storage) -metrics_hosts: -{% for host in groups.controller%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# nova hypervisors -compute_hosts: -{% for host in groups.compute%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# ceilometer compute agent (telemetry) -metering-compute_hosts: -{% for host in groups.compute%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} -{% endfor %} - -# cinder volume hosts (NFS-backed) -# The settings here are repeated for each infra host. -# They could instead be applied as global settings in -# user_variables, but are left here to illustrate that -# each container could have different storage targets. -storage_hosts: -{% for host in groups.compute%} - {{host}}: - ip: {{ hostvars[host]['ansible_ssh_host'] }} - container_vars: - cinder_backends: - limit_container_types: cinder_volume - lvm: - volume_group: cinder-volumes - volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver - volume_backend_name: LVM_iSCSI - iscsi_ip_address: "{{ip_settings[host]['storage']['ip']}}" -{% endfor %} diff --git a/deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml.j2 b/deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml.j2 deleted file mode 100644 index 443a3f5b..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml.j2 +++ /dev/null @@ -1,47 +0,0 @@ ---- -# Copyright 2014, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ## -# ## This file contains commonly used overrides for convenience. Please inspect -# ## the defaults for each role to find additional override options. -# ## - -# # Debug and Verbose options. -debug: false - -openstack_service_publicuri_proto: http -haproxy_keepalived_external_vip_cidr: "{{ public_vip.ip }}/32" -haproxy_keepalived_internal_vip_cidr: "10.1.0.22/32" -haproxy_keepalived_external_interface: br-vlan -haproxy_keepalived_internal_interface: br-mgmt - -{% if "openvswitch" == NEUTRON_MECHANISM_DRIVERS[0] or - "opendaylight" == NEUTRON_MECHANISM_DRIVERS[0] -%} -openstack_host_specific_kernel_modules: - - name: "openvswitch" - pattern: "CONFIG_OPENVSWITCH=" - group: "network_hosts" - -neutron_plugin_type: ml2.ovs - -neutron_ml2_drivers_type: "local,flat,vlan,vxlan" - -neutron_provider_networks: - network_flat_networks: "*" - network_types: "vxlan" - network_vxlan_ranges: "1:1000" - network_mappings: "physnet:br-provider" -{% endif %} diff --git a/deploy/adapters/ansible/roles/config-osa/files/cinder.yml b/deploy/adapters/ansible/roles/config-osa/files/cinder.yml new file mode 100755 index 00000000..3a39935a --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/files/cinder.yml @@ -0,0 +1,13 @@ +--- +# This file contains an example to show how to set +# the cinder-volume service to run in a container. +# +# Important note: +# When using LVM or any iSCSI-based cinder backends, such as NetApp with +# iSCSI protocol, the cinder-volume service *must* run on metal. +# Reference: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1226855 + +container_skel: + cinder_volumes_container: + properties: + is_metal: true diff --git a/deploy/adapters/ansible/roles/config-osa/files/http.yml b/deploy/adapters/ansible/roles/config-osa/files/http.yml new file mode 100644 index 00000000..248fc06d --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/files/http.yml @@ -0,0 +1,17 @@ +--- +- name: change https to http in haproxy configuratio + hosts: network_hosts + gather_facts: "{{ gather_facts | default(True) }}" + max_fail_percentage: 20 + user: root + tasks: + - name: change the haproxy configuration + shell: "sed -i 's/ssl crt.*//g' /etc/haproxy/haproxy.cfg; + sed -i 's/https$/http/g' /etc/haproxy/haproxy.cfg" + when: openstack_service_publicuri_proto == "http" + + - name: restart haproxy service + service: + name: haproxy + state: restarted + when: openstack_service_publicuri_proto == "http" diff --git a/deploy/adapters/ansible/roles/config-osa/files/os-flavor/tasks/main.yml b/deploy/adapters/ansible/roles/config-osa/files/os-flavor/tasks/main.yml new file mode 100644 index 00000000..03b57120 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/files/os-flavor/tasks/main.yml @@ -0,0 +1,17 @@ +############################################################################## +# 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: create openstack flavors + shell: | + . /root/openrc; + openstack flavor create {{ item.name }} \ + --id {{ item.id }} --ram {{ item.ram }} \ + --disk {{ item.disk }} --vcpus {{ item.vcpus }} || true + with_items: "{{ flavors }}" diff --git a/deploy/adapters/ansible/roles/config-osa/files/os-flavor/vars/main.yml b/deploy/adapters/ansible/roles/config-osa/files/os-flavor/vars/main.yml new file mode 100644 index 00000000..d9c36d42 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/files/os-flavor/vars/main.yml @@ -0,0 +1,45 @@ +############################################################################## +# Copyright (c) 2017 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 +############################################################################## +--- +flavors: + - id: 0 + name: m1.nano + vcpus: 1 + ram: 64 + disk: 1 + + - id: 1 + name: m1.tiny + vcpus: 1 + ram: 512 + disk: 1 + + - id: 2 + name: m1.small + vcpus: 1 + ram: 2048 + disk: 20 + + - id: 3 + name: m1.medium + vcpus: 2 + ram: 4096 + disk: 40 + + - id: 4 + name: m1.large + vcpus: 4 + ram: 8192 + disk: 80 + + - id: 5 + name: m1.xlarge + vcpus: 8 + ram: 16384 + disk: 160 diff --git a/deploy/adapters/ansible/roles/config-osa/files/setup-ovs.yml b/deploy/adapters/ansible/roles/config-osa/files/setup-ovs.yml new file mode 100644 index 00000000..57bc5ef1 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/files/setup-ovs.yml @@ -0,0 +1,57 @@ +--- +- name: Installation and setup of Neutron + hosts: neutron_openvswitch_agent + gather_facts: "{{ gather_facts | default(True) }}" + max_fail_percentage: 20 + user: root + tasks: + - name: stop neutron-openvswitch-agent + service: + name: neutron-openvswitch-agent + state: stopped + + # yamllint disable rule:line-length + - name: change the openvswitch_agent.ini + lineinfile: + dest: /etc/neutron/plugins/ml2/openvswitch_agent.ini + insertafter: '^bridge_mappings' + line: "local_ip = {{ hostvars[inventory_hostname]['container_networks']['tunnel_address']['address'] }}" + when: + - inventory_hostname not in groups['nova_compute'] + + - name: change the openvswitch_agent.ini + lineinfile: + dest: /etc/neutron/plugins/ml2/openvswitch_agent.ini + regexp: '^bridge_mappings' + insertafter: '^bridge_mappings' + line: "local_ip = {{hostvars[inventory_hostname]['ansible_br_vxlan']['ipv4']['address']}}" + notify: + - Restart neutron-openvswitch-agent + when: + - inventory_hostname in groups['nova_compute'] + # yamllint enable rule:line-length + + - name: Setup br-provider + openvswitch_bridge: + bridge: br-provider + state: present + notify: + - Restart neutron-openvswitch-agent + when: + - inventory_hostname not in groups['nova_compute'] + + - name: Add port to br-provider + openvswitch_port: + bridge: br-provider + port: "eth12" + state: present + notify: + - Restart neutron-openvswitch-agent + when: + - inventory_hostname not in groups['nova_compute'] + + handlers: + - name: Restart neutron-openvswitch-agent + service: + name: neutron-openvswitch-agent + state: restarted diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml new file mode 100644 index 00000000..8246d6e7 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml @@ -0,0 +1,58 @@ +# ############################################################################# +# Copyright (c) 2017 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: create osa log directory + file: + path: /var/log/osa/ + state: directory + +- name: copy openstack_user_config + template: + src: openstack_user_config.yml.j2 + dest: /etc/openstack_deploy/openstack_user_config.yml + +- name: copy user_variables + template: + src: user_variables.yml.j2 + dest: /etc/openstack_deploy/user_variables.yml + +- name: copy cinder.yml + copy: + src: cinder.yml + dest: /etc/openstack_deploy/env.d/cinder.yml + +- name: copy ansible.cfg + template: + src: ansible.cfg + dest: /opt/openstack-ansible/playbooks/ + +- name: copy setup-ovs.yml + copy: + src: setup-ovs.yml + dest: /opt/openstack-ansible/playbooks + +- name: copy flavor roles + copy: + src: os-flavor + dest: /etc/ansible/roles/ + +- name: generate create-network.yml + template: + src: create-network.yml.j2 + dest: /opt/openstack-ansible/playbooks/create-network.yml + +- name: generate create-flavor.yml + template: + src: create-flavor.yml.j2 + dest: /opt/openstack-ansible/playbooks/create-flavor.yml + +- name: copy http.yml + copy: + src: http.yml + dest: /opt/openstack-ansible/playbooks/http.yml diff --git a/deploy/adapters/ansible/roles/config-osa/templates/ansible.cfg b/deploy/adapters/ansible/roles/config-osa/templates/ansible.cfg new file mode 100644 index 00000000..41502fbf --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/templates/ansible.cfg @@ -0,0 +1,3 @@ +[ssh_connection] +retries = 5 +scp_if_ssh = True diff --git a/deploy/adapters/ansible/roles/config-osa/templates/create-flavor.yml.j2 b/deploy/adapters/ansible/roles/config-osa/templates/create-flavor.yml.j2 new file mode 100644 index 00000000..b33cd414 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/templates/create-flavor.yml.j2 @@ -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 +############################################################################## +--- +- name: Create flavor + hosts: utility_container[0] + max_fail_percentage: 20 + user: root + roles: + - os-flavor diff --git a/deploy/adapters/ansible/roles/config-osa/templates/create-network.yml.j2 b/deploy/adapters/ansible/roles/config-osa/templates/create-network.yml.j2 new file mode 100644 index 00000000..419b9b18 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/templates/create-network.yml.j2 @@ -0,0 +1,41 @@ +############################################################################## +# 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: Create external network + hosts: utility_container[0] + max_fail_percentage: 20 + user: root + tasks: + - name: create external net + shell: | + . /root/openrc; + openstack network create --share --external \ + --provider-physical-network {{ public_net_info.provider_network }} \ + --provider-network-type {{ public_net_info.type }} {{ public_net_info.network }}; + when: {{ public_net_info.enable }} == True + and "{{ public_net_info.type }}" == "flat" + + - name: create external net + shell: | + . /root/openrc; + openstack network create --share --external \ + --network-segment {{ public_net_info.segment_id }} \ + --provider-network-type {{ public_net_info.type }} {{ public_net_info.network }}; + when: {{public_net_info.enable}} == True + and "{{ public_net_info.type }}" != "flat" + + - name: create external subnet + shell: | + . /root/openrc; + openstack subnet create --network "{{ public_net_info.network }}" \ + --allocation-pool \ + start={{ public_net_info.floating_ip_start }},end={{ public_net_info.floating_ip_end }} \ + --gateway "{{ public_net_info.external_gw }}" \ + --subnet-range "{{ public_net_info.floating_ip_cidr }}" \ + "{{ public_net_info.subnet }}" diff --git a/deploy/adapters/ansible/roles/config-osa/templates/openstack_user_config.yml.j2 b/deploy/adapters/ansible/roles/config-osa/templates/openstack_user_config.yml.j2 new file mode 100644 index 00000000..2a24113b --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/templates/openstack_user_config.yml.j2 @@ -0,0 +1,232 @@ +--- +cidr_networks: + container: 10.1.0.0/24 + tunnel: 172.29.240.0/22 + storage: 172.16.2.0/24 + +used_ips: + - "10.1.0.1,10.1.0.55" + - "10.1.0.100,10.1.0.110" + - "172.29.240.1,172.29.240.50" + - "172.16.2.1,172.16.2.50" + - "172.29.248.1,172.29.248.50" + +global_overrides: + internal_lb_vip_address: 10.1.0.22 + external_lb_vip_address: {{ public_vip.ip }} + tunnel_bridge: "br-vxlan" + management_bridge: "br-mgmt" + provider_networks: + - network: + container_bridge: "br-mgmt" + container_type: "veth" + container_interface: "eth1" + ip_from_q: "container" + type: "raw" + group_binds: + - all_containers + - hosts + is_container_address: true + is_ssh_address: true + - network: + container_bridge: "br-vxlan" + container_type: "veth" + container_interface: "eth10" + ip_from_q: "tunnel" + type: "vxlan" + range: "1:1000" + net_name: "vxlan" + group_binds: +{% if "linuxbridge" == NEUTRON_MECHANISM_DRIVERS[0] %} + - neutron_linuxbridge_agent +{% else %} + - neutron_openvswitch_agent +{% endif %} + - network: + container_bridge: "br-vlan" + container_type: "veth" + container_interface: "eth12" + host_bind_override: "eth12" + type: "flat" + net_name: "{{ public_net_info.provider_network }}" + group_binds: +{% if "linuxbridge" == NEUTRON_MECHANISM_DRIVERS[0] %} + - neutron_linuxbridge_agent +{% else %} + - neutron_openvswitch_agent +{% endif %} + - network: + container_bridge: "br-vlan" + container_type: "veth" + container_interface: "eth11" + type: "vlan" + range: "1:1" + net_name: "vlan" + group_binds: +{% if "linuxbridge" == NEUTRON_MECHANISM_DRIVERS[0] %} + - neutron_linuxbridge_agent +{% else %} + - neutron_openvswitch_agent +{% endif %} + - network: + container_bridge: "br-storage" + container_type: "veth" + container_interface: "eth2" + ip_from_q: "storage" + type: "raw" + group_binds: + - glance_api + - cinder_api + - cinder_volume + - nova_compute + +### +### Infrastructure +### + +# galera, memcache, rabbitmq, utility +shared-infra_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# repository (apt cache, python packages, etc) +repo-infra_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# load balancer +# Ideally the load balancer should not use the Infrastructure hosts. +# Dedicated hardware is best for improved performance and security. +haproxy_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# rsyslog server +#log_hosts: + # log1: + # ip: 10.1.0.53 + +### +### OpenStack +### + +# keystone +identity_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# cinder api services +storage-infra_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# glance +# The settings here are repeated for each infra host. +# They could instead be applied as global settings in +# user_variables, but are left here to illustrate that +# each container could have different storage targets. +image_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} + container_vars: + limit_container_types: glance + glance_nfs_client: + - server: "{{ip_settings[groups.compute[0]]['storage']['ip']}}" + remote_path: "/images" + local_path: "/var/lib/glance/images" + type: "nfs" + options: "_netdev,auto" +{% endfor %} + +# nova api, conductor, etc services +compute-infra_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# heat +orchestration_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# horizon +dashboard_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# neutron server, agents (L3, etc) +network_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# ceilometer (telemetry API) +metering-infra_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# aodh (telemetry alarm service) +metering-alarm_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# gnocchi (telemetry metrics storage) +metrics_hosts: +{% for host in groups.controller%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# nova hypervisors +compute_hosts: +{% for host in groups.compute%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# ceilometer compute agent (telemetry) +metering-compute_hosts: +{% for host in groups.compute%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} +{% endfor %} + +# cinder volume hosts (NFS-backed) +# The settings here are repeated for each infra host. +# They could instead be applied as global settings in +# user_variables, but are left here to illustrate that +# each container could have different storage targets. +storage_hosts: +{% for host in groups.compute%} + {{host}}: + ip: {{ hostvars[host]['ansible_ssh_host'] }} + container_vars: + cinder_backends: + limit_container_types: cinder_volume + lvm: + volume_group: cinder-volumes + volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver + volume_backend_name: LVM_iSCSI + iscsi_ip_address: "{{ip_settings[host]['storage']['ip']}}" +{% endfor %} diff --git a/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 b/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 new file mode 100644 index 00000000..5157f758 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 @@ -0,0 +1,48 @@ +--- +# Copyright 2014, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# ## +# ## This file contains commonly used overrides for convenience. Please inspect +# ## the defaults for each role to find additional override options. +# ## + +# # Debug and Verbose options. +debug: false + +openstack_service_publicuri_proto: http +haproxy_keepalived_external_vip_cidr: "{{ public_vip.ip }}/32" +haproxy_keepalived_internal_vip_cidr: "10.1.0.22/32" +haproxy_keepalived_external_interface: br-vlan +haproxy_keepalived_internal_interface: br-mgmt +keepalived_ping_address: "{{ ntp_server }}" + +{% if "openvswitch" == NEUTRON_MECHANISM_DRIVERS[0] or + "opendaylight" == NEUTRON_MECHANISM_DRIVERS[0] +%} +openstack_host_specific_kernel_modules: + - name: "openvswitch" + pattern: "CONFIG_OPENVSWITCH=" + group: "network_hosts" + +neutron_plugin_type: ml2.ovs + +neutron_ml2_drivers_type: "local,flat,vlan,vxlan" + +neutron_provider_networks: + network_flat_networks: "*" + network_types: "vxlan" + network_vxlan_ranges: "1:1000" + network_mappings: "physnet:br-provider" +{% endif %} diff --git a/deploy/adapters/ansible/roles/openstack-post/tasks/main.yml b/deploy/adapters/ansible/roles/openstack-post/tasks/main.yml deleted file mode 100644 index d5182c95..00000000 --- a/deploy/adapters/ansible/roles/openstack-post/tasks/main.yml +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################## -# 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: create network - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \ - cd /opt/openstack-ansible/playbooks; \ - openstack-ansible create-network.yml > /dev/null" - -- name: create flavor - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \ - cd /opt/openstack-ansible/playbooks; \ - openstack-ansible create-flavor.yml > /dev/null" - -- name: change https to http - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \ - cd /opt/openstack-ansible/playbooks; \ - openstack-ansible http.yml > /dev/null" diff --git a/deploy/adapters/ansible/roles/openstack-post/vars/main.yml b/deploy/adapters/ansible/roles/openstack-post/vars/main.yml deleted file mode 100644 index d9c36d42..00000000 --- a/deploy/adapters/ansible/roles/openstack-post/vars/main.yml +++ /dev/null @@ -1,45 +0,0 @@ -############################################################################## -# Copyright (c) 2017 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 -############################################################################## ---- -flavors: - - id: 0 - name: m1.nano - vcpus: 1 - ram: 64 - disk: 1 - - - id: 1 - name: m1.tiny - vcpus: 1 - ram: 512 - disk: 1 - - - id: 2 - name: m1.small - vcpus: 1 - ram: 2048 - disk: 20 - - - id: 3 - name: m1.medium - vcpus: 2 - ram: 4096 - disk: 40 - - - id: 4 - name: m1.large - vcpus: 4 - ram: 8192 - disk: 80 - - - id: 5 - name: m1.xlarge - vcpus: 8 - ram: 16384 - disk: 160 diff --git a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml new file mode 100644 index 00000000..d5182c95 --- /dev/null +++ b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml @@ -0,0 +1,23 @@ +############################################################################## +# 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: create network + shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \ + cd /opt/openstack-ansible/playbooks; \ + openstack-ansible create-network.yml > /dev/null" + +- name: create flavor + shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \ + cd /opt/openstack-ansible/playbooks; \ + openstack-ansible create-flavor.yml > /dev/null" + +- name: change https to http + shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \ + cd /opt/openstack-ansible/playbooks; \ + openstack-ansible http.yml > /dev/null" diff --git a/deploy/adapters/ansible/roles/post-openstack/vars/main.yml b/deploy/adapters/ansible/roles/post-openstack/vars/main.yml new file mode 100644 index 00000000..d9c36d42 --- /dev/null +++ b/deploy/adapters/ansible/roles/post-openstack/vars/main.yml @@ -0,0 +1,45 @@ +############################################################################## +# Copyright (c) 2017 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 +############################################################################## +--- +flavors: + - id: 0 + name: m1.nano + vcpus: 1 + ram: 64 + disk: 1 + + - id: 1 + name: m1.tiny + vcpus: 1 + ram: 512 + disk: 1 + + - id: 2 + name: m1.small + vcpus: 1 + ram: 2048 + disk: 20 + + - id: 3 + name: m1.medium + vcpus: 2 + ram: 4096 + disk: 40 + + - id: 4 + name: m1.large + vcpus: 4 + ram: 8192 + disk: 80 + + - id: 5 + name: m1.xlarge + vcpus: 8 + ram: 16384 + disk: 160 diff --git a/deploy/adapters/ansible/roles/pre-openstack/files/centos_base.repo b/deploy/adapters/ansible/roles/pre-openstack/files/centos_base.repo new file mode 100644 index 00000000..ba768e0a --- /dev/null +++ b/deploy/adapters/ansible/roles/pre-openstack/files/centos_base.repo @@ -0,0 +1,31 @@ +[base] +name=CentOS-$releasever - Base +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra +#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#released updates +[updates] +name=CentOS-$releasever - Updates +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra +#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#additional packages that may be useful +[extras] +name=CentOS-$releasever - Extras +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra +#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#additional packages that extend functionality of existing packages +[centosplus] +name=CentOS-$releasever - Plus +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra +#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 diff --git a/deploy/adapters/ansible/roles/pre-openstack/files/modules b/deploy/adapters/ansible/roles/pre-openstack/files/modules new file mode 100644 index 00000000..c73925e6 --- /dev/null +++ b/deploy/adapters/ansible/roles/pre-openstack/files/modules @@ -0,0 +1,7 @@ +# /etc/modules: kernel modules to load at boot time. +# This file contains the names of kernel modules that should be loaded +# at boot time, one per line. Lines beginning with "#" are ignored. +# Parameters can be specified after the module name. + +bonding +8021q diff --git a/deploy/adapters/ansible/roles/pre-openstack/tasks/RedHat.yml b/deploy/adapters/ansible/roles/pre-openstack/tasks/RedHat.yml new file mode 100644 index 00000000..5456c9fc --- /dev/null +++ b/deploy/adapters/ansible/roles/pre-openstack/tasks/RedHat.yml @@ -0,0 +1,77 @@ +############################################################################## +# 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: make sure ssh dir exist + file: + path: '{{ item.path }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + state: directory + mode: 0755 + with_items: + - path: /root/.ssh + owner: root + group: root + +- name: write ssh config + copy: + content: "UserKnownHostsFile /dev/null\nStrictHostKeyChecking no" + dest: '{{ item.dest }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + mode: 0600 + with_items: + - dest: /root/.ssh/config + owner: root + group: root + +- name: generate ssh keys + shell: if [ ! -f ~/.ssh/id_rsa.pub ]; \ + then ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ""; \ + else echo "already gen ssh key!"; fi; + +- name: fetch ssh keys + fetch: + src: /root/.ssh/id_rsa.pub + dest: /tmp/ssh-keys-{{ ansible_hostname }} + flat: "yes" + +- authorized_key: + user: root + key: "{{ lookup('file', item) }}" + with_fileglob: + - /tmp/ssh-keys-* + - /root/.ssh/id_rsa.pub + +- name: change sources(yum) list + copy: + src: centos_base.repo + dest: /etc/yum.repos.d/centos_base.repo + +- name: Install yum packages + yum: + pkg: "{{ item }}" + state: "present" + with_items: "{{ yumpackages }}" + +- name: add the appropriate kernel modules + copy: + src: modules + dest: /etc/modules-load.d/openstack-ansible.conf + +- name: restart ntp service + shell: "systemctl enable ntpd.service && systemctl start ntpd.service" + +- name: change the MaxSessions + lineinfile: + dest: /etc/ssh/sshd_config + line: "MaxSessions 500" + +- name: restart ssh service + shell: service sshd restart diff --git a/deploy/adapters/ansible/roles/pre-openstack/tasks/Ubuntu.yml b/deploy/adapters/ansible/roles/pre-openstack/tasks/Ubuntu.yml new file mode 100644 index 00000000..a0f7d015 --- /dev/null +++ b/deploy/adapters/ansible/roles/pre-openstack/tasks/Ubuntu.yml @@ -0,0 +1,76 @@ +############################################################################## +# 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: make sure ssh dir exist + file: + path: '{{ item.path }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + state: directory + mode: 0755 + with_items: + - path: /root/.ssh + owner: root + group: root + +- name: write ssh config + copy: + content: "UserKnownHostsFile /dev/null\nStrictHostKeyChecking no" + dest: '{{ item.dest }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + mode: 0600 + with_items: + - dest: /root/.ssh/config + owner: root + group: root + +- name: generate ssh keys + shell: if [ ! -f ~/.ssh/id_rsa.pub ]; \ + then ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ""; \ + else echo "already gen ssh key!"; fi; + +- name: fetch ssh keys + fetch: + src: /root/.ssh/id_rsa.pub + dest: /tmp/ssh-keys-{{ ansible_hostname }} + flat: "yes" + +- authorized_key: + user: root + key: "{{ lookup('file', item) }}" + with_fileglob: + - /tmp/ssh-keys-* + - /root/.ssh/id_rsa.pub + +- name: change sourcesi(apt) list + template: + src: sources.list + dest: /etc/apt/sources.list + +- name: rm apt.conf + file: + path: /etc/apt/apt.conf + state: absent + +- name: restart ntp service + shell: "service ntp restart" + +- name: add the appropriate kernel modules + copy: + src: modules + dest: /etc/modules + +- name: change the MaxSessions + lineinfile: + dest: /etc/ssh/sshd_config + line: "MaxSessions 500" + +- name: restart ssh service + shell: service ssh restart diff --git a/deploy/adapters/ansible/roles/pre-openstack/tasks/main.yml b/deploy/adapters/ansible/roles/pre-openstack/tasks/main.yml new file mode 100644 index 00000000..76203440 --- /dev/null +++ b/deploy/adapters/ansible/roles/pre-openstack/tasks/main.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 +############################################################################## +--- +- include: "{{ ansible_distribution }}.yml" + when: ansible_distribution == 'Ubuntu' + +- include: "{{ ansible_os_family }}.yml" + when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' diff --git a/deploy/adapters/ansible/roles/pre-openstack/templates/hosts b/deploy/adapters/ansible/roles/pre-openstack/templates/hosts new file mode 100644 index 00000000..bb770d5b --- /dev/null +++ b/deploy/adapters/ansible/roles/pre-openstack/templates/hosts @@ -0,0 +1,9 @@ +# localhost +127.0.0.1 localhost +# controller +10.1.0.50 host1 +10.1.0.51 host2 +10.1.0.52 host3 +# compute +10.1.0.53 host4 +10.1.0.54 host5 diff --git a/deploy/adapters/ansible/roles/pre-openstack/templates/sources.list b/deploy/adapters/ansible/roles/pre-openstack/templates/sources.list new file mode 100644 index 00000000..799e4b58 --- /dev/null +++ b/deploy/adapters/ansible/roles/pre-openstack/templates/sources.list @@ -0,0 +1,36 @@ +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. + +deb http://archive.ubuntu.com/ubuntu/ xenial main restricted +deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted +deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted + +## Uncomment the following two lines to add software from the 'universe' +## repository. +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://archive.ubuntu.com/ubuntu/ xenial universe +deb-src http://archive.ubuntu.com/ubuntu/ xenial universe +deb http://archive.ubuntu.com/ubuntu/ xenial-updates universe +deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates universe + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +# deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted +# deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted + +deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted +deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted +deb http://archive.ubuntu.com/ubuntu/ xenial-security universe +deb-src http://archive.ubuntu.com/ubuntu/ xenial-security universe +# deb http://archive.ubuntu.com/ubuntu/ xenial-security multiverse +# deb-src http://archive.ubuntu.com/ubuntu/ xenial-security multiverse + diff --git a/deploy/adapters/ansible/roles/pre-openstack/vars/main.yml b/deploy/adapters/ansible/roles/pre-openstack/vars/main.yml new file mode 100644 index 00000000..f44a9f9f --- /dev/null +++ b/deploy/adapters/ansible/roles/pre-openstack/vars/main.yml @@ -0,0 +1,20 @@ +--- +aptpackages: +- bridge-utils +- debootstrap +- ifenslave +- ifenslave-2.6 +- lsof +- lvm2 +- ntp +- ntpdate +- sudo +- vlan +- tcpdump + +yumpackages: +- bridge-utils +- iputils +- lvm2 +- ntp +- tcpdump diff --git a/deploy/adapters/ansible/roles/pre-prepare/files/centos_base.repo b/deploy/adapters/ansible/roles/pre-prepare/files/centos_base.repo deleted file mode 100644 index ba768e0a..00000000 --- a/deploy/adapters/ansible/roles/pre-prepare/files/centos_base.repo +++ /dev/null @@ -1,31 +0,0 @@ -[base] -name=CentOS-$releasever - Base -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#released updates -[updates] -name=CentOS-$releasever - Updates -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#additional packages that may be useful -[extras] -name=CentOS-$releasever - Extras -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - -#additional packages that extend functionality of existing packages -[centosplus] -name=CentOS-$releasever - Plus -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra -#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 diff --git a/deploy/adapters/ansible/roles/pre-prepare/files/modules b/deploy/adapters/ansible/roles/pre-prepare/files/modules deleted file mode 100644 index c73925e6..00000000 --- a/deploy/adapters/ansible/roles/pre-prepare/files/modules +++ /dev/null @@ -1,7 +0,0 @@ -# /etc/modules: kernel modules to load at boot time. -# This file contains the names of kernel modules that should be loaded -# at boot time, one per line. Lines beginning with "#" are ignored. -# Parameters can be specified after the module name. - -bonding -8021q diff --git a/deploy/adapters/ansible/roles/pre-prepare/tasks/RedHat.yml b/deploy/adapters/ansible/roles/pre-prepare/tasks/RedHat.yml deleted file mode 100644 index 5456c9fc..00000000 --- a/deploy/adapters/ansible/roles/pre-prepare/tasks/RedHat.yml +++ /dev/null @@ -1,77 +0,0 @@ -############################################################################## -# 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: make sure ssh dir exist - file: - path: '{{ item.path }}' - owner: '{{ item.owner }}' - group: '{{ item.group }}' - state: directory - mode: 0755 - with_items: - - path: /root/.ssh - owner: root - group: root - -- name: write ssh config - copy: - content: "UserKnownHostsFile /dev/null\nStrictHostKeyChecking no" - dest: '{{ item.dest }}' - owner: '{{ item.owner }}' - group: '{{ item.group }}' - mode: 0600 - with_items: - - dest: /root/.ssh/config - owner: root - group: root - -- name: generate ssh keys - shell: if [ ! -f ~/.ssh/id_rsa.pub ]; \ - then ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ""; \ - else echo "already gen ssh key!"; fi; - -- name: fetch ssh keys - fetch: - src: /root/.ssh/id_rsa.pub - dest: /tmp/ssh-keys-{{ ansible_hostname }} - flat: "yes" - -- authorized_key: - user: root - key: "{{ lookup('file', item) }}" - with_fileglob: - - /tmp/ssh-keys-* - - /root/.ssh/id_rsa.pub - -- name: change sources(yum) list - copy: - src: centos_base.repo - dest: /etc/yum.repos.d/centos_base.repo - -- name: Install yum packages - yum: - pkg: "{{ item }}" - state: "present" - with_items: "{{ yumpackages }}" - -- name: add the appropriate kernel modules - copy: - src: modules - dest: /etc/modules-load.d/openstack-ansible.conf - -- name: restart ntp service - shell: "systemctl enable ntpd.service && systemctl start ntpd.service" - -- name: change the MaxSessions - lineinfile: - dest: /etc/ssh/sshd_config - line: "MaxSessions 500" - -- name: restart ssh service - shell: service sshd restart diff --git a/deploy/adapters/ansible/roles/pre-prepare/tasks/Ubuntu.yml b/deploy/adapters/ansible/roles/pre-prepare/tasks/Ubuntu.yml deleted file mode 100644 index a0f7d015..00000000 --- a/deploy/adapters/ansible/roles/pre-prepare/tasks/Ubuntu.yml +++ /dev/null @@ -1,76 +0,0 @@ -############################################################################## -# 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: make sure ssh dir exist - file: - path: '{{ item.path }}' - owner: '{{ item.owner }}' - group: '{{ item.group }}' - state: directory - mode: 0755 - with_items: - - path: /root/.ssh - owner: root - group: root - -- name: write ssh config - copy: - content: "UserKnownHostsFile /dev/null\nStrictHostKeyChecking no" - dest: '{{ item.dest }}' - owner: '{{ item.owner }}' - group: '{{ item.group }}' - mode: 0600 - with_items: - - dest: /root/.ssh/config - owner: root - group: root - -- name: generate ssh keys - shell: if [ ! -f ~/.ssh/id_rsa.pub ]; \ - then ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ""; \ - else echo "already gen ssh key!"; fi; - -- name: fetch ssh keys - fetch: - src: /root/.ssh/id_rsa.pub - dest: /tmp/ssh-keys-{{ ansible_hostname }} - flat: "yes" - -- authorized_key: - user: root - key: "{{ lookup('file', item) }}" - with_fileglob: - - /tmp/ssh-keys-* - - /root/.ssh/id_rsa.pub - -- name: change sourcesi(apt) list - template: - src: sources.list - dest: /etc/apt/sources.list - -- name: rm apt.conf - file: - path: /etc/apt/apt.conf - state: absent - -- name: restart ntp service - shell: "service ntp restart" - -- name: add the appropriate kernel modules - copy: - src: modules - dest: /etc/modules - -- name: change the MaxSessions - lineinfile: - dest: /etc/ssh/sshd_config - line: "MaxSessions 500" - -- name: restart ssh service - shell: service ssh restart diff --git a/deploy/adapters/ansible/roles/pre-prepare/tasks/main.yml b/deploy/adapters/ansible/roles/pre-prepare/tasks/main.yml deleted file mode 100644 index 76203440..00000000 --- a/deploy/adapters/ansible/roles/pre-prepare/tasks/main.yml +++ /dev/null @@ -1,14 +0,0 @@ -############################################################################## -# 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 -############################################################################## ---- -- include: "{{ ansible_distribution }}.yml" - when: ansible_distribution == 'Ubuntu' - -- include: "{{ ansible_os_family }}.yml" - when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' diff --git a/deploy/adapters/ansible/roles/pre-prepare/templates/sources.list b/deploy/adapters/ansible/roles/pre-prepare/templates/sources.list deleted file mode 100644 index 799e4b58..00000000 --- a/deploy/adapters/ansible/roles/pre-prepare/templates/sources.list +++ /dev/null @@ -1,36 +0,0 @@ -# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to -# newer versions of the distribution. - -deb http://archive.ubuntu.com/ubuntu/ xenial main restricted -deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted - -## Major bug fix updates produced after the final release of the -## distribution. -deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted -deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted - -## Uncomment the following two lines to add software from the 'universe' -## repository. -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team. Also, please note that software in universe WILL NOT receive any -## review or updates from the Ubuntu security team. -deb http://archive.ubuntu.com/ubuntu/ xenial universe -deb-src http://archive.ubuntu.com/ubuntu/ xenial universe -deb http://archive.ubuntu.com/ubuntu/ xenial-updates universe -deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates universe - -## N.B. software from this repository may not have been tested as -## extensively as that contained in the main release, although it includes -## newer versions of some applications which may provide useful features. -## Also, please note that software in backports WILL NOT receive any review -## or updates from the Ubuntu security team. -# deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted -# deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted - -deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted -deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted -deb http://archive.ubuntu.com/ubuntu/ xenial-security universe -deb-src http://archive.ubuntu.com/ubuntu/ xenial-security universe -# deb http://archive.ubuntu.com/ubuntu/ xenial-security multiverse -# deb-src http://archive.ubuntu.com/ubuntu/ xenial-security multiverse - diff --git a/deploy/adapters/ansible/roles/pre-prepare/vars/main.yml b/deploy/adapters/ansible/roles/pre-prepare/vars/main.yml deleted file mode 100644 index f44a9f9f..00000000 --- a/deploy/adapters/ansible/roles/pre-prepare/vars/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -aptpackages: -- bridge-utils -- debootstrap -- ifenslave -- ifenslave-2.6 -- lsof -- lvm2 -- ntp -- ntpdate -- sudo -- vlan -- tcpdump - -yumpackages: -- bridge-utils -- iputils -- lvm2 -- ntp -- tcpdump diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml index efe8745b..f636ed10 100644 --- a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml +++ b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml @@ -12,3 +12,5 @@ cd /opt/openstack-ansible/playbooks; \ openstack-ansible setup-ovs.yml \ | tee -a /var/log/osa/ovs.log > /dev/null" + when: NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" or \ + NEUTRON_MECHANISM_DRIVERS[0] == "opendaylight" -- cgit 1.2.3-korg