summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichal Zegan <m.zegan@samsung.com>2019-08-22 14:55:16 +0200
committerMichal Zegan <m.zegan@samsung.com>2019-09-04 11:24:52 +0200
commit3bf88a80668ce410b423e25a259bf4d59fd05417 (patch)
tree7f0212559009edbc53b55bd213a6c9c09403ac13 /tools
parent07479cbc38ef4bf15ea0c4854c8af08e1201a53d (diff)
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 <m.zegan@samsung.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/cicdansible/group_vars/all.yml63
-rw-r--r--tools/cicdansible/group_vars/instances.yml11
-rw-r--r--tools/cicdansible/group_vars/nodes.yml5
-rw-r--r--tools/cicdansible/group_vars/resources.yml6
-rw-r--r--tools/cicdansible/hosts.yml28
5 files changed, 113 insertions, 0 deletions
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
diff --git a/tools/cicdansible/hosts.yml b/tools/cicdansible/hosts.yml
new file mode 100644
index 00000000..e4c416cf
--- /dev/null
+++ b/tools/cicdansible/hosts.yml
@@ -0,0 +1,28 @@
+#Default inventory.
+#This file should not be modified, instead modify group_vars.
+#NOTE
+#All kubernetes nodes including the first node are added to inventory dynamically.
+#Instances group with children.
+instances:
+ hosts:
+
+#Installer instance.
+ installer:
+ #Do not modify.
+ ansible_host: "{{ installer_ip }}"
+
+#Infra instance.
+ infra:
+ #Do not modify.
+ ansible_host: "{{ infra_ip }}"
+
+ children:
+ #Empty group for nodes, populated dynamically, do not modify please.
+ nodes:
+
+#The group for resource host, only first entry is considered.
+#This host contains onap installer packages including scripts.
+resources:
+ hosts:
+ resource_host:
+ ansible_host: "{{ resource_host }}"