Example #1
0
 def __init__(self, options, platform):
     self.options = options
     self.platform = platform
     self.inventorycfg = options['inventory_path']
     self.logger = get_logger(options.get('logfile'),
                              options.get('loglevel'))
     self.cparser = configparser.ConfigParser(allow_no_value=True)
     self.inventory = {
         'all': {
             'hosts': []
         },
         'kube-master': {
             'hosts': []
         },
         'etcd': {
             'hosts': []
         },
         'kube-node': {
             'hosts': []
         },
         'k8s-cluster:children': {
             'hosts': [{
                 'hostname': 'kube-node',
                 'hostvars': []
             }, {
                 'hostname': 'kube-master',
                 'hostvars': []
             }]
         },
     }
Example #2
0
 def __init__(self, options):
     self.existing_ssh_agent = False
     self.options = options
     self.inventorycfg = options['inventory_path']
     self.logger = get_logger(options.get('logfile'),
                              options.get('loglevel'))
     self.logger.debug(
         'Running ansible-playbook command with the following options: %s' %
         self.options)
Example #3
0
 def __init__(self, options):
     self.existing_ssh_agent = False
     self.options = options
     self.inventorycfg = options['inventory_path']
     self.logger = get_logger(
         options.get('logfile'),
         options.get('loglevel')
     )
     self.logger.debug(
         'Running ansible-playbook command with the following options: %s'
         % self.options
     )
Example #4
0
 def __init__(self, options, cloud):
     self.options = options
     self.cloud = cloud
     self.inventorycfg = options['inventory_path']
     self.playbook = os.path.join(options['kubespray_path'], 'local.yml')
     self.cparser = configparser.ConfigParser(allow_no_value=True)
     self.Cfg = CfgInventory(options, cloud)
     self.localcfg = os.path.join(options['kubespray_path'],
                                  'inventory/local.cfg')
     self.instances = {
         'masters': {
             'file':
             os.path.join(options['kubespray_path'],
                          'masters_instances.json'),
             'json':
             None
         },
         'nodes': {
             'file':
             os.path.join(options['kubespray_path'],
                          'nodes_instances.json'),
             'json':
             None
         },
         'etcds': {
             'file':
             os.path.join(options['kubespray_path'],
                          'etcds_instances.json'),
             'json':
             None
         },
     }
     self.logger = get_logger(options.get('logfile'),
                              options.get('loglevel'))
     self.pbook_content = [{
         'gather_facts': False,
         'hosts': 'localhost',
         'become': False,
         'tasks': []
     }]
     self.logger.debug('''
          The following options were used to generate the inventory: %s
          ''' % self.options)
Example #5
0
 def __init__(self, options, cloud):
     self.options = options
     self.cloud = cloud
     self.inventorycfg = options['inventory_path']
     self.playbook = os.path.join(options['kubespray_path'], 'local.yml')
     self.cparser = configparser.ConfigParser(allow_no_value=True)
     self.Cfg = CfgInventory(options, cloud)
     self.localcfg = os.path.join(
         options['kubespray_path'],
         'inventory/local.cfg'
     )
     self.instances = {'masters':
                       {'file': os.path.join(
                        options['kubespray_path'], 'masters_instances.json'),
                        'json': None
                        },
                       'nodes':
                       {'file': os.path.join(
                        options['kubespray_path'], 'nodes_instances.json'),
                        'json': None
                        },
                       'etcds':
                       {'file': os.path.join(
                        options['kubespray_path'], 'etcds_instances.json'),
                        'json': None
                        },
                       }
     self.logger = get_logger(
         options.get('logfile'),
         options.get('loglevel')
     )
     self.pbook_content = [{
         'gather_facts': False,
         'hosts': 'localhost',
         'become': False,
         'tasks': []
     }]
     self.logger.debug('''
          The following options were used to generate the inventory: %s
          ''' % self.options)