Debian Codegraph @

ansible_collections/dellemc/unity/docs/INSTALLATION.md

raw symbols SCIP
1 <!--
2 Copyright (c) 2022-2025 Dell Inc., or its subsidiaries. All Rights Reserved.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9 -->
10
11 # Installation and execution of Ansible modules for Dell Unity
12
13 ## Installation of SDK
14 * Install the python SDK named [Storops](https://pypi.org/project/storops/). It can be installed using pip, based on appropriate python version. Execute this command:
15
16 pip install storops
17
18 * Alternatively, Other installation ways can be found from [SDK](https://github.com/emc-openstack/storops#readme) page
19
20 ## Building collections
21 * Use this command to build the collection from source code:
22
23 ansible-galaxy collection build
24
25 For more details on how to build a tar ball, please refer to: [Building the collection](https://docs.ansible.com/ansible/latest/dev_guide/developing_collections_distributing.html#building-your-collection-tarball)
26
27 ## Installing collections
28
29 #### Online installation of collections
30 * Use this command to install the latest collection hosted in [galaxy portal](https://galaxy.ansible.com/dellemc/unity):
31
32 ansible-galaxy collection install dellemc.unity -p <install_path>
33
34 #### Offline installation of collections
35
36 * Download the latest tar build from any of the available distribution channel [Ansible Galaxy](https://galaxy.ansible.com/dellemc/unity) /[Automation Hub](https://console.redhat.com/ansible/automation-hub/repo/published/dellemc/unity) and use this command to install the collection anywhere in your system:
37
38 ansible-galaxy collection install dellemc-unity-2.1.0.tar.gz -p <install_path>
39
40 * Set the environment variable:
41
42 export ANSIBLE_COLLECTIONS_PATHS=$ANSIBLE_COLLECTIONS_PATHS:<install_path>
43
44 ## Using collections
45
46 * In order to use any Ansible module, ensure that the importing of proper FQCN (Fully Qualified Collection Name) must be embedded in the playbook.
47 This example can be referred to:
48
49 collections:
50 - dellemc.unity
51
52 * In order to use installed collection in a specific task use a proper FQCN (Fully Qualified Collection Name). Refer to this example:
53
54 tasks:
55 - name: Create volume
56 volume
57
58 * For generating Ansible documentation for a specific module, embed the FQCN before the module name. Refer to this example:
59
60 ansible-doc dellemc.unity.volume
61
62
63 ## Ansible modules execution
64
65 The Ansible server must be configured with Python library for Unity to run the Ansible playbooks. The [Documents](https://github.com/dell/ansible-unity/blob/2.1.0/docs/) provide information on different Ansible modules along with their functions and syntax. The parameters table in the Product Guide provides information on various parameters which needs to be configured before running the modules.
66
67 ## SSL certificate validation
68
69 * Copy the CA certificate to the "/etc/pki/ca-trust/source/anchors" path of the host by any external means.
70 * Set the "REQUESTS_CA_BUNDLE" environment variable to the path of the SSL certificate using the command:
71
72 export REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/source/anchors/<<Certificate_Name>>
73 * Import the SSL certificate to host using the command:
74
75 update-ca-trust extract
76 * If "TLS CA certificate bundle error" occurs, then follow these steps:
77
78 cd /etc/pki/tls/certs/
79 openssl x509 -in ca-bundle.crt -text -noout
80
81 ## Results
82 Each module returns the updated state and details of the entity, For example, if you are using the Volume module, all calls will return the updated details of the volume. Sample result is shown in each module's documentation.
83
84 ## Ansible execution environment
85 Ansible can also be installed in a container environment. Ansible Builder provides the ability to create reproducible, self-contained environments as container images that can be run as Ansible execution environments.
86 * Install the ansible builder package using:
87
88 pip3 install ansible-builder
89 * Ensure the execution-environment.yml is at the root of collection and create the execution environment using:
90
91 ansible-builder build --tag <tag_name> --container-runtime docker
92 * After the image is built, run the container using:
93
94 docker run -it <tag_name> /bin/bash
95 * Verify collection installation using command:
96
97 ansible-galaxy collection list
98 * The playbook can be run on the container using:
99
100 docker run --rm -v $(pwd):/runner <tag_name> ansible-playbook info_test.yml