Skip to content

Commit 0324794

Browse files
committed
Improved secret gathering
1 parent a045d26 commit 0324794

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

app/playbook.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,13 @@ def _process_block(b):
186186

187187
display.display(taskmsg)
188188

189-
return inventory.groups['vpn-host'].hosts[0].vars
190-
191-
@staticmethod
192-
def _flush_cache(inventory, variable_manager):
193-
for host in inventory.list_hosts():
194-
hostname = host.get_name()
195-
variable_manager.clear_facts(hostname)
189+
host = inventory.groups['vpn-host'].hosts[0].name
190+
fact_cache = pbex._variable_manager._nonpersistent_fact_cache[host]
191+
return {
192+
'CA_password': fact_cache['CA_password'],
193+
'p12_export_password': fact_cache['p12_export_password'],
194+
'algo_server_name': variable_manager.extra_vars['server_name'],
195+
'ipv6_support': fact_cache['ipv6_support'],
196+
'local_service_ip': variable_manager.get_vars()['hostvars'][host]['ansible_lo']['ipv4_secondaries'][0]['address'],
197+
'ansible_ssh_host': host,
198+
}

0 commit comments

Comments
 (0)