--- /dev/null
+---
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 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
+##############################################################################
+lxd_bridge: "lxdbr0"
+lxd_domain: "lxd"
+lxd_ipv4_addr: "10.0.8.1"
+lxd_ipv4_netmask: "255.255.255.0"
+lxd_ipv4_network: "10.0.8.1/24"
+lxd_ipv4_dhcp_range: "10.0.8.2,10.0.8.254"
+lxd_ipv4_dhcp_max: "250"
+lxd_ipv4_nat: "true"
+lxd_ipv6_addr: ""
+lxd_ipv6_mask: ""
+lxd_ipv6_network: ""
+lxd_ipv6_nat: "false"
+lxd_ipv6_proxy: "false"
--- /dev/null
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 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: install OSM required packages
+ package:
+ name: "{{ osm_required_packages[ansible_pkg_mgr] }}"
+ state: present
+
+- name: initialize LXD
+ command: "{{ item }}"
+ with_items:
+ - lxd init --auto
+ - lxd waitready
+- name: stop lxd-bridge service
+ systemd:
+ name: lxd-bridge
+ state: stopped
+ daemon_reload: yes
+- name: create lxd-bridge configuration
+ template:
+ src: lxd-bridge.j2
+ dest: /etc/default/lxd-bridge
+ mode: 0755
+
+- name: ensure dnsmasq service is stopped before attempting to start lxd-bridge
+ service:
+ name: dnsmasq
+ state: stopped
+
+- name: ensure dnsmasq uses interface br-vlan for lxd-bridge
+ lineinfile:
+ path: /etc/dnsmasq.conf
+ regexp: '^interface='
+ line: 'interface=br-vlan'
+
+- name: ensure docker and lxd-bridge services are started and enabled
+ service:
+ name: "{{ item }}"
+ state: started
+ enabled: yes
+ with_items:
+ - docker
+ - lxd-bridge
+
+- name: get default interface
+ shell: route -n | awk '$1~/^0.0.0.0/ {print $8}'
+ register: default_interface
+ ignore_errors: False
+ changed_when: False
+
+- name: get mtu of the default interface {{ default_interface.stdout }}
+ shell: ip addr show {{ default_interface.stdout }} | perl -ne 'if (/mtu\s(\d+)/) {print $1;}'
+ register: default_interface_mtu
+ ignore_errors: False
+ changed_when: False
+
+- name: set lxdbr0 mtu to {{ default_interface_mtu.stdout }}
+ command: ifconfig lxdbr0 mtu {{ default_interface_mtu.stdout }}
+ ignore_errors: False
+ changed_when: False
+
+- name: add devuser to lxd and docker groups
+ user:
+ name: devuser
+ groups: lxd, docker
+ append: yes
--- /dev/null
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 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 OSM devops repo and checkout version {{ osm_devops_version }}
+ become_user: "{{ osm_install_user }}"
+ become: yes
+ git:
+ repo: "{{ osm_devops_git_url }}"
+ dest: "{{ osm_devops_clone_location }}"
+ version: "{{ osm_devops_version }}"
+
+- name: install OSM
+ become_user: "{{ osm_install_user }}"
+ become: yes
+ command: "/bin/bash ./install_osm.sh -y --nolxd"
+ args:
+ chdir: "{{ osm_devops_clone_location }}/installers"
+ creates: "/usr/bin/osm"
--- /dev/null
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 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
+##############################################################################
+
+# All the tasks for os-nosdn-osm scenario are executed post-deployment
+# so we do not run anything here
+- debug:
+ msg: "No pre-deployment task found for the scenario {{ deploy_scenario }}. Skipping."
--- /dev/null
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 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
+##############################################################################
+
+- include: configure-opnfvhost.yml
+- include: install-osm.yml
--- /dev/null
+USE_LXD_BRIDGE="true"
+LXD_BRIDGE="{{ lxd_bridge }}"
+UPDATE_PROFILE="true"
+LXD_CONFILE=""
+LXD_DOMAIN="{{ lxd_domain }}"
+LXD_IPV4_ADDR="{{ lxd_ipv4_addr }}"
+LXD_IPV4_NETMASK="{{ lxd_ipv4_netmask }}"
+LXD_IPV4_NETWORK="{{ lxd_ipv4_network }}"
+LXD_IPV4_DHCP_RANGE="{{ lxd_ipv4_dhcp_range }}"
+LXD_IPV4_DHCP_MAX="{{ lxd_ipv4_dhcp_max }}"
+LXD_IPV4_NAT="{{ lxd_ipv4_nat }}"
+LXD_IPV6_ADDR="{{ lxd_ipv6_addr }}"
+LXD_IPV6_MASK="{{ lxd_ipv6_mask }}"
+LXD_IPV6_NETWORK="{{ lxd_ipv6_network }}"
+LXD_IPV6_NAT="{{ lxd_ipv6_nat }}"
+LXD_IPV6_PROXY="{{ lxd_ipv6_proxy }}"
--- /dev/null
+---
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 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
+##############################################################################
+osm_required_packages:
+ apt:
+ - apt-transport-https
+ - ca-certificates
+ - software-properties-common
+ - docker.io
+ - snapd
+ - lxd
+
+osm_install_user: "devuser"
+osm_devops_clone_location: "/home/{{ osm_install_user }}/osm-devops"