Revision dc88fbaa gen-config.py

View differences:

gen-config.py
20 20
                    default="ansible.cfg", action="store", metavar="FILENAME",
21 21
                    help="Output file onto which the ansible configuration is "
22 22
                         "written (default=%(default)s)")
23
parser.add_argument("-u", "--user", dest="user",
24
                    default="segata", action="store", metavar="USERNAME",
25
                    help="Username for ssh config file (default=%(default)s)")
23 26
parser.add_argument("-i", "--inventory", dest="ansible_inventory",
24 27
                    default="ansible-hosts", action="store", metavar="FILENAME",
25 28
                    help="Output file onto which the ansible inventory is "
......
42 45
ansible_config_file = args.ansible_config
43 46
ansible_inventory_file = args.ansible_inventory
44 47
identity_file = args.identity
48
user = args.user
45 49

  
46 50
config_file = open(ssh_config_file, "w")
47 51
config_no_proxy_file = open(ssh_config_no_proxy_file, "w")
......
49 53
inventory_file = open(ansible_inventory_file, "w")
50 54

  
51 55
ssh_config = SSHConfig(SSH_CONFIG_TEMPLATE, HOST_CONFIG_TEMPLATE,
52
                       identity_file, PROXY_COMMAND_TEMPLATE)
56
                       identity_file, user, PROXY_COMMAND_TEMPLATE)
53 57
ssh_config_no_proxy = SSHConfig(SSH_CONFIG_TEMPLATE, HOST_CONFIG_TEMPLATE,
54
                                identity_file)
58
                                identity_file, user)
55 59
ansible_config = AnsibleConfig(ANSIBLE_CONFIG_TEMPLATE,
56 60
                               INVENTORY_CONFIG_TEMPLATE,
57 61
                               ANSIBLE_HOST_TEMPLATE, ansible_inventory_file,

Also available in: Unified diff