Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import yaml
- def inventory():
- ip_list = {}
- ip_list['10.25.152.200'] = None
- ip_list['10.25.152.201'] = None
- inventory = dict(all = dict (
- children = dict(
- qa = dict(
- hosts = ip_list,
- vars = dict(
- ansible_ssh_user = 'foo',
- ansible_ssh_pass = 'bar'
- )
- )
- )
- )
- )
- return inventory
- def main():
- with open('/tmp/inventory.yml', 'w') as outfile:
- yaml.dump(inventory(), outfile, default_flow_style=False)
- if __name__ == "__main__":
- main()
Add Comment
Please, Sign In to add comment