Open VinACE opened 5 years ago
import yaml my_dict = yaml.load(open('hosts.yaml'))
my_dict {'all': {'children': {'agents': {'hosts': {'1.0.0.4': None, '1.0.0.3': None}}, 'agent_publics': {'hosts': {'1.0.0.5': None}}, 'bootstraps': {'hosts': {'1.0.0.1': None}}, 'masters': {'hosts': {'1.0.0.2': None}}}, 'vars': {'dcos_exhibitor_address': 'masterlb.internal', 'dcos_resolvers': ['8.8.4.4', '8.8.8.8'], 'dcos_ip_detect_interface': 'eth0', 'dcos_master_list': ['2.0.0.2'], 'dcos_iaas_target': 'onprem', 'dcos_master_address': 'masterlb.external', 'dcos_dns_search': 'None', 'dcos_bootstrap_ip': '2.0.0.1'}}} exit Use exit() or Ctrl-D (i.e. EOF) to exit exit() superadmin@LP1048-Ubuntu:~/ansible-dcos_v01$ ansible all -i inventory.py -m ping [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
tried with the default file and check the JSON structure its reporting a invalid JSON...
~/ansible-dcos$ ansible hosts.yaml -i inventory.py -m ping [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: hosts.yaml