From 3bf88a80668ce410b423e25a259bf4d59fd05417 Mon Sep 17 00:00:00 2001 From: Michal Zegan Date: Thu, 22 Aug 2019 14:55:16 +0200 Subject: Add inventory for cicdansible playbook This change adds the basic inventory file and group_vars used when running cicdansible playbook to deploy onap on openstack. This inventory contains only instances that must be present, other inventory entries are dynamically registered during install. Also, it delegates to group_vars for things like floating ip addresses. group_vars contains default settings for the playbook, and especially the all.yml must be modified for the environment to be deployed. Change-Id: Ia93e6b98841d7edc45699b44b2479af6daff6c4f Issue-ID: OOM-2042 Signed-off-by: Michal Zegan --- tools/cicdansible/group_vars/all.yml | 63 ++++++++++++++++++++++++++++++ tools/cicdansible/group_vars/instances.yml | 11 ++++++ tools/cicdansible/group_vars/nodes.yml | 5 +++ tools/cicdansible/group_vars/resources.yml | 6 +++ 4 files changed, 85 insertions(+) create mode 100644 tools/cicdansible/group_vars/all.yml create mode 100644 tools/cicdansible/group_vars/instances.yml create mode 100644 tools/cicdansible/group_vars/nodes.yml create mode 100644 tools/cicdansible/group_vars/resources.yml (limited to 'tools/cicdansible/group_vars') diff --git a/tools/cicdansible/group_vars/all.yml b/tools/cicdansible/group_vars/all.yml new file mode 100644 index 00000000..581e7c4a --- /dev/null +++ b/tools/cicdansible/group_vars/all.yml @@ -0,0 +1,63 @@ +--- +#General configuration, can be overridden in cmdline. +#Authentication/keystone url. +os_auth_url: "" +#Openstack username. +os_username: "" +#Password. +os_password: "" +#Domain name. +os_domain_name: "default" +#Project name. +os_project_name: "" +#The name or id of public network used to communicate with instances. +public_network: "" +#Floating ip address for first node instance +first_node_ip: "" +#Floating ip of infra instance. +infra_ip: "" +#Floating ip of installer. +installer_ip: "" +#Openstack flavor name for nodes. +node_flavor_name: "" +#Flavor name for infra instance. +infra_flavor_name: "" +#Flavor name for installer instance. +installer_flavor_name: "" +#Name of the image for instances. +image_name: "" +#Cidr of private subnet where instances are connected. +subnet_cidr: "10.1.0.0/24" +#Start of dhcp allocation range for subnet. +subnet_range_start: "10.1.0.4" +#Subnet allocation range end. +subnet_range_end: "10.1.0.254" +#Ip address of router used as a gateway to external network. +router_addr: "10.1.0.1" +#Cidr of external subnet to allow access to, 0.0.0.0/0 means allow internet access. +# For offline deployment it is recommended to set this to a cidr of intranet. +external_subnet_cidr: "" +#Address of cicd docker registry. +cicd_docker_registry: "" +#Number of nodes to deploy. +num_nodes: "3" +#Stack name to deploy on heat. +stack_name: "installer-test" +#Address of resource server with packages. +resource_host: "" +#Directory with all onap packages (on resource host). +resources_dir: "" +#Filename of software package. +resources_sw_filename: "sw_package.tar" +#Filename of binary resources. +resources_filename: "resources_package.tar" +#Filename of auxiliary resources. +aux_resources_filename: "aux_package.tar" +#Whether to deploy app. +#Setting it to false will skip deployment, but instance preconfiguration +#will still be done and sw resources uploaded to the installer host. +install_app: true +# This is a string containing base64-encoded yaml blob passed to offline installer via -e option. +# You can use it to override any variable in offline installer except those +# supported directly by cicdansible. +application_config: '' diff --git a/tools/cicdansible/group_vars/instances.yml b/tools/cicdansible/group_vars/instances.yml new file mode 100644 index 00000000..0d756a57 --- /dev/null +++ b/tools/cicdansible/group_vars/instances.yml @@ -0,0 +1,11 @@ +#Configuration for all instances. +#User to log in to instances as. +ansible_user: root +#Whether to become root using sudo or such like, no by default. +ansible_become: no +#Private key to use to access instances. +ansible_private_key_file: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa" +#Arguments to skip host key verification for instances, modify only if you know what you are doing. +disable_ssh_host_auth: "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" +ansible_ssh_common_args: "{{ disable_ssh_host_auth }}" + diff --git a/tools/cicdansible/group_vars/nodes.yml b/tools/cicdansible/group_vars/nodes.yml new file mode 100644 index 00000000..76a222c2 --- /dev/null +++ b/tools/cicdansible/group_vars/nodes.yml @@ -0,0 +1,5 @@ +#Configuration for kubernetes nodes. +#This redirects ssh connections through the installer instance, to allow connecting via internal ip. +#It should work even on openssh versions lacking -j option support. +#The value is based heavily on the default from parent group. +ansible_ssh_common_args: "{{ disable_ssh_host_auth }} -o ProxyCommand='ssh {{ disable_ssh_host_auth }} -i {{ ansible_private_key_file }} -W %h:%p root@{{ installer_ip }}'" diff --git a/tools/cicdansible/group_vars/resources.yml b/tools/cicdansible/group_vars/resources.yml new file mode 100644 index 00000000..e7c0f773 --- /dev/null +++ b/tools/cicdansible/group_vars/resources.yml @@ -0,0 +1,6 @@ +#Resource host configuration. +#Define used private key. +ansible_private_key_file: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa" +#User login data. +ansible_user: root +ansible_become: no -- cgit 1.2.3-korg