The pass implementation uses a pass database to store the Ansible inventory and other infrastructure related information.
Besides storing other information, the pass database also stores the team Ansible Inventory.
The structure of the inventory is the following:
Level | Type | Data | Comments | ||
---|---|---|---|---|---|
Level 1 |
Directory |
Provider |
The name of the provider is used to split VMs for different providers. Currently only
|
||
Level 3 |
Directory |
VM |
Name that will be given to the VM. It will also be used as the Ansible Host name. |
||
Level 3 |
Entry |
Ansible attributes |
One entry for each Ansible attribute that will be translated into a environment variable. |
||
Level 3 |
Directory |
|
List of groups into which the host will be associated to. |
||
Level 4 (under |
Entries |
|
One entry for each group the host will be associated with. The entry name is the group name. |
The ansible inventory obtained from the pass database is built using the python script located at ../ansible/inventory/pass_inventory.py.
Information on the available playbooks is available here.
All the information related to the hosts will be stored in the passwrodstore Ansible inventory. The current implementation also stores the ssh public and secret keys locally on each ~/.ssh
folder. To improve usability this bash script has been created to make it easier to perform this connection. More documentation on the bash script can be found here.
To SSH connect to a VM use the tools/passstore-vm-ssh.sh
bash script.
The 3 arguments to pass to the script are the following.
Command | Description |
---|---|
1: string / required |
Cloud provider Choices:
|
2: string / required |
Name of the VM to connect to. This is the inventory name of the VM. |
3: string |
Folder where the PASSWORDSTORE database is located Default: |
./tools/passstore-vm-ssh.sh openstack ${VM_NAME}
This should connect ot the newly created VM.
Last login: Thu Jan 1 00:00:00 1970 from x.x.x.x
This machine is property of RedHat. Access is forbidden to all unauthorized person. All activity is being monitored. Welcome to vm20210221-t01..