Debian Codegraph @

ansible_collections/dellemc/powerflex/docs/INSTALLATION.md

raw symbols SCIP
1 # Installation and execution of Ansible modules for Dell PowerFlex
2
3 ## Installation of SDK
4 * Install the python SDK named [PyPowerFlex](https://pypi.org/project/PyPowerFlex/). It can be installed using pip, based on appropriate python version. Execute this command:
5
6 pip install PyPowerFlex
7 * Alternatively, Clone the repo "https://github.com/dell/python-powerflex"
8 using command:
9
10 git clone https://github.com/dell/python-powerflex.git
11 * Go to the root directory of setup.
12 * Execute this command:
13
14 pip install .
15
16 ## Building collections
17 * Use this command to build the collection from source code:
18
19 ansible-galaxy collection build
20
21 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)
22
23 ## Installing collections
24
25 #### Online installation of collections
26 * Use this command to install the latest collection hosted in [galaxy portal](https://galaxy.ansible.com/dellemc/powerflex):
27
28 ansible-galaxy collection install dellemc.powerflex -p <install_path>
29
30 #### Offline installation of collections
31
32 * Download the latest tar build from any of the available distribution channel [Ansible Galaxy](https://galaxy.ansible.com/dellemc/powerflex) /[Automation Hub](https://console.redhat.com/ansible/automation-hub/repo/published/dellemc/powerflex) and use this command to install the collection anywhere in your system:
33
34 ansible-galaxy collection install dellemc-powerflex-3.0.0.tar.gz -p <install_path>
35
36 * Set the environment variable:
37
38 export ANSIBLE_COLLECTIONS_PATHS=$ANSIBLE_COLLECTIONS_PATHS:<install_path>
39
40 ## Using collections
41
42 * In order to use any Ansible module, ensure that the importing of proper FQCN (Fully Qualified Collection Name) must be embedded in the playbook.
43 This example can be referred to:
44
45 collections:
46 - dellemc.powerflex
47
48 * In order to use installed collection in a specific task use a proper FQCN (Fully Qualified Collection Name). Refer to this example:
49
50 tasks:
51 - name: Get Volume details
52 dellemc.powerflex.volume
53
54 * For generating Ansible documentation for a specific module, embed the FQCN before the module name. Refer to this example:
55
56 ansible-doc dellemc.powerflex.volume
57
58
59 ## Ansible modules execution
60
61 The Ansible server must be configured with Python library for PowerFlex to run the Ansible playbooks. The [Documents](https://github.com/dell/ansible-powerflex/blob/main/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.
62
63 ## SSL certificate validation
64
65 * Copy the CA certificate to the "/etc/pki/ca-trust/source/anchors" path of the host by any external means.
66 * Set the "REQUESTS_CA_BUNDLE" environment variable to the path of the SSL certificate using the command:
67
68 export REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/source/anchors/<<Certificate_Name>>
69 * Import the SSL certificate to host using the command:
70
71 update-ca-trust extract
72 * If "TLS CA certificate bundle error" occurs, then follow these steps:
73
74 cd /etc/pki/tls/certs/
75 openssl x509 -in ca-bundle.crt -text -noout
76
77 ## Results
78 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.
79
80 ## Ansible execution environment
81 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.
82 * Install the ansible builder package using:
83
84 pip3 install ansible-builder
85 * Ensure the execution-environment.yml is at the root of collection and create the execution environment using:
86
87 ansible-builder build --tag <tag_name> --container-runtime docker
88 * After the image is built, run the container using:
89
90 docker run -it <tag_name> /bin/bash
91 * Verify collection installation using command:
92
93 ansible-galaxy collection list
94 * The playbook can be run on the container using:
95
96 docker run --rm -v $(pwd):/runner <tag_name> ansible-playbook info_test.yml