Saves Ansible inventory to file.

    Parameters
    ----------
    inventory: ConfigParser.SafeConfigParser
        content of the `hosts_file`
    hosts_file: str, optional
        path to Ansible hosts file

def save_inventory(inventory, hosts_file=HOSTS_FILE):
    '''Saves Ansible inventory to file.

    Parameters
    ----------
    inventory: ConfigParser.SafeConfigParser
        content of the `hosts_file`
    hosts_file: str, optional
        path to Ansible hosts file
    '''
    with open(hosts_file, 'w') as f:
        inventory.write(f)