Skip to content

Commit

Permalink
Improved secret gathering
Browse files Browse the repository at this point in the history
  • Loading branch information
summerisgone committed Apr 4, 2020
1 parent a045d26 commit 0324794
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions app/playbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,13 @@ def _process_block(b):

display.display(taskmsg)

return inventory.groups['vpn-host'].hosts[0].vars

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

0 comments on commit 0324794

Please sign in to comment.