Beispiel #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': []
             }]
         },
     }
Beispiel #2
0
 def __init__(self, options, platform):
     self.options = options
     self.platform = platform
     self.inventorycfg = options['inventory_path']
     file = open(self.inventorycfg, 'w+')
     self.logger = get_logger(options.get('logfile'), options.get('loglevel'))
     self.cparser = configparser.ConfigParser(allow_no_value=True)
Beispiel #3
0
 def __init__(self, options, cloud):
     self.options = options
     self.cloud = cloud
     self.inventorycfg = options['inventory_path']
     self.playbook = os.path.join(options['kargo_path'], 'local.yml')
     self.cparser = configparser.ConfigParser(allow_no_value=True)
     self.Cfg = CfgInventory(options, cloud)
     self.localcfg = os.path.join(
         options['kargo_path'],
         'inventory/local.cfg'
     )
     self.instances_file = os.path.join(
         options['kargo_path'],
         'instances.json'
     )
     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)
Beispiel #4
0
 def __init__(self, options):
     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)
Beispiel #5
0
 def __init__(self, options):
     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
     )
 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': []}
                           ]},
                     }