@@ -107,6 +107,12 @@ configuration, run the following command:
107
107
sshgen generate
108
108
` ` `
109
109
110
+ To display addition logs (verbose mode), add `--verbose` flag :
111
+
112
+ ` ` `
113
+ sshgen --verbose generate
114
+ ` ` `
115
+
110
116
After executing the command, you will see the following output :
111
117
112
118
` ` ` text
@@ -136,6 +142,36 @@ Host host4 postgres-server # group2
136
142
IdentityAgent ~/.1password/agent.sock
137
143
` ` `
138
144
145
+ If you ran using verbose mode, you should see additional information :
146
+
147
+ <details><summary>Verbose output example</summary>
148
+ <p>
149
+
150
+ ` ` ` text
151
+ [2023-10-21 17:53:31] [DEBUG] - Loading ansible hosts file: /home/user/code/python/sshgen/examples/hosts.yml
152
+ [2023-10-21 17:53:31] [DEBUG] - Total hosts found (include skipped): 4
153
+ [2023-10-21 17:53:31] [DEBUG] - Using template file /home/user/code/python/sshgen/sshgen/templates/ssh_config.template to generate ssh config
154
+ [2023-10-21 17:53:31] [DEBUG] - Filtering hosts where _skip metafield was defined
155
+ [2023-10-21 17:53:31] [DEBUG] - Host host1 should be skipped: False
156
+ [2023-10-21 17:53:31] [DEBUG] - Host host2 should be skipped: True
157
+ [2023-10-21 17:53:31] [DEBUG] - Host host3 should be skipped: False
158
+ [2023-10-21 17:53:31] [DEBUG] - Host host4 should be skipped: False
159
+ [2023-10-21 17:53:31] [DEBUG] - Processing host1 from group group1
160
+ [2023-10-21 17:53:31] [DEBUG] - Adding SSH port 22 for host host1
161
+ [2023-10-21 17:53:31] [DEBUG] - Adding aliases ['base', 'another-alias'] for host host1
162
+ [2023-10-21 17:53:31] [DEBUG] - Adding custom auth methods for host host1
163
+ [2023-10-21 17:53:31] [DEBUG] - Processing host3 from group group2
164
+ [2023-10-21 17:53:31] [DEBUG] - Adding SSH port 19222 for host host3
165
+ [2023-10-21 17:53:31] [DEBUG] - Processing host4 from group group2
166
+ [2023-10-21 17:53:31] [DEBUG] - Adding SSH port 22 for host host4
167
+ [2023-10-21 17:53:31] [DEBUG] - Adding aliases ['postgres-server'] for host host4
168
+ [2023-10-21 17:53:31] [DEBUG] - Adding custom auth methods for host host4
169
+ [2023-10-21 17:53:31] [INFO] - Generated SSH config file was saved to /home/user/code/python/sshgen/config
170
+ ` ` `
171
+
172
+ </p>
173
+ </details>
174
+
139
175
Copy and insert the output into your `~/.ssh/config` file. After that, you can use any of the defined aliases to SSH
140
176
into the corresponding hosts. For example, running `ssh base` will connect you to the host with the IP address 127.0.0.1
141
177
as the root user and utilizing 1password as your SSH agent.
0 commit comments