aa3aa654a123600f60299aeab4e74f2387c6a7c1
[oom/offline-installer.git] / docs / InstallGuide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2021 Samsung Electronics Co., Ltd.
4
5 Offline Installer - Installation Guide
6 ======================================
7
8 This document describes offline installation procedure for `OOM ONAP`_, which is done by the ansible based `Offline installer`_.
9
10 Before you dive into the installation you should prepare the offline installer itself - the installer consists of at least two packages/resources. You can read about it in the `Build Guide`_, which provides the instructions for creating them.
11
12 This current version of the *Installation Guide* supports `El Alto release`_.
13
14 -----
15
16 Part 1. Prerequisites
17 ---------------------
18
19 OOM ONAP deployment has certain hardware resource requirements - `El Alto requirements`_:
20
21 Community recommended footprint from `El Alto requirements`_ page is 16 VMs ``224 GB RAM`` and ``112 vCPUs``. We will not follow strictly this setup due to such demanding resource consumption and so we will deploy our installation across four nodes (VMs) instead of sixteen. Our simplified setup is definitively not supported or recommended - you are free to diverge - you can follow the official guidelines or make completely different layout, but the minimal count of nodes should not drop below three - otherwise you may have to do some tweaking to make it work, which is not covered here (there is a pod count limit for a single kubernetes node - you can read more about it in this `discussion <https://lists.onap.org/g/onap-discuss/topic/oom_110_kubernetes_pod/25213556>`_).
22
23 Kubernetes cluster
24 ~~~~~~~~~~~~~~~~~~
25
26 The four nodes/VMs will be running these services:
27
28 - **infra-node**::
29
30     - nexus
31     - nginx proxy
32     - dns
33     - kubernetes-etcd
34     - kubernetes-control-plane
35
36 **NOTE:** kubernetes-* roles can be collocated directly with kubernetes nodes and not necessarily on infra node.
37
38 - **kubernetes node 1-3**::
39
40     - kubernetes worker
41
42 You don't need to care about these services now - that is the responsibility of the installer (described below). Just start four VMs as seen in this table (or according to your needs as we hinted above):
43
44 .. _Overview table of the kubernetes cluster:
45
46 Kubernetes cluster overview
47 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
48
49 In El Alto we are using RKE as k8s orchestrator method, however everyone is free to diverge from this example and can set it up in own way omitting our rke playbook execution.
50
51 =================== ================== ==================== ============== ============ ===============
52 KUBERNETES NODE     OS                 NETWORK              CPU            RAM          STORAGE
53 =================== ================== ==================== ============== ============ ===============
54 **infra-node**      RHEL/CentOS 7.6    ``10.8.8.100/24``    ``8 vCPUs``    ``8 GB``     ``100 GB``
55 **kube-node1**      RHEL/CentOS 7.6    ``10.8.8.101/24``    ``16 vCPUs``   ``56+ GB``   ``100 GB``
56 **kube-node2**      RHEL/CentOS 7.6    ``10.8.8.102/24``    ``16 vCPUs``   ``56+ GB``   ``100 GB``
57 **kube-node3**      RHEL/CentOS 7.6    ``10.8.8.103/24``    ``16 vCPUs``   ``56+ GB``   ``100 GB``
58 SUM                                                         ``56 vCPUs``   ``176+ GB``  ``400 GB``
59 =========================================================== ============== ============ ===============
60
61 As of now, the offline installer supports only **RHEL 7.x** and **CentOS 7.6** distributions, with at least *@core* and *@base* package groups installed including *Mandatory* and *Default* package sets. So, your VMs should be preinstalled with this operating system - the hypervisor and platform can be of your choosing.
62
63 We will expect from now on that you installed four VMs and they are connected to the shared network. All VMs must be reachable from our *install-server* (below), which can be the hypervisor, *infra-node* or completely different machine. But in either of these cases the *install-server* must be able to connect over ssh to all of these nodes.
64
65 Install-server
66 ~~~~~~~~~~~~~~
67
68 We will use distinct *install-server* and keep it separate from the four-node cluster. But if you wish so, you can use *infra-node* for this goal (if you use the default ``'chroot'`` option of the installer), but in that case double the size of the storage requirement!
69
70 Prerequisites for the *install-server*:
71
72 - packages described in `Build Guide`_
73 - extra ``100 GB`` storage (to have space where to store these packages)
74 - installed ``'chroot'`` and/or ``'docker'`` system commands
75 - network connection to the nodes - especially functioning ssh client
76
77 Our *install-server* will have ip: ``10.8.8.4``.
78
79 **NOTE:** All the subsequent commands below, are executed from within this *install-server*.
80
81 -----
82
83 Part 2. Preparation and configuration
84 -------------------------------------
85
86 We *MUST* do all the following instructions from the *install-server* and also we will be running them as a user ``root``. But that is not necessary - you can without any problem pick and use a regular user. The ssh/ansible connection to the nodes will also expect that we are connecting as a ``root`` - you need to elevate privileges to be able to install on them. Although it can be achieved by other means (sudo), we decided here to keep instructions simple.
87
88 Installer packages
89 ~~~~~~~~~~~~~~~~~~
90
91 As was stated above you must have prepared the installer packages (names will differ - check out the `Build Guide`_):
92
93 - sw_package.tar
94 - resources_package.tar
95 - aux_package.tar
96
97 **NOTE:** ``'aux_package.tar'`` is optional and if you don't have use for it, you can ignore it.
98
99 We will store them in the ``/data`` directory on the *install-server* and then we will unpack the ``'sw'`` package to your home directory for example::
100
101     $ mkdir ~/onap-offline-installer
102     $ tar -C ~/onap-offline-installer -xf /data/sw_package.tar
103
104 Application directory
105 ~~~~~~~~~~~~~~~~~~~~~
106
107 Change the current directory to the ``'ansible'``::
108
109     $ cd ~/onap-offline-installer/ansible
110
111 You can see multiple files and directories inside - this is the *offline-installer*. It is implemented as a set of ansible playbooks.
112
113 If you created the ``'sw'`` package according to the *Build Guide* then you should have had the *offline-installer* populated with at least the following files:
114
115 - ``application/application_configuration.yml``
116 - ``inventory/hosts.yml``
117
118 Following paragraphs describe fine-tuning of ``'inventory.yml'`` and ``'application_configuration.yml'`` to reflect your VMs setup.
119
120 hosts.yml
121 ~~~~~~~~~
122
123 We need to setup the ``'hosts.yml'`` first, the template looks like this::
124
125     ---
126     # This group contains hosts with all resources (binaries, packages, etc.)
127     # in tarball.
128     all:
129       vars:
130         # this key is supposed to be generated during setup.yml playbook execution
131         # change it just when you have better one working for all nodes
132         ansible_ssh_private_key_file: /root/.ssh/offline_ssh_key
133         ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
134
135       children:
136         resources:
137           hosts:
138             resource-host:
139               ansible_host: 10.8.8.5
140
141         # This is group of hosts where nexus, nginx, dns and all other required
142         # services are running.
143         infrastructure:
144           hosts:
145             infrastructure-server:
146               ansible_host: 10.8.8.13
147               #IP used for communication between infra and kubernetes nodes, must be specified.
148               cluster_ip: 10.8.8.13
149
150         # This is group of hosts which are/will be part of Kubernetes cluster.
151         kubernetes:
152           children:
153             # This is a group of hosts containing kubernetes worker nodes.
154             kubernetes-node:
155               hosts:
156                 kubernetes-node-1:
157                   ansible_host: 10.8.8.19
158                   #ip of the node that it uses for communication with k8s cluster.
159                   cluster_ip: 10.8.8.19
160
161             # Group of hosts containing etcd cluster nodes.
162             # Defaults to infra.
163             kubernetes-etcd:
164               hosts:
165                 infrastructure-server
166
167             # This is a group of hosts that are to be used as kubernetes control plane nodes.
168             # This means they host kubernetes api server, controller manager and scheduler.
169             # This example uses infra for this purpose, however note that any
170             # other host could be used including kubernetes nodes.
171             # cluster_ip needs to be set for hosts used as control planes.
172             kubernetes-control-plane:
173               hosts:
174                 infrastructure-server
175
176         nfs-server:
177           hosts:
178             kubernetes-node-1
179
180 There is some ssh configuration under the ``'vars'`` section - we will deal with ssh setup a little bit later in the `SSH authentication`_.
181
182 We need to first correct the ip addresses and add a couple of kubernetes nodes to match our four-node cluster:
183
184 - Under the ``'resource-host'`` set the ``'ansible_host'`` address to the ip of your server, where the packages are stored - it must be reachable by ssh from the *install-server* (for ansible to run playbooks on it)  **AND** *infra-node* (to extract resource data from *resource-host* to *infra-node* over ssh). In our scenario the *resource-host* is the same as the *install-server*: ``'10.8.8.4'``
185 - Similarly, set the ``'ansible_host'`` to the address of the *infra-node* under the ``'infrastructure-server'``.
186 - Copy the whole ``'kubernetes-node-1'`` subsection and paste it twice directly after.  Change the numbers to ``'kubernetes-node-2'`` and ``'kubernetes-node-3'`` respectively and fix the addresses in the ``'ansible_host'`` variables again to match *kube-node1*, *kube-node2* and *kube-node3*.
187
188 As you can see, there is another ``'cluster_ip'`` variable for each node - this serve as a designated node address in the kubernetes cluster. Make it the same as the respective ``'ansible_host'``.
189
190 **NOTE:** In our simple setup we have only one interface per node, but that does not need to be a case for some other deployment - especially if we start to deal with a production usage. Basically, an ``'ansible_host'`` is an entry point for the *install-server's* ansible (*offline-installer*), but the kubernetes cluster can be communicating on a separate network to which *install-server* has no access. That is why we have this distinctive variable, so we can tell the installer that there is a different network, where we want to run the kubernetes traffic and what address each node has on such a network.
191
192 After all the changes, the ``'hosts.yml'`` should look similar to this::
193
194     ---
195     # This group contains hosts with all resources (binaries, packages, etc.)
196     # in tarball.
197     all:
198       vars:
199         # this key is supposed to be generated during setup.yml playbook execution
200         # change it just when you have better one working for all nodes
201         ansible_ssh_private_key_file: /root/.ssh/offline_ssh_key
202         ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
203
204       children:
205         resources:
206           hosts:
207             resource-host:
208               ansible_host: 10.8.8.4
209
210         # This is group of hosts where nexus, nginx, dns and all other required
211         # services are running.
212         infrastructure:
213           hosts:
214             infrastructure-server:
215               ansible_host: 10.8.8.100
216               #IP used for communication between infra and kubernetes nodes, must be specified.
217               cluster_ip: 10.8.8.100
218
219         # This is group of hosts which are/will be part of Kubernetes cluster.
220         kubernetes:
221           children:
222             # This is a group of hosts containing kubernetes worker nodes.
223             kubernetes-node:
224               hosts:
225                 kubernetes-node-1:
226                   ansible_host: 10.8.8.101
227                   #ip of the node that it uses for communication with k8s cluster.
228                   cluster_ip: 10.8.8.101
229                 kubernetes-node-2:
230                   ansible_host: 10.8.8.102
231                   #ip of the node that it uses for communication with k8s cluster.
232                   cluster_ip: 10.8.8.102
233                 kubernetes-node-3:
234                   ansible_host: 10.8.8.103
235                   #ip of the node that it uses for communication with k8s cluster.
236                   cluster_ip: 10.8.8.103
237
238             # Group of hosts containing etcd cluster nodes.
239             # Defaults to infra.
240             kubernetes-etcd:
241               hosts:
242                 infrastructure-server
243
244             # This is a group of hosts that are to be used as kubernetes control plane nodes.
245             # This means they host kubernetes api server, controller manager and scheduler.
246             # This example uses infra for this purpose, however note that any
247             # other host could be used including kubernetes nodes.
248             # cluster_ip needs to be set for hosts used as control planes.
249             kubernetes-control-plane:
250               hosts:
251                 infrastructure-server
252
253         nfs-server:
254           hosts:
255             kubernetes-node-1
256
257 application_configuration.yml
258 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259
260 Here, we will be interested in the following variables:
261
262 - ``resources_dir``
263 - ``resources_filename``
264 - ``aux_resources_filename``
265 - ``app_data_path``
266 - ``aux_data_path``
267 - ``app_name``
268 - ``timesync``
269
270 ``'resource_dir'``, ``'resources_filename'`` and ``'aux_resources_filename'`` must correspond to the file paths on the *resource-host* (variable ``'resource_host'``), which is in our case the *install-server*.
271
272 The ``'resource_dir'`` should be set to ``'/data'``, ``'resources_filename'`` to ``'resources_package.tar'`` and ``'aux_resources_filename'`` to ``'aux_package.tar'``. The values should be the same as are in the `Installer packages`_ section.
273
274 ``'app_data_path'`` is the absolute path on the *infra-node* to where the package ``'resources_package.tar'`` will be extracted and similarly ``'aux_data_path'`` is another absolute path for ``'aux_package.tar'``. Both the paths are fully arbitrary, but they should point to the filesystem with enough space - the storage requirement in `Overview table of the kubernetes cluster`_.
275
276 **NOTE:** As we mentioned in `Installer packages`_ - the auxiliary package is not mandatory and we will not utilize it in here either.
277
278 The ``'app_name'`` variable should be short and descriptive. We will set it simply to: ``onap``.
279
280 The ``'timesync'`` variable is optional and controls synchronisation of the system clock on hosts. It should be configured only if a custom NTP server is available and needed. Such a time authority should be on a host reachable from all installation nodes. If this setting is not provided then the default behavior is to setup NTP daemon on infra-node and sync all kube-nodes' time with it.
281
282 If you wish to provide your own NTP servers configure their IPs as follows::
283
284     timesync:
285       servers:
286        - <ip address of NTP_1>
287        - <...>
288        - <ip address of NTP_N>
289
290 Another time adjustment related variables are ``'timesync.slewclock'`` and ``'timesync.timezone'`` .
291 First one can have value of ``'true'`` or ``'false'`` (default). It controls whether (in case of big time difference compared to server) time should be adjusted gradually by slowing down or speeding up the clock as required (``'true'``) or in one step (``'false'``)::
292
293     timesync:
294       slewclock: true
295
296 Second one controls time zone setting on host. It's value should be time zone name according to tz database names with ``'Universal'`` being the default one::
297
298     timesync.
299       timezone: UTC
300
301 ``'timesync.servers'``, ``'timesync.slewclock'`` and ``'timesync.timezone'`` settings can be used independently.
302
303 Final configuration can resemble the following::
304
305     resources_dir: /data
306     resources_filename: resources_package.tar
307     app_data_path: /opt/onap
308     app_name: onap
309     timesync:
310       servers:
311         - 192.168.0.1
312         - 192.168.0.2
313       slewclock: true
314       timezone: UTC
315
316 Helm chart value overrides
317 ^^^^^^^^^^^^^^^^^^^^^^^^^^
318
319 In El Alto OOM charts are coming with all ONAP components disabled, this setting is also prepackaged within our sw_package.tar. Luckily there are multiple ways supported how to override this setting. It's also necessary for setting-up VIM specific entries and basically to configure any stuff with non default values.
320
321 First option is to use ``overrides`` key in ``application_configuration.yml``.
322 These settings will override helm values originally stored in ``values.yaml`` files in helm chart directories.
323
324 For example, the following lines could be appended to ``application_configuration.yml`` to set up managed openstack credentials for onap's so component::
325
326     overrides:
327       so:
328         config:
329           openStackUserName: "os_user"
330           openStackRegion: "region_name"
331           openStackKeyStoneUrl: "keystone_url"
332           openStackEncryptedPasswordHere: "encrypted_password"
333
334 In addition or alternatively to that one can configure ``helm_override_files`` key, which is new feature implemented in Change-Id: I8b8ded38b39aa9a75e55fc63fa0e11b986556cb8.
335
336 SSH authentication
337 ~~~~~~~~~~~~~~~~~~
338
339 We are almost finished with the configuration and we are close to start the installation, but we need to setup password-less login from *install-server* to the nodes.
340
341 You can use the ansible playbook ``'setup.yml'`` like this::
342
343     $ ./run_playbook.sh -i inventory/hosts.yml setup.yml -u root --ask-pass
344
345 You will be asked for password per each node and the playbook will generate a unprotected ssh key-pair ``'~/.ssh/offline_ssh_key'``, which will be distributed to the nodes.
346
347 Another option is to generate a ssh key-pair manually. We strongly advise you to protect it with a passphrase, but for simplicity we will showcase generating of a private key without any such protection::
348
349     $ ssh-keygen -N "" -f ~/.ssh/identity
350
351 The next step will be to distribute the public key to these nodes and from that point no password is needed::
352
353     $ for ip in 100 101 102 103 ; do ssh-copy-id -i ~/.ssh/identity.pub root@10.8.8.${ip} ; done
354
355 This command behaves almost identically to the ``'setup.yml'`` playbook.
356
357 If you generated the ssh key manually then you can now run the ``'setup.yml'`` playbook like this and achieve the same result as in the first execution::
358
359     $ ./run_playbook.sh -i inventory/hosts.yml setup.yml
360
361 This time it should not ask you for any password - of course this is very redundant, because you just distributed two ssh keys for no good reason.
362
363 We can finally edit and finish the configuration of the ``'hosts.yml'``:
364
365 - if you used the ``'setup.yml'`` playbook then you can just leave this line as it is::
366
367     ansible_ssh_private_key_file: /root/.ssh/offline_ssh_key
368
369 - if you created a ssh key manually then change it like this::
370
371     ansible_ssh_private_key_file: /root/.ssh/identity
372
373 -----
374
375 Part 3. Installation
376 --------------------
377
378 We should have the configuration complete and be ready to start the installation. The installation is done via ansible playbooks, which are run either inside a **chroot** environment (default) or from the **docker** container. If for some reason you want to run playbooks from the docker instead of chroot then you cannot use *infra-node* or any other *kube-node* as the *install-server* - otherwise you risk that installation will fail due to restarting of the docker service.
379
380 If you built your ``'sw'`` package well then there should be the file ``'ansible_chroot.tgz'`` inside the ``'docker'`` directory. If not then you must create it - to learn how to do that and to get more info about the scripts dealing with docker and chroot, go to `Appendix 1. Ansible execution/bootstrap`_
381
382 We will use the default chroot option so we don't need any docker service to be running.
383
384 Installation is actually very straightforward now::
385
386     $ ./run_playbook.sh -i inventory/hosts.yml -e @application/application_configuration.yml site.yml
387
388 This will take a while so be patient.
389
390 ``'site.yml'`` playbook actually runs in the order the following playbooks:
391
392 - ``upload_resources.yml``
393 - ``infrastructure.yml``
394 - ``rke.yml``
395 - ``application.yml``
396
397 ----
398
399 Part 4. Post-installation and troubleshooting
400 ---------------------------------------------
401
402 After all of the playbooks are run successfully, it will still take a lot of time until all pods are up and running. You can monitor your newly created kubernetes cluster for example like this::
403
404     $ ssh -i ~/.ssh/offline_ssh_key root@10.8.8.100 # tailor this command to connect to your infra-node
405     $ watch -d -n 5 'kubectl get pods --all-namespaces'
406
407 Alternatively you can monitor progress with ``helm_deployment_status.py`` script located in offline-installer directory. Transfer it to infra-node and run::
408
409     $ python helm_deployment_status.py -n <namespace_name> # namespace defaults to onap
410
411 To automatically verify functionality with healthchecks after deployment becomes ready or after timeout period expires, append ``-hp`` switch followed by the full path to the healthcheck script and ``--health-mode`` optional switch with appropriate mode supported by that script (``health`` by default, ``--help`` displays available modes)::
412
413     $ python helm_deployment_status.py -hp <app_data_path>/<app_name>/helm_charts/robot/ete-k8s.sh --health-mode <healthcheck mode>
414
415 It is strongly recommended to tailor ``helm_deployment_status.py`` to your needs since default values might not be what you'd expect. The defaults can be displayed with ``--help`` switch.
416
417 Final result of installation varies based on number of k8s nodes used and distribution of pods. In some dev envs we quite frequently hit problems with not all pods properly deployed. In successful deployments all jobs should be in successful state.
418 This can be verified using ::
419
420     $ kubectl get jobs -n <namespace>
421
422 If some of the job is hanging in some wrong end-state like ``'BackoffLimitExceeded'`` manual intervention is required to heal this and make also dependent jobs passing. More details about particular job state can be obtained using ::
423
424     $ kubectl describe job -n <namespace> <job_name>
425
426 If manual intervention is required, one can remove failing job and retry helm install command directly, which will not launch full deployment but rather check current state of the system and rebuild parts which are not up & running. Exact commands are as follows ::
427
428     $ kubectl delete job -n <namespace> <job_name>
429     $ helm deploy <env_name> <helm_chart_name> --namespace <namespace_name>
430
431     E.g. helm deploy dev local/onap --namespace onap
432
433 Once all pods are properly deployed and in running state, one can verify functionality e.g. by running onap healthchecks ::
434
435     $ cd <app_data_path>/<app_name>/helm_charts/robot
436     $ ./ete-k8s.sh onap health
437
438 For better work with terminal screen and jq packages were added . It can be installed from resources directory.
439
440 Screen is a terminal multiplexer. With screen it is possible to have more terminal instances active. Screen as well keeps active SSH connections even terminal is closed.
441
442 Jq can be used for editing json data format as output of kubectl. For example jq was used to troubleshoot `SDNC-739 (UEB - Listener in Crashloopback) <https://jira.onap.org/browse/SDNC-739/>`_ ::
443
444     $ kubectl -n onap get job onap-sdc-sdc-be-config-backend -o json | jq "del(.spec.selector)" | jq "del(.spec.template.metadata.labels)" | kubectl -n onap replace --force -f -
445
446 -----
447
448 Appendix 1. Ansible execution/bootstrap
449 ---------------------------------------
450
451 There are two ways how to easily run the installer's ansible playbooks:
452
453 - If you already have or can install a docker then you can build the provided ``'Dockerfile'`` for the ansible and run playbooks in the docker container.
454 - Another way to deploy ansible is via chroot environment which is bundled together within this directory.
455
456 (Re)build docker image and/or chroot archive
457 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
458
459 Inside the ``'docker'`` directory is the ``'Dockerfile'`` and ``'build_ansible_image.sh'`` script. You can run ``'build_ansible_image.sh'`` script on some machine with the internet connectivity and it will download all required packages needed for building the ansible docker image and for exporting it into a flat chroot environment.
460
461 Built image is exported into ``'ansible_chroot.tgz'`` archive in the same (``'docker'``) directory.
462
463 This script has two optional arguments:
464
465 #. ansible version
466 #. docker image name
467
468 **Note:** if optional arguments are not used, docker image name will be set to ``'ansible'`` by default.
469
470 Launching ansible playbook using chroot environment
471 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
472
473 This is the default and preferred way of running ansible playbooks in an offline environment as there is no dependency on docker to be installed on the system. Chroot environment is already provided by included archive ``'ansible_chroot.tgz'``.
474
475 It should be available in the ``'docker'`` directory as the end-result of the packaging script or after manual run of the ``'build_ansible_image.sh'`` script referenced above.
476
477 All playbooks can be executed via ``'./run_playbook.sh'`` wrapper script.
478
479 To get more info about the way how the ``'./run_playbook.sh'`` wrapper script should be used, run::
480
481     $ ./run_playbook.sh
482
483 The main purpose of this wrapper script is to provide the ansible framework to a machine where it was bootstrapped without need of installing additional packages. The user can run this to display ``'ansible-playbook'`` command help::
484
485     $ ./run_playbook.sh --help
486
487 Developers notes
488 ~~~~~~~~~~~~~~~~
489
490 * There are two scripts which work in tandem for creating and running chroot
491 * First one can convert docker image into chroot directory
492 * Second script will automate chrooting (necessary steps for chroot to work and cleanup)
493 * Both of them have help - just run::
494
495     $ cd docker
496     $ ./create_docker_chroot.sh help
497     $ ./run_chroot.sh help
498
499 Example usage::
500
501     $ sudo su
502     $ docker/create_docker_chroot.sh convert some_docker_image ./new_name_for_chroot
503     $ cat ./new_name_for_chroot/README.md
504     $ docker/run_chroot.sh execute ./new_name_for_chroot cat /etc/os-release 2>/dev/null
505
506 Launching ansible playbook using docker container (ALTERNATIVE APPROACH)
507 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
508
509 This option is here just to keep support for the older method which relies on a running docker service. For the offline deployment use the chroot option as indicated above.
510
511 You will not need ``'ansible_chroot.tgz'`` archive anymore, but the new requirement is a prebuilt docker image of ansible (based on the provided ``'Dockerfile'``). It should be available in your local docker repository (otherwise the default name ``'ansible'`` may fetch unwanted image from default registry!).
512
513 To trigger this functionality and to run ``'ansible-playbook'`` inside a docker container instead of the chroot environment, you must first set the ``ANSIBLE_DOCKER_IMAGE`` variable. The value must be a name of the built ansible docker image.
514
515 Usage is basically the same as with the default chroot way - the only difference is the existence of the environment variable::
516
517     $ ANSIBLE_DOCKER_IMAGE=ansible ./run_playbook.sh --help
518
519 -----
520
521 .. _Build Guide: ./BuildGuide.rst
522 .. _El Alto requirements: https://onap.readthedocs.io/en/elalto/guides/onap-developer/settingup/index.html#installing-onap
523 .. _El Alto release: https://docs.onap.org/en/elalto/release/
524 .. _OOM ONAP: https://docs.onap.org/projects/onap-oom/en/latest/index.html
525 .. _Offline installer: https://gerrit.onap.org/r/q/oom/offline-installer